Securing and Optimizing Linux: RedHat Edition -A Hands on Guide | ||
---|---|---|
Prev | Chapter 20. Set Limits using Qouta | Next |
After the modification of your /etc/fstab file, in order for quotas to be established on a file system, the root directory of the file system i.e. /home in our example must contain a file, owned by root, called quota.user if you want to use user quota, quota.group if you want to use group quota, or both if you want to use users and group quota.
Create the quota.user and/or quota.group files, as root go to the root of the partition you wish to enable quota i.e. /home doing:
[root@deep] /# touch /home/quota.user [root@deep] /# touch /home/quota.group [root@deep] /# chmod 600 /home/quota.user [root@deep] /# chmod 600 /home/quota.group |
: Both quota record files, quota.user and quota.group, should be owned by root, with read-write permission for root and none for anybody else.
Now we must initialize the files quota.user and quota.group in the root directory of the file system in order to not receive an error messages about quota during the reboot of our server. To initialize quota.user and/or quota.group files, use the following commands:
[root@deep] /# edquota -u wahib [root@deep] /# edquota -g wahib |
After you have finished setting the appropriate options for your quota program in the /etc/fstab file, and created and initialized the quota.users, and/or quota.group files, you must reboot the system for the changes you have made in the /etc/fstab file and/or the files quota.user, quota.group to take effect. To reboot your system, use the following command:
[root@deep] /# reboot |
After your system has been rebooted you can assign quotas to users or groups of users on your system. This operation is performed with the edquota command. See man page edquota(8)