Note
You are viewing the documentation for an older release of Interworx (7.14). To see documentation for the current generally available release of Interworx, click here: 8.2.
How To: Enable Quotas¶
Warning
It is recommended to enable quotas before installing InterWorx.
Note
Enabling quotas is an OS-level setting. There are not any steps that are specific to InterWorx.
This article exists as a courtesy, however, InterWorx customers may use any documentation they would like to complete this task, for their server’s specific OS version.
The output examples in this article are specific to Alma Linux. We strongly recommend that customers do not just copy/paste the output examples and, instead, use the output examples as a template that can be modified to match their server’s specific OS version.
For example, if the server is using Rocky Linux, instances of almalinux in the output examples would be
replaced with rocky.
Note
Quotas should be enabled on the partition where the /home directory is located.
If /home is located under root (‘/’) , then quotas should be enabled on root (‘/’) .
If there is a separate /home partition, then quotas should be enabled on /home, instead.
While quotas are an optional feature, they are recommended for the full InterWorx experience.
This article includes instructions on how to enable quotas for XFS and EXT4.
Contents
To Identify the File System type¶
Log in to the server at the CLI as root, either via SSH or from the terminal
At the CLI, check if quotas are already enabled by running the following:
mount | grep ' / '
The filesystem type will show in the output (emphasis added):
[root@server ~]# mount | grep ' / ' /dev/nvme0n1p1 on / type **xfs** (rw,relatime,attr2,inode64,noquota) [root@server ~]#
or
[root@server ~]# mount | grep ' / ' /dev/xvda1 on / type **ext4** (rw) [root@server ~]#
To Enable Quotas for XFS¶
The following details enabling quotas for root (‘/’).
Note
If there is a separate /home partition, replace all instances of / in the following examples with /home, instead.
Log in to the server at the CLI as root, either via SSH or from the terminal
At the CLI, check if quotas are already enabled by running the following:
mount | grep ' / '
If quotas are disabled, the output will state ‘noquota’
[root@server ~]# mount | grep ' / ' /dev/nvme0n1p4 on / type xfs (rw,relatime,attr2,inode64,logbufs=8,logbsize=32k,sunit=8,swidth=8,noquota) [root@server ~]#
If quotas are already enabled, the output will show ‘usrquota’ and ‘groupquota’
[root@server ~]# mount | grep ' / ' /dev/nvme0n1p4 on / type xfs (rw,relatime,attr2,inode64,logbufs=8,logbsize=32k,sunit=8,swidth=8,usrquota,grpquota) [root@server ~]#
In a text editor, open
/etc/default/grubAppend
rootflags=usrquota,grpquotato the line beginning with GRUB_CMDLINE_LINUXGRUB_CMDLINE_LINUX="console=ttyS0,115200n8 console=tty0 net.ifnames=0 rd.blacklist=nouveau nvme_core.io_timeout=4294967295 rootflags=usrquota,grpquota"
Backup the grub configuration:
cp /boot/grub2/grub.cfg /boot/grub2/grub.cfg.orig
For servers using EFI, the grub.cfg file is located at
/boot/efi/EFI/{OS}/grub.cfg, replacing{OS}with the OS version. Example:cp /boot/efi/EFI/almalinux/grub.cfg /boot/efi/EFI/almalinux/grub.cfg.orig
Generate the new grub configuration
grub2-mkconfig -o /boot/grub2/grub.cfg
For servers using EFI, replacing
{OS}with the OS version:grub2-mkconfig -o /boot/efi/EFI/{OS}/grub.cfg
Example:
grub2-mkconfig -o /boot/efi/EFI/almalinux/grub.cfg
Reboot the server
Verify that quotas have been enabled
mount | grep ' / '
To Enable Quotas for EXT4¶
The following details enabling quotas for root (‘/’).
Note
If there is a separate /home partition, replace all instances of / in the following examples with /home, instead.
At the CLI, check if quotas are already enabled by running the following:
mount | grep ' / '
If quotas are disabled, the output will state ‘noquota’
[root@server ~]# mount | grep ' / ' /dev/xvda1 on / type ext4 (rw) [root@server ~]#
If quotas are already enabled, the output will show ‘usrquota’ and ‘groupquota’
[root@server ~]# mount | grep ' / ' /dev/xvda1 on / type ext4 (rw,usrquota,grpquota) [root@server ~]#
Using a text editor, open the file
/etc/fstab. The following example uses the Vim text editor:vim /etc/fstab
Edit the entry for /, adding “usrquota” and “grpquota” options after “defaults”. The completed line will look similar to the following:
UUID=92c597ca-70f5-48ee-a173-64188df8ca55 / ext4 defaults,usrquota,grpquota 1 1
Save and exit the text editor
Remount the / filesystem with the following:
mount -o remount /
Repeat Step 1 to check if quotas are enabled:
[root@server ~]# mount | grep ' / ' /dev/xvda1 on / type ext4 (rw,usrquota,grpquota) [root@server ~]#
Create the quota database using the following
quotacheckcommand. This createsaquota.userandaquota.groupunder /:quotacheck -cugvm /
The flags:
-c create quota file
-v verbose output
-u user disk quota
-g group disk quota
-m force checking
The output will look similar to the following:
[root@server ~]# quotacheck -cugvm / quotacheck: Your kernel probably supports journaled quota but you are not using it. Consider switching to journaled quota to avoid running quotacheck after an unclean shutdown. quotacheck: Scanning /dev/xvda1 [/] done quotacheck: Cannot stat old user quota file //aquota.user: No such file or directory. Usage will not be substracted. quotacheck: Cannot stat old group quota file //aquota.group: No such file or directory. Usage will not be substracted. quotacheck: Cannot stat old user quota file //aquota.user: No such file or directory. Usage will not be substracted. quotacheck: Cannot stat old group quota file //aquota.group: No such file or directory. Usage will not be substracted. quotacheck: Checked 15509 directories and 97004 files quotacheck: Old file not found. quotacheck: Old file not found. [root@server ~]#
Run the
quotaoncommand to turn on quotas:quotaon /