December 2009
We have a Samba server with users' homedirs, and we want them under a quota
regime.
Docs on quota are readily available, and xfs_quota is fairly well documented.
There is even an XFS FAQ that mentions quota.
But a Google search for an error indicating XFS_QUOTAON
were not implemented gave a Slackware question in Linuxquestions as the best result.
Luckily, it also featured the solution this time.
Oh well.
sudo apt-get install xfsprogs quota
In /etc/fstab
, modify the line pertaining to the filesystem like this:
/dev/sda3 /mnt/D xfs defaults,uquota 0 0
sudo mkfs.xfs -f /dev/sda3
Note | |
---|---|
Maybe the aquota.* don't have to exist |
sudo touch /lwphome/aquota.{user,group}
sudo chmod 600 /lwphome/aquota.{user,group}
Remounting is not enough. The FS has to be unmounted, then mounted again.
sudo umount /mnt/D/
sudo mount /mnt/D/
sudo touch /mnt/D/bigblah
sudo chown jurjen:jurjen !$
dd if=/dev/zero of=/mnt/D/bigblah bs=1024 count=1000000000
dd: writing `/mnt/D/bigblah': Disk quota exceeded
20417+0 records in
20416+0 records out
20905984 bytes (21 MB) copied, 0.0443132 s, 472 MB/s
sudo xfs_quota -x -c report /mnt/D 2>/dev/null |head
User quota on /mnt/D (/dev/sda3)
Blocks
User ID Used Soft Hard Warn/Grace
---------- --------------------------------------------------
root 0 0 0 00 [--------]
chris 0 10240 20480 00 [--------]
jurjen 20416 10240 20480 00 [6 days]