Updated: 3 November 2026 · Applies to: Ubuntu, ext4 with the quota tools
Disk quotas limit how much space or how many files a user or group can create on a filesystem. On an ext4 filesystem, set this up by installing the quota package, enabling the quota mount options in /etc/fstab, remounting, and initializing the quota files.
If your server uses XFS instead of ext4 (common on current Ubuntu cloud images), this entire approach does not apply: XFS has its own, different, built-in quota system managed with xfs_quota, configured through mount options at mount time rather than through the separate tools this article covers. Check your filesystem type first with df -T / before following these steps.
Quota types
- Block (usage) quota: limits how much disk space can be used.
- Inode (file) quota: limits how many files and directories can be created, regardless of their total size.
Key terms
- Soft limit: a warning level. Once past it, the user can still write more data, but only for the grace period below, unless grace periods are not in use, in which case the soft limit acts as the real limit.
- Hard limit: the absolute ceiling. Once reached, further writes are refused outright.
- Grace period: how long a user may stay over their soft limit before it is enforced as a hard limit. The Linux default is 7 days.
Step 1: install the quota tools
apt install -y quota quotatool
Step 2: enable quotas in fstab
vi /etc/fstab
Add usrquota and grpquota to the mount options for the filesystem you want to apply quotas to, for example:
/dev/sda1 / ext4 defaults,usrquota,grpquota 0 1
Step 3: create the quota tracking files
touch /quota.user /quota.group
chmod 600 /quota.user /quota.group
Step 4: remount so the new options take effect
Rebooting is the simplest way:
shutdown -r now
If a reboot is not possible right now, remount the filesystem instead:
mount -o remount /
Step 5: confirm the quota options are active
mount | grep quota
Step 6: initialize the quota database and turn quotas on
Scan the filesystem and build the quota accounting files:
quotacheck -avug
-a checks every mounted filesystem with quotas enabled in fstab, -v prints what it is doing, -u covers user quotas, -g covers group quotas.
Turn quota enforcement on:
quotaon -avug
Step 7: set a quota for a specific user
edquota -u username
This opens an editor with that user's current limits; set the soft and hard limits for blocks and inodes, then save.
Step 8: confirm it took effect
quota -u username
View a summary for every user
repquota -a