Introduction
To enable quotas on a server using XFS, you can use the WHM: Initial Quota Setup Feature. The feature will run the 'intiquotas' script.
There is a requirement of an extra step to reboot the server when it completes for quotas to be functional.
Procedure
1. Log in to the server as 'root' using SSH, or use the WHM: Terminal Feature.
2. Use the following command to verify your filesystems are mounted using XFS.
Filesystem as seen in /etc/fstab:
# grep xfs /etc/fstab
/dev/mapper/centos_whm1-root / xfs defaults,uquota 0 0
UUID=fe712bf1-6f9f-4f69-950f-add2a660dfd4 /boot xfs defaults 0 0
/dev/mapper/centos_whm1-home /home xfs defaults 0 0
Filesystems that are currently enabled:
# mount | grep xfs | grep -v virtfs
/dev/mapper/centos_whm1-root on / type xfs (rw,relatime,attr2,inode64,uquota)
/dev/sda2 on /boot type xfs (rw,relatime,attr2,inode64,noquota)
/dev/mapper/centos_whm1-home on /home type xfs (rw,relatime,attr2,inode64,uquota)
/dev/mapper/centos_whm1-root on /var/tmp type xfs (rw,relatime,attr2,inode64,uquota)
* For each mounted partition, ensure the mount option for quota is enabled.
* Example above shows the mount option: uquota
3. Once you verify your XFS filesystem is mounted, log into the WHM interface, and navigate to the following location:
WHM: Home -> Server Configuration -> Initial Quota Setup
4. View the page, and click 'Proceed'. *Note the warning about rebooting the server afterward*
5. Depending on how big the filesystems are, it may take some time to complete. But, once complete, it should look similar to this:
6. Once the quotas are enabled, use the WHM interface to reboot the server.
WHM: Home »System Reboot »Graceful Server Reboot
If you wish to skip Steps 3, 4, 5, & 6 and run the commands needed manually, you can use the following.
Run commands as 'root' on the command line:
/scripts/initquotas
/scripts/fixquotas
reboot
---
Using the above steps, including rebooting the server, should result in quotas being enabled on the server. However, if you find that the quotas are still unable, it will be necessary to check and modify the GRUB settings on the server. GRUB is a low-level system responsible for booting the server. Modification can result in the server becoming unbootable.
If unfamiliar with GRUB, we recommend reaching out to a qualified System Administrator with the next set of instructions. If you do not have a System Administrator, you can find one here: System Administration Services
These are the steps needed to enable quotas on a server using XFS if the above steps do not enable them.
.
Check file /etc/sysconfig/grub and make sure the line starting with GRUB_CMDLINE_LINUX= ends with
rootflags=uquota
Then make a backup of /boot/grub2/grub.cfg with
cp -ax /boot/grub2/grub.cfg /boot/grub2/grub.cfg.$(date +%s)
Then run the following to rebuild /boot/grub2/grub.cfg
grub2-mkconfig -o /boot/grub2/grub.cfg
and then reboot the server.
Comments
0 comments
Article is closed for comments.