Lets say that your /home partition is in / mount point
install quota on your centos
yum install quota
Edit: /etc/fstab
vi /etc/fstab
replace "defaults" with "usrjquota=quota.user,jqfmt=vfsv0" for / mount point
Before (in some cases this can be different!):
UUID=ac567666-9385-4ef5-885c-80f61ec64647 / ext3 defaults 1 1
After Replace: UUID=ac567666-9385-4ef5-885c-80f61ec64647 / ext3 usrjquota=quota.user,jqfmt=vfsv0 1 1
mount -o remount /
quotacheck -avugm
quotaon -avug
If you have /home in /etc/fstab then you will need to edit line matching /home
replace "defaults" with "usrjquota=quota.user,jqfmt=vfsv0" for /home mount point
Before: UUID=ac567666-9385-4ef5-885c-80f61ec64647 /home ext3 defaults 1 1
After Replace: UUID=ac567666-9385-4ef5-885c-80f61ec64647 /home ext3 usrjquota=quota.user,jqfmt=vfsv0 1 1
mount -o remount /home
quotacheck -avugm
quotaon -avug
Now you need to add this into the CWP Configuration
mkdir -p /usr/local/cwp/.conf/
echo "/home" > /usr/local/cwp/.conf/quota_part.conf
How to check if quota works ?
repquota -a
This will display you user limits
Set quota for all users by package from cwp
/scripts/cwp_api account update_diskquota_all
If you had previously added users then you will need to update quota for them, you can do that by clicking on each account edit and then saving changes, or you can edit packages and save it for all users.
XFS Quota (only for XFS file system!!!)
yum -y install quota quota-devel
edit file: /etc/fstab and add usrquota,grpquota example:
/dev/mapper/centos_root-home /home xfs defaults,usrquota,grpquota 0 0
before example
/dev/mapper/centos_root-home /home xfs defaults 0 0
aftere example
/dev/mapper/centos_root-home /home xfs defaults,usrquota,grpquota 0 0
Activate quota as XFS for /home
in CWP.admin go to Left Menu -> Server Settings --> Disk Quota , and set
Quota Partition: /home
Quota Type: xfs
reboot the server
Next, activate quota for all accounts
in cwp.admin go to Left Menu -> Packages -> List Packages
edit all packages you have and select "Update Quota" to set the quota for all accounts using this package.
How to check if /home is mounted with quota
mount |grep home
if you have there listed usrquota,grpquota for /home then all should work fine.