XFS 添加配额 - 首次挂载/启动时跳过配额检查

XFS 添加配额 - 首次挂载/启动时跳过配额检查

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

问题是,当我们卸载 XFS RAID 并重新安装它以添加配额支持时,安装命令会挂起。服务器有响应,并且 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 进行配额检查大约需要一整天的工作时间。

答案1

如果你使用 xfs,你总会遇到这样的问题:

(quotaon 手册页)

   "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.**

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

一种选择是禁用限制执行,但它仍然需要检查配额核算,并且可能仍需要很长时间,如果您想尝试,请不要在启动时通过设置“noauto”标志来安装它,然后从 shell 中禁用它。

我假设您不想更改文件系统类型,什么可以让您“在线”管理配额,甚至创建该卷的映像(使用 xfsdump 或 xfscopy),在安装后将配额应用于它,然后通过 rsync 用在线内容更新其内容,这也可以作为备份,但第二种选择也会花费很多时间。

很抱歉带来这个坏消息,我希望有人能给你更好的解决方案。

相关内容