Why is my Linux server saying that it has run out of disk space when it hasn’t?


If you get an error message that tells you there is no space on the device when trying to create a file or directory, but you check the disk usage and see that there is free space, it may be that your server has run out of inodes.

Each file on the server uses one inode.  If you have a very large number of small files, it may be that while you haven’t used up all the space on the server, you have used up all the inodes.

You can check for inode usage by entering in this command:

df -i

To free up the inodes, you will need to delete the excess files.  If you are unable to locate where these excess files are, you can run a command like this:

for i in `find / -type d 2>/dev/null `; do echo `ls -a $i 2>/dev/null | wc -l ` $i; done | sort -n

This will list all directories on your server, and order them by the number of files they contain.  This can take a long time to run, depending on the number of directories in your file system.

Once you locate where the largest number of files are, you can remove those files.  You should be able to upload files now.



Article ID: 53
Created On: Tue, Mar 3, 2015 at 3:59 PM
Last Updated On: Wed, Aug 18, 2021 at 1:55 PM

Online URL: https://www.heartinternet.uk/support/article/why-is-my-linux-server-saying-that-it-has-run-out-of-disk-space-when-it-hasn-t.html