Kingsfordweg 151, 1043GR Amsterdam, The Netherlands ● 24/7 support — support@novogara.com
Knowledge base

Disk quotas

On a machine with several users or customers, the question is not whether someone will fill the disk but which one.

Turn them on

Add usrquota,grpquota to the mount options in /etc/fstab, remount, then:

quotacheck -cugm /home

quotaon /home

On XFS, quotas are enabled at mount time with uquota,pquota and there is no separate check step.

Setting a limit

setquota -u jan 5G 6G 0 0 /home

Four numbers: soft block limit, hard block limit, soft inode limit, hard inode limit. The soft limit may be exceeded for a grace period; the hard limit cannot be exceeded at all.

repquota -s /home — who is using what

quota -u jan — one user

Do not forget inodes

A filesystem can run out of inodes with gigabytes of space free — millions of tiny session files, a mail store, a cache that never prunes. The symptom is “no space left on device” while df -h looks fine.

df -i is the command that tells you, and an inode quota is what prevents it. Alert on both, as logs and a disk that fills up describes.

XFS project quotas

Often better than user quotas: they limit a directory tree regardless of who owns the files inside it. That matches how things actually fill up — a customer's web root, an uploads directory, a container's volume.

Define the project in /etc/projects and /etc/projid, then xfs_quota -x -c 'limit -p bhard=50g customer1' /srv.

When not to bother

On a single-purpose machine with one application, quotas are overhead that complicates every restore and every migration. Monitoring and an alert at 80% does the same job with none of the friction.

Use quotas when there are genuinely separate parties on one filesystem — shared hosting, a control panel with customers, several teams — and monitoring everywhere else.

Control panels handle this

DirectAdmin, which we include free with every server, manages per-account quotas itself. If you run one, configure it there rather than with setquota underneath it — the panel will overwrite you. See control panels.

Capacity is the real answer

Quotas stop one party hurting another. They do not create space. If the filesystem is genuinely full, that is a capacity planning question, and adding disks to an existing machine is usually a short window — see upgrading your server.


Still stuck? Mail support@novogara.com — an engineer answers, at any hour. Back to the knowledge base