使用XFS文件系统格式化磁盘

挂载已格式化的磁盘分区并查看磁盘容量列表
[root@localhost ~]# mkdir -p /data
[root@localhost ~]# mount -o prjquota /dev/xvdb5 /data/

建立一个使用配置文件的Project Quota文件目录并设置配额

[root@localhost ~]# mkdir -p /data/app
 [root@localhost ~]# echo 42:/data/app >> /etc/projects
 [root@localhost ~]# echo application:42 >> /etc/projid
 [root@localhost ~]# xfs_quota -x -c 'project -s application' /data/
 Setting up project application (path /data/app)...
 Processed 1 (/etc/projects and cmdline) paths for project application with recursion depth infinite (-1).
 [root@localhost ~]# xfs_quota -x -c 'limit -p bhard=1g application' /data/

查看配额报告信息



命令xfs_quota用法详见man xfs_quota手册

EXAMPLES
Enabling quota enforcement on an XFS filesystem (restrict a user to a set amount of space).

# mount -o uquota /dev/xvm/home /home
# xfs_quota -x -c 'limit bsoft=500m bhard=550m tanya' /home
# xfs_quota -x -c report /home

Enabling project quota on an XFS filesystem (restrict files in log file directories to only using 1 gigabyte of space).

# mount -o prjquota /dev/xvm/var /var
# echo 42:/var/log >> /etc/projects
# echo logfiles:42 >> /etc/projid
# xfs_quota -x -c 'project -s logfiles' /var
# xfs_quota -x -c 'limit -p bhard=1g logfiles' /var

Same as above without a need for configuration files.

# rm -f /etc/projects /etc/projid
# mount -o prjquota /dev/xvm/var /var
# xfs_quota -x -c 'project -s -p /var/log 42' /var
# xfs_quota -x -c 'limit -p bhard=1g 42' /var

Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)

© 2018 Mr. Xiao's Blog Suffusion theme by Sayontan Sinha