mmedquota command

Sets quota limits.

Synopsis

mmedquota {-u [-p [ProtoFileset:]ProtoUser] [Device:Fileset:]User ... | 
           -g [-p [ProtoFileset:]ProtoGroup] [Device:Fileset:]Group ... | 
           -j [-p ProtoFileset] Device:Fileset ... | 
           -d {-u User ... | -g Group ... | -j Device:Fileset ...} | 
           -t {{-u | -g | -j} [--reset]}}

Availability

Available on all IBM Spectrum Scale™ editions. Available on AIX® and Linux.

Description

The mmedquota command serves two purposes:
  1. Sets or changes quota limits or grace periods for users, groups, and filesets in the cluster from which the command is issued.
  2. Reestablishes user, group, or fileset default quotas for all file systems with default quotas enabled in the cluster.
The mmedquota command displays the current values for these limits, if any, and prompts you to enter new values using your default editor:
  • current block usage (the amount of disk space used by this user, group, or fileset, in 1KB units; display only)
  • current inode usage (display only)
  • node soft limit
  • inode hard limit
  • block soft limit (the amount of disk space that this user, group, or fileset is allowed to use during normal operation)

    Displayed in KB, but may be specified using g, G, k, K, m, M, p, P, t, or T. If no suffix is provided, the number is assumed to be in bytes.

  • block hard limit (the total amount of disk space that this user, group, or fileset is allowed to use during the grace period)

    Displayed in KB, but may be specified using g, G, k, K, m, M, p, P, t, or T. If no suffix is provided, the number is assumed to be in bytes.

Note: A block or inode limit of 0 indicates no limit.

The mmedquota command waits for the edit window to be closed before checking and applying new values. If an incorrect entry is made, reissue the command and enter the correct values.

You can also use the mmedquota command to change the file system-specific grace periods for block and file usage if the default of one week is unsatisfactory. The grace period is the time during which users can exceed the soft limit. If the user, group, or fileset does not show reduced usage below the soft limit before the grace period expires, the soft limit becomes the new hard limit.

When you set quota limits for a file system, consider replication in the file system. See Listing quotas.

The EDITOR environment variable must contain a complete path name, for example:
export EDITOR=/bin/vi

Parameters

Device
Specifies the device name of the file system for which quota information is to be displayed. File system names need not be fully-qualified. fs0 is as acceptable as /dev/fs0.
Fileset
Specifies the name of a fileset located on Device for which quota information is to be displayed.
User
Name or user ID of target user for quota editing.
Group
Name or group ID of target group for quota editing.
-d
Reestablish default quota limits for a specific user, group, or fileset that has had an explicit quota limit set by a previous invocation of the mmedquota command.
-g
Sets quota limits or grace times for groups.
-j
Sets quota limits or grace times for filesets.
-p
Applies already-established limits to a particular user, group or fileset.

When invoked with the -u option, [ProtoFileset:]ProtoUser limits are automatically applied to the specified User or space-delimited list of users.

When invoked with the -g option, [ProtoFileset:]ProtoGroup limits are automatically applied to the specified Group or space-delimited list of groups.

When invoked with the -j option, ProtoFileset limits are automatically applied to the specified fileset or space-delimited list of fileset names.

You can specify any user as a ProtoUser for another User, or any group as a ProtoGroup for another Group, or any fileset as a ProtoFileset for another Fileset.

-p cannot propagate a prototype quota from a user, group, or fileset on one file system to a user, group, or fileset on another file system.

-t
Sets grace period during which quotas can exceed the soft limit before it is imposed as a hard limit. The default grace period is one week.

This flag is followed by one of the following flags: -u, -g or -j, to specify whether the changes apply to users, groups, or filesets respectively.

-u
Sets quota limits or grace times for users.
--reset
With this option, when grace time is modified, all relative quota entries will be scanned and updated if necessary; without this option, when grace time is updated, quota entries will not be scanned and updated.

Exit status

0
Successful completion.
nonzero
A failure has occurred.

Security

You must have root authority to run the mmedquota command.

GPFS™ must be running on the node from which the mmedquota command is issued.

The node on which the command is issued must be able to execute remote shell commands on any other node in the cluster without the use of a password and without producing any extraneous messages. For more information, see Requirements for administering a GPFS file system.

Examples

  1. To set user quotas for userid pfs001, issue this command:
    mmedquota -u pfs001
    The system displays information similar to:
    *** Edit quota limits for USR pfs001
    NOTE: block limits will be rounded up to the next multiple of the block size.
          block units may be: K, M, G, T or P, inode units may be: K, M or G.
    gpfs3: (root): blocks in use: 8K, limits (soft = 0K, hard = 0K)
            inodes in use: 1, limits (soft = 0, hard = 0)
    gpfs2: (fset4): blocks in use: 4104K, limits (soft = 102400K, hard = 153600K)
            inodes in use: 2, limits (soft = 100, hard = 150)
    gpfs2: (fset3): blocks in use: 0K, limits (soft = 0K, hard = 0K)
            inodes in use: 0, limits (soft = 0, hard = 0)
    gpfs2: (root): blocks in use: 0K, limits (soft = 0K, hard = 0K)
            inodes in use: 0, limits (soft = 0, hard = 0)
    gpfs1: (fset1): blocks in use: 0K, limits (soft = 256K, hard = 256K)
            inodes in use: 0, limits (soft = 30, hard = 40)
    gpfs1: (root): blocks in use: 0K, limits (soft = 256K, hard = 256K)
            inodes in use: 0, limits (soft = 40, hard = 45)
  2. To reset default group quota values for the group blueteam, issue this command:
    mmedquota -d -g blueteam
    To verify the change, issue this command:
    mmrepquota -q fs1
    The system displays information similar to:
    fs1: USR quota is on; default quota is on
    fs1: GRP quota is on; default quota is on
    fs1: FILESET quota is on; default quota is off
  3. To change the grace periods for all users, issue this command:
    mmedquota -t -u
    The system displays information in your default editor similar to:
    *** Edit grace times:
    Time units may be : days, hours, minutes, or seconds
    Grace period before enforcing soft limits for USRs:
    gpfs0: block grace period: 7 days, file grace period: 7 days
  4. To set user quotas for device gpfs2, fileset fset3, and userid pfs001, issue this command:
    mmedquota -u gpfs2:fset3:pfs001
    The system displays information similar to:
    *** Edit quota limits for USR gpfs2:fset3:pfs001
    NOTE: block limits will be rounded up to the next multiple of the block size.
          block units may be: K, M, G, T or P, inode units may be: K, M or G.
    gpfs2: (fset3): blocks in use: 0K, limits (soft = 0K, hard = 0K)
            inodes in use: 0, limits (soft = 0, hard = 0)
  5. To apply already-established limits of user pfs002 to user pfs001, issue this command:
    mmedquota -u -p pfs002 pfs001
    The system displays information similar to:
    Already established limits of protouser pfs002 in root fileset are applied 
    to all filesets (including root fileset) in all corresponding per-fileset 
    quota enabled filesystems.
  6. To apply already-established limits of user pfs002 in fileset fset2 to user pfs001 in fileset fset1 and file system fs1, issue this command:
    mmedquota -u -p fset2:pfs002 fs1:fset1:pfs001
    The system displays information similar to:
    Limits of protouser pfs002 in fileset fset2 in filesystem fs1 are applied 
    to user pfs001 in fileset fset1
  7. To apply an already-established fileset quota (from fileset1 to fileset2) in two different file systems (gpfstest1 and gpfstest2), issue this command:
    mmedquota,-j -p fileset1 gpfstest1:fileset2 gpfstest2:fileset2

Location

/usr/lpp/mmfs/bin