To setup journaled quota on an ext4 filesystem you will need to install quota if not already installed and then modify your mount points in fstab, first off install quota
yum install quota
next you will need to edit fstab and then edit your mount point options by adding usrjquota=aquota.user,grpjquota=aquota.grp,jqfmt=vfsv0
UUID=00000001-0001-0001-0001-aaaaaaaaaaa1 / ext4 defaults,noatime 1 1
UUID=00000002-0002-0002-0002-aaaaaaaaaaa2 /boot ext4 defaults 1 2
UUID=00000003-0003-0003-0003-aaaaaaaaaaa3 /var ext4 defaults,noatime,usrjquota=aquota.user,grpjquota=aquota.grp,jqfmt=vfsv0 1 2
UUID=00000004-0004-0004-0004-aaaaaaaaaaa4 swap swap defaults 0 0
Once you have edited fstab you then need to remount your filessystem or reboot the server (I personally prefer to reboot).
mount -o remount /var
Now that you have remounted the filesystem you will need to run a quota check, if you are getting permissions errors with the quotacheck then you may need to look at SELinux, a quick solution to this is to set quota to permissive semanage permissive -a quota_t
quotacheck -avugm
once the quota check has completed you can then enable quotas
quotaon -avug
Once this has been enbaled you should see 2 files in /var/ ls -l /var/
-rw------- /var/aquota.grp
-rw------- /var/aquota.user
At this point you have now setup the quotas for all users on your system, you can view the quotas with repquota -a
*** Report for user quotas on device /dev/mapper/vg_data-lv_var
Block grace time: 7days; Inode grace time: 7days
Block limits File limits
User used soft hard grace used soft hard grace
----------------------------------------------------------------------
root -- 163232076 0 0 159391 0 0
daemon -- 12 0 0 3 0 0
lp -- 8 0 0 2 0 0
rpc -- 8 0 0 4 0 0
abrt -- 12 0 0 3 0 0
haldaemon -- 8 0 0 2 0 0
ntp -- 12 0 0 3 0 0
postfix -- 4748 0 0 1005 0 0
bob -- 65606 0 0 1005 0 0
Edit User quota
To edit a users quota use edquota
to make changes in the users quota file.
When making changes to the users quota take not of the vaules and what they mean.
- Shows the name of the file system that has a quota enabled
- Shows the amount of blocks currently used by the user
- Shows the soft block limit for the user on the file system
- Shows the hard block limit for the user on the file system
- Shows the amount of inodes currently used by the user
- Shows the soft inode limit for the user on the file system
- Shows the hard inode limit for the user on the file system
edit user quota edquota bob
Disk quotas for user bob (uid 10720):
Filesystem blocks soft hard inodes soft hard
/dev/mapper/vg_data-lv_var 29936 0 0 337 0 0
Some other command that may be of fuse while managing quotas.
- Turn on disk quotas for a file system:
quotaon
- Turn off disk quotas for a file system:
quotaoff
- List user quota:
quota -u user_id
- Quota summary report:
repquota -a
- Human readable quota summary report:
repquota -as