1. Check whether the system kernel supports quotas.
# Dmesg | grep quota
2. Check whether the software supporting quota is installed in the system.
# Rpm-qa | grep quota
3. Enable the quota function for mounted partitions
# Mount-o usrquota, remount/dev/sda1/quota // This is only temporarily enabled and can be enabled after restart
, You need to modify/etc/fstab
# Vim/etc/fstab
/Dev/sda1/quota ext3 defaults, usrquota 0 0
4. Create a quota file to record user quota Information
# Quotacheck-cuv
5. Set the user quota
6. enable or disable Disk Quota Management.
# Quotaon/dev/sda1
# Quotaon-avug
Or
# Quotaoff/dev/sda1
# Quotaoff-avug
7. view User quota Information
# Repquota-a (for administrator only)
# Quota User Name
8. send an email to the user who has exceeded the quota.
# Warnquota
The email content can be defined by the configuration file/etc/warnquota.
9. directly use the command to set the quota
# Setquota-u xiaozhu 1000 1500 6 10/quota
10. For example, I want to configure a quota for/var/spool/mail, but/var/spool/mail is not an independent partition.
Solution:
1. Move/var/spool/mail to the new folder mail in the independent partition.
2. Use ln-s/home/mail/var/spool/mail to create a soft connection
3. Limit the quota of the independent partitions in which mail is located.
Author: "New network subnet"