1 first confirm that the directory to be restricted is a separate file system
Df-h/home Test
2 If it is a separate file system. You need to add quota support to the directory.
A: Temporary program, computer restart failure: Mount-o remount,usrquota,grpquota/home
B: Reboot can also be used:
Edit Fstab File: Vi/etc/fstab
Add the following usrquota,grpquota:label=/home/home to the Fstab file ext3 Defaults,usrquota,grpquota 1 2
3: Establish quota files
Quotacheck-avug
-A: Scan all in/etc/mtab, tons of quota support filesystem, plus this parameter,/mount_point can not write, because scan all filesystem!
-U: For users to scan the file does not 弽 use, will establish aquota.user
-G: In view of the group scan file does not 弽 use situation, will establish aquota.group
-V: Displays the information of the scanning process;
-F: Force scan of file system, and write new quota configuration file (dangerous)
-M: Forces a read-write scan of the file system to be used only under special circumstances.
4: Start Quota
Quotaon [-avug] Boot
-U: Quota (aquota.user) for users
-G: For group starter quota (Aquota.group)
-V: Displays the relevant information about the process;
-A: According to the filesystem 讴 in the/etc/mtab quota, if not add-a, then need to add a specific filesystem Oh!
5:quota off
-A: All filesystem quota are closed (according to/etc/mtab)
-U: Turn off user quota only for the/mount_point that follows
-G: Closes the group quota only for the/mount_point that follows
6:quota Editor
Edquota [-u username] [-g GroupName]
-U: Take account name back. Can enter the quota edit screen (vi) to 讴 fixed username limit value;
-G: After the group name. Can enter the quota edit screen (vi) to 讴 fixed groupname limit value;
-T: You can modify the grace time.
-P: Copy template. The template account for the existing and set a good quota users, meaning "the model account this person's quota limit to copy to the new account"!
Use the following command to modify the quota for myquota1
Edquota-u myquota1
This will go to VI mode, the fields that can be edited are as follows: (Soft/hard is 0 o'clock, means no restriction)
A. File system (FileSystem): Describes which file system (partition) The limit value is for;
B. Disk capacity (Blocks): This value is quota to calculate the 杢, the unit is Kbytes, please do not change it;
C. Soft: Soft limit for disk capacity (block), in KB
D. Hard:block hard limit, per KB;
E. Number of archives (inodes): This is the quota of their own calculation, the number of units, please do not change him;
F. Soft:inode the soft limit value;
G. Hard:inode the hard limit value;
Use the following command copy quota settings
Edquota-p Myquota1-u Myquota2
Use the following command to set up the quota group:
Edquota-g MYQUOTAGRP
Set the quota grace period by using the following command:
Edquota-t
Use the command to enter VI mode, you can edit the contents as follows:
FileSystem block grace period Inode grace period
/dev/hda3 14days 7days
7:quota Report View:
quota [-uvs] [username]
quota [-gvs] [groupname]
-U: Username can be followed to indicate the quota limit value for the user. If the username is not connected, the quota limit value of the performer is displayed.
-G: GroupName can be followed to indicate the quota limit value of the group.
-V: Displays the quota value of each user in filesystem;
-S: Use 1024 for multiple 杢 挃 units, will display such as M units!
Use the following command to view the user quota settings:
Quota-uvs myquota1 Myquota2
Use the following command to view the set values for the group quota:
Quota-gvs MYQUOTAGRP
8:repquota: Reporting on file system limits
repquota-a [-vugs]
-A: Direct to/etc/mtab search for filesystem with quota signs, and report quota results;
-V: The output data will be all filesystem related information;
-U: Displays the user's quota limit (this is the default value);
-G: Displays the quota limit for individual groups.
-S: Display results using M, G for units
Use the following command to view all quota settings for the current file system
Repquota-auvs
9:setquota: Set the quota limit directly in the order
Setquota [-u|-g] name block (soft) block (hard)
Use the following command to set the value of the quota directly:
Setquota-u Myquota5 100000 200000 0 0/home
10:warnquota: Send a warning letter to a person exceeding the limit
Modify/etc/warnquota.conf
Let the system perform Warnquota automatically
Edit Vi/etc/cron.daily/warnquota
Add the following command:/usr/sbin/warnquota # you're not wrong! As long as this line, the execution file is written in an absolute path!