XFS添加配额 – 跳过第一次安装/引导的配额检查

我们在集群上运行14TB XFS文件服务器,并希望添加配额支持。 这是在CentOS 6.3(Final)下运行3.9.2-1.el6.elrepo.x86_64内核。

问题是当我们卸载XFS RAID时,重新挂载它,添加配额支持,挂载命令挂起。 Sever IS响应并且XFS挂载点不可访问。 恢复/ etc / fstab中的更改以删除配额选项不会挂载挂起。

我怀疑重新挂载时,XFS正在对14TB RAID进行配额检查。 我的问题是: 我如何禁用初始配额检查,以便它可以正确安装,并在后台运行配额检查?

/etc/fstab条目:

 /dev/sdb /w1 xfs defaults,noatime,usrquota,grpquota 1 2 

/var/log/messages输出:

 Jun 6 11:37:43 nas-2-1 kernel: XFS (sdb): Mounting Filesystem Jun 6 11:37:43 nas-2-1 kernel: XFS (sdb): Ending clean mount Jun 6 11:37:43 nas-2-1 kernel: XFS (sdb): Quotacheck needed: Please wait. 

我不介意高CPU使用率或性能下降,而挂载点是积极的,但让它不可用不是我们要坚持的选项。 我怀疑在14TB上进行配额检查大概需要一整个工作日。

如果你使用xfs,你将永远有这个问题:

(quotaon manpage)

  "XFS filesystems are a special case - XFS considers quota information as filesystem metadata and uses journaling to provide a higher level guarantee of consistency. There are two components to the XFS disk quota system: accounting and limit enforcement. XFS filesystems require that quota accounting be turned on at mount time. It is possible to enable and disable limit enforcement on an XFS filesystem after quota accounting is already turned on. The default is to turn on both accounting and enforcement." 

另外,从xfs_quota手册页:

  disable [ -gpu ] [ -v ] Disables quota enforcement, while leaving quota accounting active. The -v option (verbose) displays the state after the operation has completed. off [ -gpu ] [ -v ] Permanently switches quota off for the filesystem identified by the current path. **Quota can only be switched back on subse‐ quently by unmounting and then mounting again.** 

由于必须使配额核算最新,因此将检查整个卷,14T字节将需要很长时间。

一种方法是禁用限制执行,但是仍然需要检查配额记帐,如果你想尝试,也许还需要很多时间,不要在启动的时候通过设置'noauto'标志来挂载它,然后禁用它如地狱。

我想你不想改变文件系统types,什么可以让你pipe理配额“在线”,甚至创build一个卷的映像(使用xfsdump或xfscopy),一旦挂载就应用配额,然后通过rsync ,更新其内容与网上,这也将作为备份,但第二个选项也将花费很多时间。

对不起,坏消息,我希望有人可以给你一个更好的解决scheme。