IT技术博客大学习 共学习 共进步
全部 移动开发 后端 数据库 AI 算法 安全 DevOps 前端 设计 开发者

大分区使用xfs文件系统存储备份遇到的问题

MySQL 中文网 2013-02-28 23:26:21 累计浏览 2,139 次
本机暂存

   日前,同事反馈一个问题:在一个大分区(24T)中使用xfs文件系统,用来做历史文件备份,突然提示没有磁盘空间错误,先检查下:

[root@imysql ~]# df -hT
Filesystem    Type    Size  Used Avail Use% Mounted on
/dev/sdb1      xfs     19T   16T  2.4T  88% /backup

[root@imysql ~]# df -hi
Filesystem            Inodes   IUsed   IFree IUse% Mounted on
/dev/sdb1               9.3G    3.4M    9.3G    1% /backup

   可以看到,不管是物理空间,还是inode,都还有很多余量,那为何还会报告磁盘空间不够呢?

   查询了下XFS FAQ,发现有一段:

Q: What is the inode64 mount option for?

By default, with 32bit inodes, XFS places inodes only in the first 1TB of a disk. If you have a disk with 100TB, all inodes will be stuck in the first TB. This can lead to strange things like "disk full" when you still have plenty space free, but there's no more place in the first TB to create a new inode. Also, performance sucks.
To come around this, use the inode64 mount options for filesystems >1TB. Inodes will then be placed in the location where their data is, minimizing disk seeks.
Beware that some old programs might have problems reading 64bit inodes, especially over NFS. Your editor used inode64 for over a year with recent (openSUSE 11.1 and higher) distributions using NFS and Samba without any corruptions, so that might be a recent enough distro.

   大意就是xfs文件系统会把inode存储在磁盘最开始的这1T空间里,如果这部分空间被完全填满了,那么就会出现磁盘空间不足的错误提示了。解决办法就是在挂载时,指定 inode64 选项:

mount -o remount -o noatime,nodiratime,inode64,nobarrier /dev/sdb1 /backup

   P.S,磁盘空间小于1T的不用担心这个问题 :)

同分类推荐文章

  1. 从零重建 macOS 开发机:可复现的环境初始化流程 (2026-06-14 20:36:00)
  2. 百度物理网络监控工具开源第二弹:毫秒级监控工具 baize,让你的网络问题无处遁形 (2026-06-11 08:10:28)
  3. How to Set Up Homebrew Tap for Private CLI Tools: A Complete Guide (2026-05-27 02:13:03)

查看更多 DevOps 文章 →

建议继续学习

  1. Linux如何统计进程的CPU利用率 (累计阅读 16,308)
  2. 我的 RHCA 之路 (累计阅读 14,013)
  3. Linux内存点滴 用户进程内存空间 (累计阅读 13,230)
  4. 给程序员新手的一些建议 (累计阅读 13,089)
  5. Linux 性能监控、测试、优化工具 (累计阅读 13,011)
  6. 关于linux内存free的一些事情 (累计阅读 12,867)
  7. ps - 按进程消耗内存多少排序 (累计阅读 12,688)
  8. Google怎么用linux (累计阅读 12,581)
  9. Linux Used内存到底哪里去了? (累计阅读 11,867)
  10. find命令的一点注意事项 (累计阅读 11,866)