~derf / interblag / entry / Enabling Filesystem Quotas on Debian

Because I keep forgetting how I do it, here's how to enable filesystem quotas on a reasonably recent Debian server. For simplicity, let's say the mountpoint is /home and the device /dev/storage/home.

sudo apt install quota
  • Add usrquota as a mount option to the /etc/fstab for /home
sudo systemctl daemon-reload
sudo umount /home
sudo tune2fs -O quota /dev/storage/home
sudo mount /home

For usrquota alone, a remount should be sufficient, but tune2fs needs to run offline in this case. Now, all that's left is setting quotas. This only needs to be run once for each new account, preferable automatically as part of some kind of account management system.

setquota -u account block-soft block-hard inode-soft inode-hard /home

You can check quota settings and usage with repquota -as.