小知识:xfs文件系统提示没有磁盘空间错误的解决方法

日前,同事反馈一个问题:在一个大分区(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 theres 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的不用担心这个问题 🙂

声明: 猿站网有关资源均来自网络搜集与网友提供,任何涉及商业盈利目的的均不得使用,否则产生的一切后果将由您自己承担! 本平台资源仅供个人学习交流、测试使用 所有内容请在下载后24小时内删除,制止非法恶意传播,不对任何下载或转载者造成的危害负任何法律责任!也请大家支持、购置正版! 。本站一律禁止以任何方式发布或转载任何违法的相关信息访客发现请向站长举报,会员发帖仅代表会员个人观点,并不代表本站赞同其观点和对其真实性负责。本网站的资源部分来源于网络,如有侵权烦请发送邮件至:2697268773@qq.com进行处理。
建站知识

小知识:Linux交换空间的管理与技巧详解

2023-6-11 6:05:48

建站知识

小知识:XFS文件系统简介 Linux中使用XFS文件系统的配置方法

2023-6-11 6:22:15

0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索