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: .. code-block:: mount | grep ' / ' - The filesystem type will show in the output (emphasis added): .. code-block:: [root@server ~]# mount | grep ' / ' /dev/nvme0n1p1 on / type **xfs** (rw,relatime,attr2,inode64,noquota) [root@server ~]# or .. code-block:: [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: .. code-block:: mount | grep ' / ' - If quotas are disabled, the output will state 'noquota' .. code-block:: [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' .. code-block:: [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/grub`` #. Append ``rootflags=usrquota,grpquota`` to the line beginning with GRUB_CMDLINE_LINUX .. code-block:: GRUB_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: .. code-block:: 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: .. code-block:: cp /boot/efi/EFI/almalinux/grub.cfg /boot/efi/EFI/almalinux/grub.cfg.orig #. Generate the new grub configuration .. code-block:: grub2-mkconfig -o /boot/grub2/grub.cfg - For servers using EFI, replacing ``{OS}`` with the OS version: .. code-block:: grub2-mkconfig -o /boot/efi/EFI/{OS}/grub.cfg Example: .. code-block:: grub2-mkconfig -o /boot/efi/EFI/almalinux/grub.cfg #. Reboot the server #. Verify that quotas have been enabled .. code-block:: 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: .. code-block:: mount | grep ' / ' - If quotas are disabled, the output will state 'noquota' .. code-block:: [root@server ~]# mount | grep ' / ' /dev/xvda1 on / type ext4 (rw) [root@server ~]# - If quotas are already enabled, the output will show 'usrquota' and 'groupquota' .. code-block:: [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: .. code-block:: vim /etc/fstab #. Edit the entry for /, adding "usrquota" and "grpquota" options after "defaults". The completed line will look similar to the following: .. code-block:: UUID=92c597ca-70f5-48ee-a173-64188df8ca55 / ext4 defaults,usrquota,grpquota 1 1 #. Save and exit the text editor #. Remount the / filesystem with the following: .. code-block:: mount -o remount / #. Repeat Step 1 to check if quotas are enabled: .. code-block:: [root@server ~]# mount | grep ' / ' /dev/xvda1 on / type ext4 (rw,usrquota,grpquota) [root@server ~]# #. Create the quota database using the following ``quotacheck`` command. This creates ``aquota.user`` and ``aquota.group`` under /: .. code-block:: 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: .. code-block:: [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 ``quotaon`` command to turn on quotas: .. code-block:: quotaon /