Linux Directory Quota (XFS)

virtuelle "Festplatte"

dd if=/dev/zero of=xfs.img bs=1G count=1
mkfs.xfs xfs.img

Einhängen

mkdir /mnt/xfs
mount -o prjquota,loop xfs.img /mnt/xfs

Projekte anlegen

mkdir /mnt/xfs/10MB
mkdir /mnt/xfs/50MB
mkdir /mnt/xfs/250MB
/etc/projects
1:/mnt/xfs/10MB
2:/mnt/xfs/50MB
3:/mnt/xfs/250MB

Projekte initialisieren

xfs_quota -x -c 'project -s 1' /mnt/xfs
xfs_quota -x -c 'project -s 2' /mnt/xfs
xfs_quota -x -c 'project -s 3' /mnt/xfs

Quota Zuweisungen

xfs_quota -x -c 'limit -p bhard=10m 1' /mnt/xfs
xfs_quota -x -c 'limit -p bhard=50m 2' /mnt/xfs
xfs_quota -x -c 'limit -p bhard=250m 3' /mnt/xfs

Kontrolle

# df -h /mnt/xfs
Filesystem            Size  Used Avail Use% Mounted on
/dev/loop0           1014M   33M  982M   4% /mnt/xfs
 
# df -h /mnt/xfs/10MB/
Filesystem            Size  Used Avail Use% Mounted on
/dev/loop0             10M     0   10M   0% /mnt/xfs
 
# df -h /mnt/xfs/50MB/
Filesystem            Size  Used Avail Use% Mounted on
/dev/loop0             50M     0   50M   0% /mnt/xfs
 
# df -h /mnt/xfs/250MB/
Filesystem            Size  Used Avail Use% Mounted on
/dev/loop0            250M     0  250M   0% /mnt/xfs