修改配额配置时 xfs fllesystem 重新挂载不起作用

修改配额配置时 xfs fllesystem 重新挂载不起作用

1.一开始

mount | grep home 
/dev/sdb1 on /home type xfs (rw,relatime,attr2,inode64,noquota)

2.尝试修改

mount -o remount,rw,relatime,attr2,inode64,prjquota  /dev/sbd1 /home

3.再次检查

mount | grep home 
/dev/sdb1 on /home type xfs (rw,relatime,attr2,inode64,noquota)

这不起作用。

cat /etc/fstab

#
# /etc/fstab
# Created by anaconda on Tue Aug  9 15:24:43 2016
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
UUID=8f1038a3-6c31-4ce1-a9ef-3d7325e10bef /                       ext4    defaults        1 1
UUID=c687eab8-3ddd-4756-b91e-ad562b522f7c /boot                   ext4    defaults        1 2
UUID=7ae72a46-1407-49e6-8669-95bb9e592794 /home                   xfs     rw,relatime,attr2,inode64,prjquota        0 0
UUID=3ccea12f-25d0-437b-9c4b-6ad6a9bd724c /tmp                    xfs     defaults        0 0
UUID=b8ab4016-49bd-4f48-9620-5bda76f4d8b1 /var/log                xfs     defaults        0 0
UUID=8b9a7ada-3f02-4ee5-8010-ad32a5d7461e swap                    swap    defaults        0 0

我可以修改/etc/fstab然后重新启动机器使其工作。但是,有什么方法可以在不重新启动的情况下更改配额配置吗?

答案1

根据 RHEL 文档,您不能:

XFS 配额不是可重新安装的选项。必须在初始安装时指定 -o 配额选项才能使配额生效。

https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Storage_Administration_Guide/ch03s09.html#idp21353040

我还尝试使用以下方法更改用户(测试)配额:

xfs_quota -x /home
xfs_quota> report -hu
User quota on /home (/dev/mapper/cl_backup--server-home)
                        Blocks              
User ID      Used   Soft   Hard Warn/Grace   
---------- --------------------------------- 
root            0      0      0  00 [------]
test        11,4G     9G    10G  00 [-none-]

xfs_quota> limit bsoft=30g bhard=32g test
xfs_quota> report -hu
User quota on /home (/dev/mapper/cl_backup--server-home)
                        Blocks              
User ID      Used   Soft   Hard Warn/Grace   
---------- --------------------------------- 
root            0      0      0  00 [------]
test        11,4G    30G    32G  00 [------]

xfs_quota> q

相关内容