PRIMECLUSTER Global File Services Configuration and Administration Guide 4.2 (Solaris(TM) Operating Environment) |
Contents Index |
Part 2 Global File Services Local File System | > Chapter 7 Managing Restriction of GFS Local File System Usage | > 7.4 Setup of quota Function |
1. Create a quotas file.
With super user authority, execute the touch(1) command to create a quotas file in the root directory of the GFS Local File System that uses the quota function. In addition, execute the chmod(1) command to set the access authority of the quotas file to [rw...]. In the following example, a quotas file is created in the mount point /sfxfs directory.
Mount the target file system in advance.
# cd /sfxfs # touch quotas # chmod 0600 quotas
2. Specify the user limit values.
With super user authority, execute the sfxedquota(1M) command to specify the user limit values. In the following example, user limit values are specified for user1.
# sfxedquota user1
After the above command is executed, the editor displays the following contents. Specify each limit value.
fs /sfxfs blocks (soft = 0, hard = 0) inodes (soft = 0, hard = 0)
In the following example, the maximum number of blocks that can be used is specified as five megabytes (warning message output at three megabytes) and the maximum number of files that can be created is specified as 99 (warning message output at 80 files).
fs /sfxfs blocks (soft = 3072, hard = 5120) inodes (soft = 80, hard = 100)
3. Copy the user limit values.
To copy the user limit values specified for user1 to another user, execute the sfxedquota(1M) command specified with the -p option. In the following example, user limit values specified for user1 are copied for user2 and user3.
4. Specify the time limit when the soft limit value is exceeded.
Execute the sfxedquota(1M) command with the -t option specified to specify the time limit. This setting applies to all users except for the super user. In the following, the time limit is specified.
# sfxedquota -t
After the above command is executed, the editor displays the following contents. Specify each time limit.
fs /sfxfs blocks time limit = 0 (default),files time limit = 0 (default)
For default value 0, one week is displayed. Specify the unit after the value. The units that can be specified are month, week, day, hour, min, and sec.
In the following example, the time limit for the number of blocks is specified as two weeks and the time limit for the number of files is specified as 16 days.
fs /sfxfs blocks time limit = 2 week, files time limit = 16 day
5. Enable the quota function.
With super user authority, execute the sfxquotaon(1M) command to enable the quota function. In the following example, /sfxfs is enabled.
# sfxquotaon /sfxfs
6. Check the usage conditions of quota data.
Execute the sfxquota(1M) command to check the usage conditions for each user. In the following example, the usage conditions are checked for user1.
# sfxquota -v user1 Disk quotas for user1 (uid 1000): Filesystem usage quota limit timeleft files quota limit timeleft /sfxfs 2258 3072 5120 71 80 100
Execute the sfxrepquota(1M) command to check the usage conditions in units of file systems. In the following example, the usage conditions are checked for mount point /sfxfs.
# sfxrepquota -v /sfxfs /dev/sfdsk/gfs/dsk/vol1400 (/sfxfs): Block limits File limits User used soft hard timeleft used soft hard timeleft user1 -- 2258 3072 5120 71 80 100 user2 -- 1345 3072 5120 38 80 100 user3 ++ 3424 3072 5120 7.0 days 81 80 100 7.0 days :
7. Edit the /etc/vfstab file.
Add the entries related to the target file system to the /etc/vfstab file. For more information, see Section 7.5.1, "Enabling at system boot."
The /etc/vfstab file can be edited before quotas files are created. Editing the /etc/vfstab file beforehand is effective if the quota function is set up for multiple GFS Local File Systems.
Contents Index |