Saturday, May 23, 2015

Linux inode Full and error “Can’t create/write to file”

 

From Wiki

In a Unix-style file system, an index node, informally referred to as an inode, is a data structure used to represent a filesystem object, which can be one of various things including a file or a directory. Each inode stores the attributes and disk block location(s) of the filesystem object's data. Filesystem object attributes may include manipulation metadata (e.g. change, access, modify time), as well as owner and permission data (e.g. group-id,user-id, permissions).

A Linux directory lists other filesystem objects by name, normally identifying the listed object by referring to its inode. The directory contains an entry for itself, its parent, and each of its children.

If inode is full, you may face issue with error message similar “Can’t create/write to file”

To check how much inode has already consumed, use the command

# df -i /<directory>

you won’t be able to create file or write to file in that directory if indoe is 100% full.

 

In my case, i saw lots of empty files generated by faulty applications, so i just delete using rm –f command

 

You can also run the following cronjob to keep /<directory> clear.

Run crontab -e and add the following:
0 */4 * * * /usr/sbin/tmpwatch -am 12 /<directory>

No comments:

Post a Comment