XFS Quota Prerequisites
To enable XFS Quota on LocalPV Hostpath, certain prerequisites must be met to ensure proper configuration and functionality. This involves installing the necessary xfsprogs
package, verifying the filesystem type, and configuring the appropriate mount options, such as pquota
.
The following steps outline the installation and configuration procedures for both root and data disk filesystems on Ubuntu, Debian, RHEL, and CentOS systems. By completing these steps, you will be ready to enable and manage XFS Quotas on your OpenEBS LocalPV Hostpath setup.
xfsprogs
Package#
Install the For Ubuntu/Debian Systems
To install the xfsprogs
package on Ubuntu and Debian systems, execute the following command:
For RHEL/CentOS Systems
To install the xfsprogs package on RHEL/CentOS systems, execute the following command:
For Fedora
To install the xfsprogs package on Fedora, execute the following command:
pquota
Mount Option#
Mount Filesystem using the - Check the Filesystem Type
Verify whether the filesystem of the hostPath directory is XFS. The default hostPath directory is /var/openebs/local
. Execute the following command to check if the filesystem is XFS and to identify the device where the filesystem is stored:
Example Output
If the above command fails due to the path not yet existing, execute the following script to check the filesystem type and host device name of the directory:
- Check Existing Mount Options
Ensure that the mount options for the device found in Step 1 include pquota
or prjquota
. Execute the following command to verify the mount options for the device (Example: /dev/nvme0n1p1
).
Example Output
If the mount options already include pquota
or prjquota
, you can proceed to the next section to Enable XFS Quota. If not, continue with Step 3.
- Mount the Device with
pquota
Option
In this step, we will mount the device using the pquota
mount option. If the filesystem is the root filesystem (/), follow the instructions below. If the filesystem is located on a data disk, you can proceed to the Filesystem on Data Disk section.
Root Filesystem:
To enable pquota
for the root filesystem, modify the GRUB_CMDLINE_LINUX
option in the /etc/default/grub
file.
- Edit the file
/etc/default/grub
.
- Locate the line containing the variable
GRUB_CMDLINE_LINUX
.
- Add
rootflags=pquota
at the end of the string. Ifrootflags
option is already present, appendpquota
to the list of options.
Locate the
grub.cfg
file. The file path may vary based on your OS.- /boot/grub2/grub.cfg
- /boot/efi/EFI/ubuntu/grub.cfg
- /boot/efi/EFI/debian/grub.cfg
- /boot/efi/EFI/redhat/grub.cfg
- /boot/efi/EFI/centos/grub.cfg
- /boot/efi/EFI/fedora/grub.cfg
Create a backup copy of the existing
grub.cfg
. The sample commands below use the path/boot/grub2/grub.cfg
. Replace the paths with yourgrub.cfg
path.
- Generate a new
grub.cfg
that includes the changes.
- Reboot the system.
- After rebooting, check the mount options again to confirm the changes.
Expected Output
#
Filesystem on Data DiskIf the filesystem is located on a data disk, follow these steps:
- Unmount the filesystem on the data disk (Replace
/dev/nvme1n1
and/mnt/data
with your device and mount path).
- Mount the disk using the
pquota
mount option.
caution
pquota
is not usable with remount
mount option.
- Verify the mount options.
Expected Output
- Add the
pquota
option to the/etc/fstab
file for the data disk to make the changes persistent across reboots.