11 February 2012 - Fairbanks
Ran into an interesting problem with a large XFS volume today where it ran out of space when it actually had plenty of free space. Turns out this is an odd issue related unable to allocate any further inodes.
xfs dynamically allocates inodes though!
Yes, but apparently it dynamically allocates inodes and keeps track of that allocation in the first 1TB of space. If you have completely filled that first 1TB it can’t dynamically allocation more causing a ‘No space left on device’ error.
[dbroders@soy SDMI.ORTHO.2010]$ df -h .
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/md0raid0-work
2.7T 2.4T 401G 86% /data/scratch
[dbroders@soy SDMI.ORTHO.2010]$ touch asdf
touch: cannot touch `asdf': No space left on device
Enter the google where I found a wonderful run down on how the problem and how to solve it: http://osvault.blogspot.com/2011/03/fixing-1tbyte-inode-problem-in-xfs-file.html
agsize 8388480 and bsize is 4K … yadda yadda what is the solution.
I picked a particular directory I knew held data from a long time ago to simplify my search, my goal to find files in Allocation Group 0. So I made the following silly ruby script:
I then just grabbed some of the larger files in that list. Moved (mv) them to /tmp and then moved them back again. Life was good.