Sunday, May 8, 2011

Filesystem Quota

1. edit /etc/fstab
/dev/mapper/myvg-lvhome /home ext4 defaults,usrquota,grpquota 1 1
#mount -o remount /home

2. create the quota database. this command will create aquota.user aquota.group
#quotacheck -cug /home

3. check quota
[root@rhel03 home]# quotacheck -avug
quotacheck: Your kernel probably supports journaled quota but you are not using it. Consider switching to journaled quota to avoid running quotacheck after an unclean shutdown.
quotacheck: Scanning /dev/mapper/myvg-lvhome [/home] done
quotacheck: Checked 7 directories and 5 files

4. edit quota
#edquota -u chris >> edit user quota
#edquota -t >> edit grace period
#edquota -T <user> >> edit grace period of a user (minutes)

5. report quota
#repquota -uv /home

6. check quota on a filesystem
#quotaon -help
#quotaon -vug /home >> enable user and group quota on /home fs

1 comment:

  1. I'm stuck with disk quotas, I have a VM guest server with the standard Desktop packages. I always get permission denied when running quotacheck to create the user and group quota files. I have to actually change selinux to permissive or disabled to make disk quotas work... are there any standard procedure to make disk quota work with selinux? I notice that with a base server configuration(no GUI desktop packages) I have no problems with selinux and quotas...

    ReplyDelete