Inode Full On Centos Cpanel

/ Comments off
Inode Full On Centos Cpanel Average ratng: 3,4/5 3880 votes
  1. Inode Full On Centos Cpanel Download
Inode full on centos cpanel fileDownload

Jun 01, 2017  cPanel is a well known, most reliable and intuitive commercial control panel for web hosting services. It is rich in feature and can be used via a.

I saw question over on stackoverflow, but I didn't like any of the answers, and it really is a question that should be here on U&L anyway.Basically an inode is used for each file on the filesystem. So running out of inodes generally means you've got a lot of small files laying around. So the question really becomes, 'what directory has a large number of files in it?' In this case, the filesystem we care about is the root filesystem /, so we can use the following command: find / -xdev -printf '%hn' sort uniq -c sort -k 1 -nThis will dump a list of every directory on the filesystem prefixed with the number of files (and subdirectories) in that directory. Thus the directory with the largest number of files will be at the bottom.In my case, this turns up the following: 1202 /usr/share/man/man12714 /usr/share/man/man32826 /var/lib/dpkg/info306588 /var/spool/postfix/maildropSo basically /var/spool/postfix/maildrop is consuming all the inodes.Note, this answer does have three caveats that I can think of.

It does not properly handle anything with newlines in the path. I know my filesystem has no files with newlines, and since this is only being used for human consumption, the potential issue isn't worth solving (and one can always replace the n with 0 and use sort -z above). Fallout 3 bio gas canister. It also does not handle if the files are spread out among a large number of directories. This isn't likely though, so I consider the risk acceptable. It will also count hard links to a same file (so using only one inode) several times.

Inode Full On Centos Cpanel Download

Cpanel

Again, unlikely to give false positivesThe key reason I didn't like any of the answers on the stackoverflow answer is they all cross filesystem boundaries. Since my issue was on the root filesystem, this means it would traverse every single mounted filesystem.

Throwing -xdev on the find commands wouldn't even work properly.For example, the most upvoted answer is this one: for i in `find.type d `; do echo `ls -a $i wc -l` $i; done sort -nIf we change this instead to for i in `find.xdev -type d `; do echo `ls -a $i wc -l` $i; done sort -neven though /mnt/foo is a mount, it is also a directory on the root filesystem, so it'll turn up in find.mount -type d, and then it'll get passed to the ls -a $i, which will dive into the mount.The find in my answer instead lists the directory of every single file on the mount. So basically with a file structure such as: /foo/bar/foo/baz/pop/tartwe end up with /foo/foo/popSo we just have to count the number of duplicate lines.