Quotas: tree, user and group limits

Give one team a big shared volume and, sooner or later, one project or one user fills it. Everyone else gets “disk full” at the worst moment.

Quotas stop that. In this lesson you’ll split a volume into qtrees, put a limit on each, turn quotas on, and see on a real Linux client what users get when they hit the limit.

Where this lesson fits

Lesson 32 of 56 in NetApp ONTAP Storage Administration · Phase 2: Protocols and day-to-day administration · Before this: Lesson 31, SMB shares with Active Directory · Next: Lesson 33, Thin provisioning and space reclaim

TimeYou needBy the end you can
60 minutesThe practice shell 1.2 with setup-29.txt, and host mode for sv-targetCreate qtrees and quota rules, turn quotas on, read a quota report, and spot quotas that were never activated

What it is, in one line

A quota is a limit inside a volume: on a qtree (tree quota), on a user, or on a group, so one folder or one person can’t use up space meant for everyone.

In Simple Words

Shelves in a shared fridge

An office fridge is shared by four teams. Without rules, one team’s party leftovers fill it and nobody else’s lunch fits.

So each team gets a shelf. A note on the shelf says “please don’t go past this line” (soft limit), and the shelf edge is the real stop (hard limit). The fridge is the volume, the shelves are qtrees, and the lines are quotas.

Engineer's View

How an engineer describes it

A qtree is a special directory at the top of a FlexVol that can have its own quota, security style and export policy. Quota rules live in the SVM’s quota policy (normally default) and have a type: tree (a qtree), user or group, with -disk-limit (hard), -soft-disk-limit and -file-limit.

Rules do nothing until you run volume quota on, which scans the volume to count usage. After you change limits on existing quotas, volume quota resize applies them quickly; some changes, like adding a quota for a brand-new target with no default quota, need quotas turned off and on again, which rescans.

A default quota (target "") gives every qtree or user the same limit and creates derived quotas automatically. When a hard limit is hit, NFS clients get “Disk quota exceeded” and SMB clients see “There is not enough space on the disk”, even if the volume still has room.

How it works, step by step

1Create qtrees

One qtree per project, department or user group that needs its own limit.

ONTAP quota layers: volume, qtrees, users and files

2Write the rules

Tree rules for the qtrees, user or group rules where you need them. A soft limit below the hard limit gives a warning first.

3Turn quotas on

volume quota on starts a scan; volume quota show reports the state. Only then does the quota report show usage.

ONTAP quota change steps: rule, on, change, resize, check

4Report and adjust

volume quota report shows used and limit per target. Change a limit, then resize; check the report again.

Quota typeTargetTypical use
treea qtree nameProject or department folders
usera UNIX or Windows userHome directories, per-person caps
groupa UNIX groupTeam-wide caps on shared data
default (any type)“”Same limit for every qtree or user

In System Manager: Storage › Qtrees to create qtrees and Storage › Quotas for rules and reports.

System Manager Quotas page with tree quota rules for qtrees alpha and beta in vol_proj and the usage report
System Manager: Storage > Quotas shows the rules and the usage report for each qtree.

Good to know: how quota warnings reach you

Quota events go to the event log (EMS) and can also be sent as SNMP traps. ONTAP raises one when a write is refused at a hard limit, when a soft limit or threshold is crossed, and again when usage drops back under a soft limit.

Several quotas can apply to the same write, and all of them count. If a qtree has a 10 GB tree quota and is nearly full, a user with plenty left in their own user quota is still refused, because the tree limit is reached first.

Hands-on lab: limit two project folders

Before you run any command, double-check it

Read every command twice before you press Enter. Check the target: the server name, the user, the disk or device name, the path and the sizes. These commands are for learning and were tested in our lab, not on your system. At work, run the read-only commands first, follow your change process, make sure a backup exists, and ask a second person to check anything that changes or deletes data. You run them at your own risk.

This lab uses the SaatVedha ONTAP practice shell, our own learning tool. It is not NetApp software: real ONTAP output looks like this but is not identical.

1Start from the NAS setup

Reset and run setup-29.txt, log in, and turn on NFS:

vserver nfs create -vserver svm1 -v3 enabled -v4.1 enabled
volume create -vserver svm1 -volume vol_proj -aggregate aggr1_01 -size 50g -junction-path /proj
volume qtree create -vserver svm1 -volume vol_proj -qtree alpha
volume qtree create -vserver svm1 -volume vol_proj -qtree beta
volume qtree show -vserver svm1 -volume vol_proj

You should see this:

Vserver    Volume        Qtree        Style        Oplocks    Status
---------- ------------- ------------ ------------ ---------- --------
svm1       vol_proj      ""           unix         enable     normal
svm1       vol_proj      alpha        unix         enable     normal
svm1       vol_proj      beta         unix         enable     normal
3 entries were displayed.

The "" line is the volume itself (qtree 0). Clients see alpha and beta as folders under /proj.

✅ Checkpoint: Two qtrees, alpha and beta.

2Add limits and turn quotas on

volume quota policy rule create -vserver svm1 -policy-name default -volume vol_proj -type tree -target alpha -disk-limit 10GB -soft-disk-limit 8GB
volume quota policy rule create -vserver svm1 -policy-name default -volume vol_proj -type tree -target beta -disk-limit 20GB
volume quota on -vserver svm1 -volume vol_proj
volume quota show -vserver svm1 -volume vol_proj
volume quota report -vserver svm1 -volume vol_proj

You should see this:

[Job 105] Job is queued: "quota on" performed for quota policy "default" on volume "vol_proj" in Vserver "svm1".
saat-cluster::> volume quota show -vserver svm1 -volume vol_proj
                                   Scan
Vserver    Volume       State      Status
---------- ------------ ---------- --------
svm1       vol_proj     on         -
saat-cluster::> volume quota report -vserver svm1 -volume vol_proj
Vserver: svm1

                                  ----Disk----          ----Files-----
Volume   Tree     Type   ID           Used    Limit    Used  Limit
-------- -------- ------ -------- -------- -------- ------- ------
vol_proj alpha    tree   alpha      3.13MB     10GB      12      -
vol_proj beta     tree   beta       3.13MB     20GB      12      -
2 entries were displayed.

✅ Checkpoint: Quotas are on and both qtrees show a limit.

3Watch a tree-style limit stop a write on Linux

The cluster can count against a quota, but you also want to see a limit stop a real write. Linux XFS project quotas behave like ONTAP tree quotas: a limit on one folder, not on a user.

Open a second terminal and start the lab server: python ontapsim.py --host sv-target. It has a spare 20 GB disk, /dev/sdb.

lsblk /dev/sdb
mkfs.xfs /dev/sdb
mount -o prjquota /dev/sdb /srv
mkdir -p /srv/proj/alpha
echo "10:/srv/proj/alpha" >> /etc/projects
echo "alpha:10" >> /etc/projid
xfs_quota -x -c 'project -s alpha' /srv
xfs_quota -x -c 'limit -p bsoft=80m bhard=100m alpha' /srv
dd if=/dev/zero of=/srv/proj/alpha/big.bin bs=1M count=200
xfs_quota -x -c 'report -pbih' /srv
df -h /srv

You should see this:

root@sv-target:~# lsblk /dev/sdb
NAME MAJ:MIN RM SIZE RO TYPE  MOUNTPOINTS
sdb    8:16   0  20G  0 disk  
root@sv-target:~# mkfs.xfs /dev/sdb
meta-data=/dev/sdb               isize=512    agcount=4, agsize=1310720 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=1        finobt=1, sparse=1, rmapbt=1
         =                       reflink=1    bigtime=1 inobtcount=1 nrext64=1
data     =                       bsize=4096   blocks=5242880, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0, ftype=1
log      =internal log           bsize=4096   blocks=16384, version=2
         =                       sectsz=512   sunit=1 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
root@sv-target:~# mount -o prjquota /dev/sdb /srv
root@sv-target:~# mkdir -p /srv/proj/alpha
root@sv-target:~# echo "10:/srv/proj/alpha" >> /etc/projects
root@sv-target:~# echo "alpha:10" >> /etc/projid
root@sv-target:~# xfs_quota -x -c 'project -s alpha' /srv
Setting up project alpha (path /srv/proj/alpha)...
Processed 1 (/etc/projects and cmdline) paths for project alpha with recursion depth infinite (-1).
root@sv-target:~# xfs_quota -x -c 'limit -p bsoft=80m bhard=100m alpha' /srv
root@sv-target:~# dd if=/dev/zero of=/srv/proj/alpha/big.bin bs=1M count=200
dd: error writing '/srv/proj/alpha/big.bin': No space left on device
101+0 records in
100+0 records out
104857600 bytes (104 MB, 100 MiB) copied, 0.4167 s, 251 MB/s
root@sv-target:~# xfs_quota -x -c 'report -pbih' /srv
Project quota on /srv (/dev/sdb)
                        Blocks                            Inodes              
Project ID   Used   Soft   Hard Warn/Grace     Used   Soft   Hard Warn/Grace  
---------- --------------------------------- --------------------------------- 
#0              0      0      0  00 [------]        3      0      0  00 [------]
alpha        100M    80M   100M  00 [------]        2      0      0  00 [------]
root@sv-target:~# df -h /srv
Filesystem Size  Used Avail Use% Mounted on
/dev/sdb     20G  242M   20G   2% /srv

The disk has about 20 GB free, yet the write stopped at exactly 100 MiB: that’s the hard limit on the alpha folder, not a full disk. The report shows alpha at 100M used against an 80M soft and 100M hard limit, like the Used and Limit columns of volume quota report.

A local XFS write over its project limit says “No space left on device”. An NFS client writing into an ONTAP qtree over its tree quota gets “Disk quota exceeded” instead, so learn both messages.

Terminal on sv-target showing dd stopping at the 100 MiB XFS project quota and the xfs_quota report
sv-target: the write stops at the 100 MiB hard limit, and xfs_quota shows alpha at its limit.

✅ Checkpoint: dd stops at 100 MiB and the report shows alpha at its 100M hard limit.

sv-target host mode: an XFS project quota stops a write at 100 MiB
The write stops at the folder limit, not at a full disk.

Break It, Then Fix It

The most common quota ticket: “we set quotas, but nothing is limited”.

1Create rules on a new volume and forget to turn them on

volume create -vserver svm1 -volume vol_home -aggregate aggr1_02 -size 50g -junction-path /home
volume qtree create -vserver svm1 -volume vol_home -qtree staff
volume quota policy rule create -vserver svm1 -policy-name default -volume vol_home -type tree -target staff -disk-limit 15GB
volume quota report -vserver svm1 -volume vol_home

You’ll get this:

There are no entries matching your query.

2Find out why

volume quota show -vserver svm1 -volume vol_home
volume quota resize -vserver svm1 -volume vol_home

You’ll see this:

                                   Scan
Vserver    Volume       State      Status
---------- ------------ ---------- --------
svm1       vol_home     off        -
saat-cluster::> volume quota resize -vserver svm1 -volume vol_home
Error: command failed: Quotas are not on for volume "vol_home". Use "volume quota on".

The rule exists, but quotas are off for this volume, so nothing is counted or enforced. Resize only works on a volume where quotas are already on.

Practice shell: quota report empty because quotas are off
Rules exist, but quotas are off for vol_home.

3Turn them on and check

volume quota on -vserver svm1 -volume vol_home
volume quota report -vserver svm1 -volume vol_home

You should see this:

[Job 107] Job is queued: "quota on" performed for quota policy "default" on volume "vol_home" in Vserver "svm1".
saat-cluster::> volume quota report -vserver svm1 -volume vol_home
Vserver: svm1

                                  ----Disk----          ----Files-----
Volume   Tree     Type   ID           Used    Limit    Used  Limit
-------- -------- ------ -------- -------- -------- ------- ------
vol_home staff    tree   staff      3.13MB     15GB      12      -

✅ Checkpoint: staff shows a 15GB limit.

Make “quota report shows the new limit” the last line of every quota change.

This happened at work

The night before submission

An engineering college in Vijayawada kept final-year project work on an ONTAP volume, one qtree per department with a tree quota. Two days before project submission, the computer science department asked for more space, and the IT admin raised their rule from 50 GB to 80 GB.

The next evening students started getting “Disk quota exceeded” while saving simulation output, and a group of them came to the IT office at 9 p.m. The admin showed them the rule on screen, clearly 80 GB, and was sure the problem was on the students’ side.

volume quota report told the real story: the limit in force was still 50 GB, because nobody had run volume quota resize after editing the rule. One command fixed it within a minute. The admin now ends every quota change by comparing the rule with the report.

Common mistakes and troubleshooting

MistakeWhat happensDo this instead
Rules created, quotas never turned onNothing is limited or countedvolume quota on, then check volume quota show
Limit changed, no resizeThe old limit stays in forcevolume quota resize, then check the report
Hard limit with no soft limitUsers get no warning before writes failSet a soft limit about 80 to 90 percent of hard
Quotas larger than the volume in totalVolume fills before any quota is hitSize the volume for the sum, or watch overcommit
Using folders instead of qtrees for limitsYou can’t put a tree quota on a normal folderCreate qtrees for anything that needs a limit
Forgetting quotas during volume moves or restoresSurprise limits or missing ones afterwardsCheck quota show and report after big changes

Interview questions

Click a question to open it. Each one is written the way an interviewer would ask it. Under it you will see why they ask it and one way you could answer, in your own words.

Fresher level

1. What’s the difference between a qtree and a normal folder in ONTAP?

Why they ask this: They want to check you know why qtrees exist.

How you might answer: A qtree is a special top-level directory in a volume that can have its own tree quota, security style and export policy. A normal folder can’t have a tree quota, so anything that needs its own limit should be a qtree.

2. What happens for an NFS user who hits a hard quota?

Why they ask this: They’re checking you know what users actually see.

How you might answer: Their writes fail with “Disk quota exceeded”, even if the volume still has free space. SMB users see a “not enough space” message. A soft limit only logs a warning and doesn’t stop writes.

2–5 years experience

3. You changed a quota limit but users still hit the old one. What happened?

Why they ask this: They want to see you know how ONTAP applies quota changes.

How you might answer: The new limit isn’t active until it’s applied, so I’d run volume quota resize for that volume and confirm with volume quota report. If the change was a new target with no default quota, I’d turn quotas off and on to reinitialize, at a quiet time because it rescans.

4. When would you use a default quota?

Why they ask this: They’re testing knowledge of derived quotas and admin effort.

How you might answer: When every qtree or every user should get the same limit, like home directories. I create one rule with an empty target, and ONTAP creates derived quotas for each user or qtree automatically. Then I add explicit rules only for the exceptions.

Senior level

5. A department wants per-user limits inside their project share. How would you set it up?

Why they ask this: They want to see you combine quota types sensibly.

How you might answer: I’d give the department a qtree with a tree quota for the overall cap, then add user quotas scoped to that qtree, with a default user quota for everyone and explicit rules for the few who need more.

I’d turn on soft limits for warnings and send them the quota report monthly so they can manage it themselves.

6. How do you stop quotas from giving a false sense of safety on thin-provisioned storage?

Why they ask this: They’re checking that you understand quotas don’t reserve space.

How you might answer: Quotas only cap usage; they don’t reserve anything. If the sum of quotas is bigger than the volume, or the volume is thin on a busy aggregate, the aggregate can still fill first. I’d monitor aggregate and volume space together and keep a written overcommit ratio we’re comfortable with.

Quick quiz

Q1. Which quota type limits a qtree?

  1. user
  2. group
  3. tree
  4. volume
Show answer

C — a tree quota targets a qtree.

Q2. What must you run before quota rules are enforced on a volume?

  1. volume quota resize
  2. volume quota on
  3. volume qtree create
  4. vserver nfs create
Show answer

B — quota on scans the volume and starts enforcing.

Q3. What does a soft limit do?

  1. Stops writes
  2. Warns but allows writes
  3. Deletes old files
  4. Moves data
Show answer

B — only the hard limit stops writes.

Q4. You raised a limit in a rule. What applies it to a volume where quotas are on?

  1. volume quota resize
  2. volume move
  3. quota report
  4. snapshot create
Show answer

A — resize applies limit changes without a full rescan.

Q5. What does a default quota rule use as its target?

  1. *
  2. all
  3. “”
  4. default
Show answer

C — an empty target “” applies to every qtree or user.

Quick recap

  • Qtrees split a volume; quotas limit qtrees, users or groups.
  • Hard limits stop writes; soft limits warn.
  • Rules do nothing until volume quota on.
  • After changing limits, run volume quota resize and check the report.
  • Quotas cap usage but don’t reserve space.

Next lesson

Lesson 33: Thin provisioning, fractional reserve and space reclaim → You’ll compare thick and thin volumes and LUNs, overcommit an aggregate on purpose, and see what happens when it fills.

Further reading: ONTAP quota

Want to go deeper into ONTAP quota? Read NetApp’s ONTAP concepts guide for how volumes and qtrees fit together, and try the qtree quota task in the Command Builder. You can also see the full plan for this course on the NetApp ONTAP Storage Administration course page.

Scroll to Top

This website uses cookies

We use a few cookies to keep this site working. If you allow it, we also use Google Analytics to count visits so we can improve our lessons. You can accept all, deny the optional ones, or choose what to allow.