Managing Quotas in Linux Using CyberPanel – How to Enable and Check User Quotas
Note: 15% limited time off on our life-time plans using code: QT15
In Linux systems, disk quotas are considered critical factors in the management of disk space and the number of inodes (files) consumed by a user or group of users. They can then help system administrators limit the amount of disk resources any one user might be able to consume, thus being significant, especially in multi-user environments. Most often, managing disk quotas is operated at the OS level, and here, CyberPanel utilities utilize these for disk utilization through its graphical interface.
This guide is going to take you through common quota issues, how to troubleshoot using practical commands, and how to set up or verify quota configurations on how everything should run smoothly on your system.
CyberPanel and Quotas
By default, quota support is available in CyberPanel from version v2.3.7, and as per the guide provided below, CyberPanel enables quotas in EXT4 and XFS. However, if for some reason your quotas do not work, you can further debug and enable quotas using the guide provided below, and you can also contact our support.
For Quotas to work you must Enforce Disk limits for the said package.
Information For a Support Request
When you are confused about issues regarding quota and need contact support. You can run the following commands and provide the full output:
cat /etc/fstab
df -h
- mount | grep ‘ / ‘
How To Enable Quota Support On ext4
We’ve written a dedicated guide on how to enable Quotas on ext4 file system.
How to Enable Quota Support on XFS
The XFS filesystem requires a slightly different setup as compared to ext4. When you need quotas set up on ‘/’, then you require extra steps. Here is the command to confirm what setup you have:
df -h
To confirm the system is using / partition in XFS filesystem, run this command:
/dev/mapper/centos-root on / tyoe xfs (rw, relatime, attr2, inode64, noquota)
When You See ‘nonquota’ Option
If you see ‘nonquota’ option. Find line ‘GRUB-CMDLINE-LINUX’
GRUB_CMDLINE_LINUX="rd.lvm.lv=centos/swap vconsole.font=latarcyrheb-sun16 rd.lvm.lv=centos/root crashkernel=auto vconsole.keymap=us rhgb quiet"
Now, we are putting “rootflags=” variable at the end of the line. Detail command is the following:
GRUB_CMDLINE_LINUX="rd.lvm.lv=centos/swap vconsole.font=latarcyrheb-sun16 rd.lvm.lv=centos/root crashkernel=auto vconsole.keymap=us rhgb quiet rootflags=uquota,pquota"
Create a backup of your grub.cfg file and generate a new one:
cp /boot/grub2/grub.cfg /boot/grub2/grub.cfg.orig grub2-mkconfig -o /boot/grub2/grub.cfg
On some systems, path may be like the following:
/boot/efi/EFI/centos/grub.cfg
Now, you have to reboot the system to apply changes:
roboot
If /home is part of the root partition, you have to confirm that’/’ using XFS:
# mount | grep ' / ' /dev/mapper/centos-root on / type xfs (rw,relatime,attr2,inode64,usrquota,prjquota)
On AlmaLinux 9.X, enable XFS quota with:
grubby --update-kernel=ALL --args="rootflags=uquota,pquota" reboot
To enable CGroup PSI, you can modify the above command
grubby --update-kernel=ALL --args="rootflags=uquota,pquota psi=1" reboot
FAQs
Q1: What is a disk quota?
Disk quota is a limit put on the amount of space a user or group would be allowed to use on a filesystem. This helps manage your storage resources better.
Q2: Why should I allow quotas on my system?
Allowing quotas allows someone from consuming all available disk space, possibly impacting performance and preventing other users from saving files.
Q3:How would you set up different quotas for different users?
yes, one can use the edquota command and assign a quota for each user to every group individually based upon needs.
Q4:What if a user surpasses his quota?
If the user surpasses his quota then they will not be able to save new files and will also not be able to change any existing ones until they drop below the limit.
Q5: What is the command to check quota usage of a user at present?
You can check the quota usage of the current user with the following command:
quota username
Conclusion
The checks for quotas to the /home partition are also important for proper space management. All of the steps mentioned above will, therefore, ensure that access is controlled in terms of storage for the users so that a problem of overuse may not arise in disks. Proper configuration of quotas has a positive effect not only on improved system performance but also on challenging the users to share fairly. Quota monitoring as well as quota tailoring will help further to have a balanced and efficient system for all users.