1

Running a python script to generate millions of empty text files just for fun on my Mint machine (18.1 Serena) before I wipe it.

Recently the script failed with this error:

OSError: [Errno 28] No space left on device: '1013162169.txt'

There is clearly memory and inode table space left available, and restarting the script running processes for a bit before throwing the error again.

$ df -i
Filesystem       Inodes    IUsed    IFree IUse% Mounted on
udev             194936      488   194448    1% /dev
tmpfs            205500      716   204784    1% /run
/dev/sda1      60563456 18707860 41855596   31% /
tmpfs            205500        1   205499    1% /dev/shm
tmpfs            205500        6   205494    1% /run/lock
tmpfs            205500       18   205482    1% /sys/fs/cgroup
cgmfs            205500       14   205486    1% /run/cgmanager/fs
tmpfs            205500        6   205494    1% /run/user/1000

$ df
Filesystem     1K-blocks     Used Available Use% Mounted on
udev             3831012        0   3831012   0% /dev
tmpfs             770428    17620    752808   3% /run
/dev/sda1      953630580 14641452 890524440   2% /
tmpfs            3852140        0   3852140   0% /dev/shm
tmpfs               5120        4      5116   1% /run/lock
tmpfs            3852140        0   3852140   0% /sys/fs/cgroup
cgmfs                100        0       100   0% /run/cgmanager/fs
tmpfs             770428        4    770424   1% /run/user/1000

Is there some other space constraint being run into here? The specific case is a meaningless script but I'm very curious about underlying cause.

Files are being created in /home/jon/test which is on sda1.

  • 2
    Check your filesystem for constrains about the number of the files and/or directories in one directory – Romeo Ninov Nov 21 '18 at 15:20
  • Do you have just the one filesystem? Where are the files being generated? – Jeff Schaller Nov 21 '18 at 15:21
  • Added the full df outputs. They're being created in the directory the script runs in which is on sda1. Most of those 18 million inodes are files from this process. – Jon Reinhold Nov 21 '18 at 15:29
  • 1
    @RomeoNinov ext4, which doesn't seem to have a limit defined per directory, and several billion for the whole system. – Jon Reinhold Nov 21 '18 at 15:34
  • 3
    Looking at the the related questions (right-hand sidebar), it suggests you hit birthday paradox on the directory index, which uses a 32-bit hash table. unix.stackexchange.com/questions/222221/… – sourcejedi Nov 21 '18 at 16:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.