To enable disk quotas in ISPmanager, browse to the "Software" module, and set up or activate "Disk quotas".
ISPmanager will:
Once you are done, users will see the "Disk" column in the interface menu, and you will be able to set disk limit per each user (ISPmanager calculates quota every 2 minutes).
repquota -g / - for EXT4 file system
xfs_quota -x -c 'report -g' - for XFS file system
If ISPmanager failed to enable disk quotas, complete the following steps:
Find the directory that was selected for user files:
/usr/local/mgr5/sbin/mgrctl -m ispmgr pathlist |grep DefaultHomeDir || /usr/local/mgr5/sbin/mgrctl -m ispmgrnode pathlist |grep DefaultHomeDir
Check where it is located:
df <found_directory> |tail -1 | awk '{print $6}'
Execute the command
mount | grep 'on <found_partition> '
It will show mounting options for file system's root. They must include
grpquota,usrquota
If quotas are not enabled, add the options into /etc/fstab like that:
UUID=<UUID> <found_partition> ext4 defaults,grpquota,usrquota 1 1
Re-mount the found partition with the command
mount -o remount <found_partition>
Run
quotacheck -gum /
Execute the command
quotaon -guv /
The xfs file system is used by default On CentOS 7. Quotas are enabled during setup. Reboot the server after the disk quotas packet is installed in ISPmanager.
1. Add quota options into GRUB_CMDLINE_LINUX of the /etc/default/grub file
rootflags=usrquota,grpquota
2. Make a backup copy:
cp /boot/grub2/grub.cfg /boot/grub2/grub.cfg.back
3. Generate a new config:
grub2-mkconfig -o /boot/grub2/grub.cfg
Restart the server.
The root directory will be mounted with required options:
mount | grep ' / '
/dev/vda3 on / type xfs (rw,relatime,attr2,inode64,usrquota,grpquota)
Now you can enable disk quotas in ISPmanager.
You can see the following error in logs:
Dec 5 16:09:02 [3228:38] proc EXTINFO Run '/bin/sh -c quotasync\ -g\ /' pid 3658
Dec 5 16:09:02 [3228:38] proc EXTINFO Process 3658 finished with status 1
This is a typical behavior for the reiserfs file system ( OpenVZ).
To resolve this issue, add the DisableQuotasync option into the ispmgr.conf configuration file (or ispmgrnode.conf if you are using ISPmanager Business)
Option DisableQuotasync — do not call the quotasync command to get information on disk quotas.
After adding the option into the configuration file, execute killall core to restart the panel
But du -sh on the user directory shows 1,6 GB
This means that the user directory contains the files which group does not correspond to the user group.
Execute the command to find the files
find /var/www/user/ -not -group user
Execute the command to find the files
find / -path /var/www/user/ -group user