Assigning Disk Quotas to Users and Groups

Use the edquota or setquota command to assign disk quotas to users and groups.

For more information, see the edquota(8) and setquota(8) manual pages.

  1. Use the edquota command to configure quota limits for a user or group within a text editor.

    For a user, use the following command:

    sudo edquota username

    For a group, use the following command:

    sudo edquota -g group

    The command opens a text file in the default editor that's defined by the EDITOR environment variable. You can specify the limits for the user or group, for example:

    Disk quotas for user guest (uid 501)
    Filesystem  blocks  soft  hard  inodes  soft  hard
     /dev/sdb1   10325     0     0    1054     0     0

    The blocks and inodes entries reflect the user's current usage on a file system.

    Tip:

    Setting a limit to 0 disables quota checking and enforcement for the corresponding blocks or inodes category.

    Edit the soft and hard block limits for the number of blocks and inodes, then save the changes.
  2. Use the setquota command to configure quota limits from the command line.

    To configure a user quota, use the -u option and then configure the soft and hard block and inode limits. For example, you can set a soft block limit to 500 Mb and a hard block limit to 1 Gb, while disabling inode limits as follows:

    sudo setquota -u username 500M 1G 0 0 /mnt

    To configure a group quota, use the -g option and then configure the soft and hard block or inode limits. For example, you can disable block limits for the group but set a soft inode limit to 9000 and a hard inode limit to 10000 .

    sudo setquota -g groupname 0 0 9000 10000 /mnt