Putting Quota on a Samba-shared XFS

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.

Procedure 29.  Getting XFS quota to work on a sandbox

  1. Installing packages


      sudo apt-get install xfsprogs quota

  2. Editing /etc/fstab

    In /etc/fstab, modify the line pertaining to the filesystem like this:

    /dev/sda3       /mnt/D          xfs     defaults,uquota   0       0
    	

  3. Putting a filesystem on the test partition

    sudo mkfs.xfs -f /dev/sda3

  4. Creating quota administration files

    [Note]Note

    Maybe the aquota.* don't have to exist

    sudo touch /lwphome/aquota.{user,group}
    sudo chmod 600 /lwphome/aquota.{user,group}

  5. Mounting the FS with quota enabled

    Remounting is not enough. The FS has to be unmounted, then mounted again.

    sudo umount /mnt/D/
    sudo mount /mnt/D/

  6. Setting some quota

    1

    At least after this, you can use edquota as usual.

    2

    Don't use a trailing slash here!

  7. Testing quota enforcement

  8. Reading a report

    1

    This user not shown by repquota