Persistent Noquota Option Preventing Quota Activation
AnsweredI am facing an issue with enabling disk quotas on my server. The server is running AlmaLinux 9.5 with cPanel/WHM 11.124.0.28, and it is using a standard BIOS system.
I reviewed the following articles:
- How to Fix Quotas
- Enabling XFS Quotas
- How to enable quotas from WHM for servers using the XFS filesystem
- How to enable quotas
- Initial Quota Setup
Initially, I ran the "Initial Quota Setup" command, rebooted, and received the "Reboot To Enable Filesystem Quotas Reminder" and "Filesystem Quotas Ready" notification emails.
And I ran these commands and rebooted after each:
/scripts/initquotas
/scripts/fixquotas
Despite manually configuring /etc/fstab with the usrquota and grpquota options (see below) and attempting to remount the filesystem, the noquota option persists. I tried mounting without and with explicit quota options.
sudo mount -o remount /
sudo mount -o remount,usrquota,grpquota /
Below are some relevant details:
1. Filesystem Configuration: (UUID obfuscated here for security reasons)
[user@server ~]$ grep quota /etc/fstab
UUID=00000000-0000-0000-0000-000000000000 / xfs defaults,usrquota,grpquota 0 0
2. Mount Output:
[user@server ~]$ mount | grep xfs | grep -v virtfs
/dev/sda2 on / type xfs (rw,relatime,attr2,inode64,logbufs=8,logbsize=32k,noquota)
3. Logs and Command Outputs:
Kernel supports quotas.
[user@server ~]$ dmesg | grep quota
[ 0.153578] VFS: Disk quotas dquot_6.6.0
[ 2.499664] SGI XFS with ACLs, security attributes, scrub, quota, no debug enabled
Quota modules are not loaded. No output.
[user@server ~]$ lsmod | grep quota
dracut log entries indicating noquota is set.
[user@server ~]$ sudo grep dracut /var/log/messages | grep quota | tail -n1
Feb 23 18:11:42 server dracut[1724]: Executing: /usr/bin/dracut --add kdumpbase --quiet --hostonly --hostonly-cmdline --hostonly-i18n --hostonly-mode strict --hostonly-nics -o "plymouth resume ifcfg earlykdump" --mount "/dev/disk/by-uuid/00000000-0000-0000-0000-000000000000 /sysroot xfs rw,relatime,attr2,inode64,logbufs=8,logbsize=32k,noquota" --squash-compressor zstd --no-hostonly-default-device -f /boot/initramfs-5.14.0-503.23.1.el9_5.x86_64kdump.img 5.14.0-503.23.1.el9_5.x86_64
Results of investigation:
I have explored the possibility that the persistent noquota option is due to the configuration in the initramfs (initial RAM filesystem) created by dracut. The reason for suspecting initramfs is that it loads the initial root filesystem with specific options during boot. Since the noquota option persists even after configuring /etc/fstab and remounting the filesystem, it indicates that initramfs might still be including the noquota option.
1. Backup Existing Initramfs:
sudo cp /boot/initramfs-$(uname -r).img /boot/initramfs-$(uname -r).img.bak
2. Regenerate Initramfs:
sudo dracut -f --add "xfs" /boot/initramfs-$(uname -r).img $(uname -r)
3. Reboot the Server:
sudo reboot
Is this the correct action to take?
Thanks, David.
-
Hey there! I suppose that could work, but these quote issues represent a problem at a deeper level than the cPanel software. cPanel just reads the quota tools directly from the OS. It may be best to speak with your host or datacenter to see if they've run into similar quota issues with your particular environment in the past.
0 -
I succeeded in getting quotas to work. For anyone else reading this post who has the same issue, here's the follow-up.
Note: As indicated above, I had already edited /etc/fstab to include the defaults,usrquota,grpquota flags.
My host datacenter told me to run the following command:
sudo grubby --args="rootflags=uquota,gquota" --update-kernel=ALL
Note: Before running the above grubby command to set rootflags=uquota,gquota, first check if any existing rootflags flags are set:
sudo grubby --info=ALL | grep rootflags
If rootflags already includes some existing flags, you would update it like in the following command to ensure that any existing flags are preserved while adding the quota flags:
sudo grubby --args="rootflags=EXISTING_FLAGS,uquota,gquota" --update-kernel=ALL
My server did not have any existing flags, so I used the grubby command that my host datacenter provided.
Then after running grubby, I did the following additional steps:
1. Reboot the Server: Graceful reboot of the server via cPanel/WHM.
2. Create Quota Files: Create the quota files aquota.user and aquota.group:
sudo touch /aquota.user /aquota.group
sudo chmod 600 /aquota.user /aquota.group3. Run cPanel/WHM Initial Quota Setup: In cPanel/WHM, go to WHM > Server Configuration > Initial Quota Setup and follow the prompts to initialize the quota system. Reboot the server.
4. Turn Quotas On: Enable quotas for users and groups:
sudo quotaon -avug
5. Verify Quota Status: Check the status of quotas using xfs_quota:
sudo xfs_quota -x -c 'state -v' / | head
The output of the command should be something like:
User quota state on / (/dev/sda2)
Accounting: ON
Enforcement: ON
Inode: #1153065 (7 blocks, 7 extents)
Blocks grace time: [7 days]
Blocks max warnings: 0
Inodes grace time: [7 days]
Inodes max warnings: 0
Realtime Blocks grace time: [7 days]
Group quota state on / (/dev/sda2)If quotas are enabled, then "Accounting: ON" and "Enforcement: ON" should both be on rather than off.
If quotas were not enabled, the necessary corrective action would involve ensuring that quota options are added to /etc/fstab, the filesystem is remounted with quota options (by rebooting the server or manually remounting via mount), and the quotaon command is executed to enable quotas. Running the Initial Quota Setup in cPanel/WHM would also be necessary to initialize the quota system properly.
6. Generate Quota Report: Generate a quota report using xfs_quota:
sudo xfs_quota -x -c 'report -h' /
The output of the command should be something like:
(sample report truncated)User quota on / (/dev/sda2)
Blocks
User ID Used Soft Hard Warn/Grace
---------- ---------------------------------
root 10.0G 0 0 00 [------]
bin 90.4M 0 0 00 [------]
named 176K 0 0 00 [------]7. View Disk Usage and Set Individual Quota Limits in cPanel/WHM: In cPanel/WHM, go to WHM > Account Information > List Accounts to view current disk usage for each account. To set individual quota limits, navigate to WHM > Account Functions > Quota Modification, select the desired account, and set the appropriate disk space limits.
Thanks, David.
0 -
Thanks for sharing those details here!
0
Please sign in to leave a comment.
Comments
3 comments