基于xfs限制目录容量

xfs_quota目录限额是针对projectid。

 

虚拟机单独挂载了磁盘,已分好区。

基于分区创建xfs文件系统并挂载

mkfs.xfs /dev/sdb1
mount -o prjquota /dev/sdb1 /mnt
echo "/dev/sdb1 /mnt xfs defaults 0 0" >> /etc/fstab
df -h | grep "/mnt"

/mnt/10目录限制容量10MB

mkdir /mnt/10
xfs_quota -x -c 'project -s -p /mnt/10 1'
xfs_quota -x -c 'limit -p bhard=10485760 1' /mnt
xfs_quota -x -c report /mnt

分别查询目录和项目的使用量

xfs_quota -x -c report /mnt
xfs_quota -c 'quota -p 1' /mnt

 

 

posted on 2025-05-07 21:37  王景迁  阅读(34)  评论(0)    收藏  举报

导航