Locating Excessive Inode Usage

The command to list the directories using the most inodes is:

find . -printf "%h\n" | cut -d/ -f-2 | sort | uniq -c | sort -rn

However, I first needed to narrow down the directory under root that might be causing the problem:

df -i

showed that the root directory (/) was the problem. But I did not need to scan all directories as some had terabytes of files so:

for DIR in $( ls | egrep -v "local|var|home|mnt|boot|dev"  ) ;do  find /$DIR -printf "%h\n" | cut -d/ -f-2 | sort | uniq -c | sort -rn   ; done

This was much quicker and I quickly narrowed it down to /usr/local/pnp4nagios/spool


Leave a Reply

  • (will not be published)

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>