All Products
Search
Document Center

File Storage NAS:Directory quotas

Last Updated:Jun 02, 2026

Directory quotas for General-purpose NAS file systems limit the storage space and file count within a directory. You can set quotas at the directory level, or per user and group within the same path.

Prerequisites

Quota types

Category

Quota type

Quota scope

  • Directory quota: Tracks total usage of all users in a directory.

  • User (group) quota: Tracks usage of a specific user or group in a directory.

Note

Only General-purpose NAS file systems that use the NFS protocol support user (group) quotas.

Quota restriction level

  • Statistical quota: Monitors and reports usage without enforcing limits.

  • Restrictive quota: Enforces limits. Write operations (creating files, appending data, moving files in) are blocked when the quota is exceeded.

Usage notes

  • File system instances

    • NFS-based General-purpose NAS file systems support directory quotas and user (group) quotas.

    • SMB-based General-purpose NAS file systems support directory quotas only.

    • Extreme NAS file systems do not support directory quotas.

  • Quotas

    • A file system supports quotas on up to 500 directories with a maximum depth of 8 levels. For example, / is depth 0, /workspace is depth 1, and /workspace/dir1 is depth 2.

    • A directory supports quotas for up to 500 unique UIDs and GIDs. Exceeding this limit may cause configuration failures or read errors.

    Important
    • After you set a restrictive quota, write operations fail when usage exceeds the limit—including increasing file length, creating files/directories, and moving files in. The application layer receives an IOError. Why is the "Disk quota exceeded" error message returned when writing data to a file system?

    • Restrictive quotas can block critical writes. Test thoroughly in a non-production environment before applying to business-critical paths.

    • After you create a directory quota, it enters an initialization process and its status is Initializing. This process can take several hours or longer, depending on the number of files and directories in the file system. After initialization is complete, the status changes to Running. You can query the directory quota status in the NAS console or by calling the DescribeDirQuotas API operation.

    • Quota settings are applied asynchronously. A restrictive quota typically takes 5 to 15 minutes to take effect or be disabled.

  • Regions

    • NFS-based General-purpose NAS: All regions.

    • SMB-based General-purpose NAS: All regions except China (Shenzhen) Finance.

Create a directory quota

  1. Log on to the NAS console.

  2. In the left-side navigation pane, choose File System > File System List.

  3. In the top navigation bar, select the resource group and region where your file system resides.image

  4. Find the file system and click its ID or click Manage. On the Quota Management page, click Create Directory Quota.

  5. In the Create Directory Quota dialog box, set the Directory Path.

    Important
    • Quotas apply only to existing directories. The path must be absolute from the NAS file system root (such as /mydir), not the local mount path on your client (such as /mnt/mydir).

    • Directory paths cannot contain Chinese characters.

    For example, if a General-purpose NAS file system is mounted to /mnt, with root directory /, a level-1 subdirectory /dir0, and a level-2 subdirectory /dir/subdir1, the quota directory paths are:

    • Root directory: /

    • Level-1 subdirectory: /dir0

    • Level-2 subdirectory: /dir/subdir1

    image

  6. Check the directory quota status.

    After creation, the quota status is Initializing. Initialization can take several hours or longer depending on the number of files and directories in the file system. Once complete, the status changes to Running. A default user quota entry (user type: All Users, quota type: Statistical) is created automatically. The quota type is editable, but the user type is not.

Add a user quota

A statistical quota tracks usage. A restrictive quota enforces storage and file count limits for a specific user or group in the directory.

Note
  • Only General-purpose NAS file systems that use the NFS protocol support user (group) quotas.

  • Only one quota type can be configured for each user type.

Procedure

In the Quota Management area, find the target directory path and click Manage Quotas. In the panel, click Assign Quota to User and configure the parameters. add_user_quota

Parameter

Required

Description

User Type

Yes

The user ID type. Valid values: Uid (user), Gid (user group), All Users. You can set different quotas for multiple users in the same path.

ID

No

Required when User Type is set to Uid or Gid. Specifies the target user or group.

For example:

  • To limit a user with UID=500, set User Type to Uid and ID to 500.

  • To limit a user group with GID=100, set User Type to Gid and ID to 100.

Quota Type

Yes

  • Statistical: Monitors usage without enforcing limits.

  • Restrictive: Enforces the specified limits. Write operations will be blocked if the quota is exceeded.

Capacity Limit (GiB)

No

Required when Quota Type is set to Restrictive. Specifies the maximum storage capacity for files and directories in the quota path.

Note
  • The minimum value is 0 GiB and the maximum value is 10,000,000 GiB.

  • You must specify at least one of Capacity Limit (GiB) and File Count Limit.

File Limit

No

Required when Quota Type is set to Restrictive. Specifies the maximum number of files and subdirectories a user can create in the directory.

Note
  • You must specify at least one of Capacity Limit (GiB) and File Count Limit.

  • The minimum value is 1 and the maximum value is 1,000,000,000.

Delete a user quota

In the user quota list, find the target quota entry and click Delete.

Important

Deleting a directory with a quota also removes its directory quota and user quota entries.

Edit a user quota

In the user quota list, find the target quota entry and click Edit. The quota type, capacity limit, and file count limit are editable.

Note

Capacity limit and file count limit are editable only for restrictive quotas. At least one must be changed.

API

Available API operations:

FAQ

Why is the Disk quota exceeded error message returned when writing data to a file system?

  • Cause

    The user or group exceeded the storage or file count limit set by a restrictive quota on the target directory. Blocked operations include increasing file length, creating files/directories, and moving files in. An error message such as Disk quota exceeded is returned.

  • Solution

    1. Free up space by deleting data or increase the capacity limit of the directory. For more information, see Edit a user quota.

    2. After freeing space, perform a small write (such as touch testfile) to trigger a quota statistics refresh. Once the write succeeds, restart your application.