mktemp: failed to create file via template ‘/tmp/tmp.XXXXXXXXXX’: No space left on device

mktemp: failed to create file via template ‘/tmp/tmp.XXXXXXXXXX’: No space left on device

Not able to create new files, Not able to restart apache or mysql, Not able to run find or similar commands because of above error.

Solution :

You need to check two things on your system, first remaining space and second usage of inodes.

Delete some large files and make some empty space.

But if your hard disk is not full and sufficient space is there but still you are getting this error, there is fair enough chance that inode may be the reason.

If used inodes are 100% then you can not create any more files or restart servers or execute find command etc. Every new file or directory needs inode number and if all inodes are used, you can not create new.

Now how to check use inode %. Simply run command :
df -i

Here you can see total number of inode and used number of inode. If you have used all inodes, it means some program is creating large number of small files like any session directory of web application (ex- magento) or any similar program, You need to delete these all unused files and make some inodes free.

Once you have enough inodes, you can start creating files or restarting servers or making other tasks.

No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...