Zum Inhalt springen
Linux Directory Quota (XFS)

Linux Directory Quota (XFS)

XFS unterstützt verzeichnisbasierte Quotas über sog. Projekt-Quotas. Im folgenden Beispiel wird eine virtuelle Festplatte mit XFS formatiert und Quotas für drei Verzeichnisse eingerichtet.

XFS Image erstellen und einhängen

dd if=/dev/zero of=xfs.img bs=1G count=1
mkfs.xfs xfs.img
mkdir /mnt/xfs
mount -o prjquota,loop xfs.img /mnt/xfs

Projektverzeichnisse anlegen

mkdir /mnt/xfs/10MB
mkdir /mnt/xfs/50MB
mkdir /mnt/xfs/250MB

Projektdefinitionen erstellen:

/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 zuweisen

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
Zuletzt aktualisiert am