RTFM

[Read This Fine Material] from Joshua Hoblitt

How to enable quotas on an existing GPFS filesystem

| 0 comments

This step is unnecessary if when you created the filesystem you passed the -Q yes flag to the mmcrfs command. The default value in GPFS version 3.4.0-8 for -Q is no so you will not have active quota support unless you explicitly request it upon filesystem creation or follow this procedure. Please note that I have cut’n’paste together the commands below from different times so the reported timestamps may be out of sequence.

The manual says that the filesystem needs to be unmounted everywhere before enabling quotas.

[root@foonsd1 ~]# mmumount all -a
Sat Jun  2 13:36:17 MST 2012: mmumount: Unmounting file systems ...

First check to see if quotas are enabled or disabled on the filesystem in question.

[root@foo01 ~]# mmlsfs foodata1

File system attributes for /dev/foodata1:
=========================================
flag                value                    description
------------------- ------------------------ -----------------------------------
 -f                 131072                   Minimum fragment size in bytes
 -i                 512                      Inode size in bytes
 -I                 32768                    Indirect block size in bytes
 -m                 1                        Default number of metadata replicas
 -M                 2                        Maximum number of metadata replicas
 -r                 1                        Default number of data replicas
 -R                 2                        Maximum number of data replicas
 -j                 cluster                  Block allocation type
 -D                 nfs4                     File locking semantics in effect
 -k                 all                      ACL semantics in effect
 -n                 32                       Estimated number of nodes that will mount file system
 -B                 4194304                  Block size
 -Q                 none                     Quotas enforced
                    none                     Default quotas enabled
 --filesetdf        No                       Fileset df enabled?
 -V                 12.10 (3.4.0.7)          File system version
 --create-time      Wed Feb  8 18:34:14 2012 File system creation time
 -u                 Yes                      Support for large LUNs?
 -z                 No                       Is DMAPI enabled?
 -L                 4194304                  Logfile size
 -E                 Yes                      Exact mtime mount option
 -S                 Yes                      Suppress atime mount option
 -K                 whenpossible             Strict replica allocation option
 --fastea           Yes                      Fast external attributes enabled?
 --inode-limit      18300928                 Maximum number of inodes
 -P                 system                   Disk storage pools in file system
 -d                 nsd1;nsd2                Disks in file system
 -A                 yes                      Automatic mount option
 -o                 none                     Additional mount options
 -T                 /net/foodata1            Default mount point
 --mount-priority   0                        Mount priority

Here we see that they are not enabled:

-Q none Quotas enforced
none Default quotas enabled

Enable quotas on the filesystem with mmchfs and verify that the value of the -Q flag has changed.

[root@foo01 ~]# mmchfs foodata1 -Q yes
mmchfs: Propagating the cluster configuration data to all
  affected nodes.  This is an asynchronous process.
[root@decnsd1 ~]# mmlsfs foodata1 -Q
flag                value                    description
------------------- ------------------------ -----------------------------------
 -Q                 user;group;fileset       Quotas enforced
                    none                     Default quotas enabled

Now we need to run the mmcheckquota command to, as per the manual, “Compile inode and disk block statistics”.

[root@foo01 ~]# mmcheckquota -v /dev/foodata1
foodata1: Start quota check
  12 % complete on Thu May 31 16:56:29 2012
  25 % complete on Thu May 31 16:56:29 2012
  37 % complete on Thu May 31 16:56:29 2012
  50 % complete on Thu May 31 16:56:29 2012
  62 % complete on Thu May 31 16:56:29 2012
  75 % complete on Thu May 31 16:56:29 2012
  87 % complete on Thu May 31 16:56:29 2012
 100 % complete on Thu May 31 16:56:29 2012
Finished scanning the inodes for foodata1.
Merging results from scan.
foodata1: quota check found the following differences:
USR 0: 29 subblocks counted (was 0);  29 inodes counted (was 0)
USR 711: 2166372 subblocks counted (was 0);  1761 inodes counted (was 0)
USR 876: 7892150 subblocks counted (was 0);  41067 inodes counted (was 0)
USR 48: 2 subblocks counted (was 0);  2 inodes counted (was 0)
USR 212: 13928 subblocks counted (was 19);  437 inodes counted (was 4)
USR 950: 17568 subblocks counted (was 0);  15335 inodes counted (was 0)
USR 955: 1856593 subblocks counted (was 0);  67220 inodes counted (was 0)
USR 861: 758203 subblocks counted (was 0);  683 inodes counted (was 0)
GRP 0: 88 subblocks counted (was 0);  88 inodes counted (was 0)
GRP 224: 13868 subblocks counted (was 19);  377 inodes counted (was 4)
GRP 225: 2235969 subblocks counted (was 0);  53226 inodes counted (was 0)
GRP 100: 17568 subblocks counted (was 0);  15335 inodes counted (was 0)
GRP 48: 2 subblocks counted (was 0);  2 inodes counted (was 0)
GRP 112: 10437350 subblocks counted (was 0);  57506 inodes counted (was 0)
FILESET 0: 12704845 subblocks counted (was 19);  126534 inodes counted (was 4)

The filesystem can now be remounted and is ready to have quotas set on it.

[root@foonsd1 ~]# mmmount all -a
Sat Jun  2 13:37:03 MST 2012: mmmount: Mounting file systems ...

Leave a Reply