No space left on device – running out of Inodes

[Total: 4    Average: 5/5]

Some times we are getting error message “No space left on device” while uploading file/script on the server. It means the disk space is full or disk running out of Inodes. If you ever run into such trouble – most likely you have too many small or 0-sized files on your disk, and while you have enough disk space, you have exhausted all available Inodes Below is the solution for this problem.

1. check available disk space to ensure that you still have some

#df -h

2) check available Inodes

# df -i

If the Inodes is showing 100% or near, then the reason for “No space left on device” errors.

3) Find out the the high Inodes uses directory using below command.

#for i in /*; do echo $i; find $i |wc -l; done

This command will list directories and number of files in them. If you have found high Inodes under /home then you can repeat the command under /home directory.

#for i in /home/*; do echo $i; find $i |wc -l; done

Once you found the exact high Inodes uses folder then you can remove it or remove files from it.

You’re done.
Check the results with df -i command again.