5

I am using XFS on small HDD (/dev/sdb1, less than 150G) and storing many small files (-32KB). df -h and -i show that it has available space.

# df -hv
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda3             127G   19G  102G  16% /
tmpfs                  16G     0   16G   0% /lib/init/rw
udev                   16G  168K   16G   1% /dev
tmpfs                  16G     0   16G   0% /dev/shm
/dev/sda1              99M   20M   75M  21% /boot
/dev/sdb1             136G  123G   14G  91% /mnt/sdb1
# df -iv
Filesystem            Inodes   IUsed   IFree IUse% Mounted on
/dev/sda3            8421376   36199 8385177    1% /
tmpfs                4126158       5 4126153    1% /lib/init/rw
udev                 4124934     671 4124263    1% /dev
tmpfs                4126158       1 4126157    1% /dev/shm
/dev/sda1              26112     222   25890    1% /boot
/dev/sdb1            24905120 11076608 13828512   45% /mnt/sdb1

However I got No space left on device error.

# touch /mnt/sdb1/test
touch: cannot touch `/mnt/sdb1/test': No space left on device

I think inode64 issue is not related to this case because drive is less than 1TB and df -i shows that there are free inodes. I unmounted and mounted with -o inode64 but got the same error.

xfs_repair does not report any problem. xfs_info shows drive information as follows.

# xfs_info /dev/sdb1
meta-data=/dev/sdb1              isize=1024   agcount=16, agsize=2227764 blks
         =                       sectsz=512   attr=2
data     =                       bsize=4096   blocks=35644210, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0
log      =internal               bsize=4096   blocks=17404, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0

Any ideas? Thanks!

--

I found this is the same problem as described in the following discussion.

[http://comments.gmane.org/gmane.comp.file-systems.xfs.general/41031][1]

There is no freespace available for inode in my HDD.

# xfs_db -r "-c freesp -s" /dev/sdb1
   from      to extents  blocks    pct
      1       1 1105980 1105980  32.01
      2       3  528180 1195803  34.61
      4       7  203982 1153467  33.38
poige
  • 9,448
  • 2
  • 25
  • 52
beketa
  • 93
  • 1
  • 1
  • 6
  • If you have any test files you are willing to remove: can you even remove files, or does even that nag you "No space left on device"? – Janne Pikkarainen Oct 06 '12 at 12:47
  • Yes. I moved some files to another drive. That made freespace for new inodes. – beketa Oct 07 '12 at 04:30
  • I noticed your free space percentages are in the 30s there. http://osvault.blogspot.com/2011/03/fixing-1tbyte-inode-problem-in-xfs-file.html says _If the total free blocks in each Allocation Group (AG) is less than about 40, then you can't create inodes in that allocation group._ – Josip Rodin Feb 23 '16 at 15:09

2 Answers2

3

Are you sure this is an inode problem? I notice that the space consummed is over 90%. This leads me to wonder if this is one of these "root" reserved spaces (I know that ext2/3/4 has this), or if 10% is necessary to be free for some reason for the XFS filesystem to work.

mdpc
  • 11,856
  • 28
  • 53
  • 67
  • I don't think it is caused by reserved space. I did a quick test using the same capacity drive. I made 141 1GB files. That made disk usage to be 100%. But still I can make a new file by touch. `$ df /dev/sdc1 Filesystem 1K-blocks Used Available Use% Mounted on /dev/sdc1 142507224 141297208 1210016 100% /srv/node/sdc1 $ df -i /dev/sdc1 Filesystem Inodes IUsed IFree IUse% Mounted on /dev/sdc1 1210208 145 1210063 1% /srv/node/sdc1` – beketa Oct 11 '12 at 21:54
  • Well it was just something I thought of. – mdpc Oct 11 '12 at 22:02
1

Have you tried running a fsck to see if it frees up available inodes.

If you interrupt a mv or rm then it can do what you describe.

Ben Lessani
  • 5,244
  • 17
  • 37
  • No I have not tried fsck. I will try it if I encounter the same situation though I hope I will not. – beketa Oct 07 '12 at 04:54