Is project quota available on RHEL 7

Solution Verified - Updated -

Environment

  • Red Hat Enterprise Linux release 7
  • EXT4 and XFS

Issue

  • Can we set the project quota on RHEL7 ?
  • Is it possible to set the quota on directories?

Resolution

  • We can set the quota on directories that is achieved by setting the project quota which is not avilable in EXT filesystem in RHEL7, it is available from RHEL8 in EXT and XFS Filesystem in RHEL7.
  • In RHEL7 for EXT filesystem, we can only set the quota for users and group.
  • The two ways to confirm the availability of the same is as mentioned below :*
  • If you check the product documentation link, in RHEL7 only user quota and group quota is mentioned whereas in the RHEL8 along with these two Project Quota is also mentioned, Mentioing the quotes here and also sharing the product documentation link:-

RHEL7
Disk quotas can be configured for individual users as well as user groups

RHEL8
You can assign disk quotas per user, per group or per project

Root Cause

  • Refer man edquota on RHEL7 there is no option for -P where on RHEL8 we do have the same*

man edquota

  • RHEL7 snippet:-
EDQUOTA(8)                                                                                 System Manager's Manual                                                                                 EDQUOTA(8)

NAME
       edquota - edit user quotas

SYNOPSIS
       edquota [ -p protoname ] [ -u | -g ] [ -rm ] [ -F format-name ] [ -f filesystem ] username...
  • RHEL8 Snippet:-
EDQUOTA(8)                                                                                 System Manager's Manual                                                                                 EDQUOTA(8)

NAME
       edquota - edit user quotas

SYNOPSIS
       edquota [ -p protoname ] [ -u | -g | -P ] [ -rm ] [ -F format-name ] [ -f filesystem ] username | groupname | projectname...

Diagnostic Steps

  • We tested same on RHEL7 for EXT4 and XFS type of filesystem as below :*
/dev/mapper/vg1-lv2 xfs       497M   26M  472M   6% /test2
/dev/mapper/vg1-lv1 ext4      477M  2.3M  445M   1% /test1
  • When mount-point mounted as a EXT4 type of filesystem*

# umount /test1 # mount /dev/mapper/vg1-lv1 /test1 -o prjquota** mount: wrong fs type, bad option, bad superblock on /dev/mapper/vg1-lv1, missing codepage or helper program, or other error In some cases useful info is found in syslog - try dmesg | tail or so.
# dmesg | tail
[  963.874639] XFS (dm-1): Ending clean mount
[ 1093.590322] XFS (dm-0): Unmounting Filesystem
[ 1139.537576] EXT4-fs (dm-0): mounted filesystem with ordered data mode. Opts: (null)
[ 1553.356827] EXT4-fs (dm-0): Unrecognized mount option "prjquota" or missing value
  • Now when the mount-point mounted as a XFS type of filesystem*
# umount /test2
# mount /dev/mapper/vg1-lv2 /test2 -o prjquota
# cat /proc/self/mounts | grep -i /test2**

/dev/mapper/vg1-lv2 /test2 xfs rw,relatime,attr2,inode64,prjquota 0 0
# dmesg | tail
[ 1574.654391] XFS (dm-1): Unmounting Filesystem
[ 1580.622801] XFS (dm-1): Mounting V5 Filesystem
[ 1580.631303] XFS (dm-1): Ending clean mount
[ 1580.632936] XFS (dm-1): Quotacheck needed: Please wait.
[ 1581.189052] XFS (dm-1): Quotacheck: Done.

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments