Linux – Getting Error: “No space left on device” for a particular filename

ext4filesystemshard drivelinux

I have a ext4 volume with lot of files inside a particular directory.

Whenever I am trying to create a file inside it of a particular name, I am getting "No space left on device" error.

$ touch /data/lake/http:____images__br037__319854_366_tp.jpg
touch: cannot touch ‘/data/lake/http:____images__br037__319854_366_tp.jpg’: No space left on device

If I change even one letter of the filename, it works.

Here is the disk usage and inode usage for that volume:

# df -h /dev/xvdf
Filesystem      Size  Used Avail Use% Mounted on
/dev/xvdf       985G  679G  256G  73% /data

# df -i /dev/xvdf
Filesystem       Inodes    IUsed    IFree IUse% Mounted on
/dev/xvdf      65536000 24751661 40784339   38% /data

I ran fsck also to make sure that its not a disk corruption issue.

# e2fsck -y /dev/xvdf
e2fsck 1.42.9 (4-Feb-2014)
/dev/xvdf: clean, 24751661/65536000 files, 182020406/262144000 blocks

Can someone help me how can i debug it further.

Best Answer

There seems to be a known bug in the dir_index feature (which you should be able to disable) that is caused by hashes of filenames colliding:

http://blog.merovius.de/2013/10/20/ext4-mysterious-no-space-left-on.html