天天看點

No space left on device on xfs filesystem with 2.4T

情況說明:

日前,同僚回報一個問題:在一個大分區(24T)中使用xfs檔案系統,用來做曆史檔案備份,突然提示沒有磁盤空間錯誤,先檢查下:

<code>[root@imysql ~]</code><code># df -hT</code>

<code>Filesystem    Type    Size  Used Avail Use% Mounted on</code>

<code>/dev/sdb1</code>      <code>xfs     19T   16T  2.4T  88% </code><code>/backup</code>

<code>[root@imysql ~]</code><code># df -hi</code>

<code>Filesystem            Inodes   IUsed   IFree IUse% Mounted on</code>

<code>/dev/sdb1</code>               <code>9.3G    3.4M    9.3G    1% </code><code>/backup</code>

可以看到,不管是實體空間,還是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 &gt;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空間裡,如果這部分空間被完全填滿了,那麼就會出現磁盤空間不足的錯誤提示了。

檢視mount的man幫助手冊,可以看到如下内容:

inode64

Indicates that XFS is allowed to create inodes at any location in the filesystem, including those which will result in inode numbers occu-pying more than 32 bits of significance. This is provided for back-wards compatibility, but causes problems for backup applications that

cannot handle large inode numbers.

解決辦法就是在挂載時,指定inode64選項:

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

參考資料:https://www.centos.org/forums/viewtopic.php?t=21766

P.S:磁盤空間小于1T的不用擔心這個問題.

本文轉自 冰凍vs西瓜 51CTO部落格,原文連結:http://blog.51cto.com/molewan/1703109,如需轉載請自行聯系原作者

繼續閱讀