{"id":2665,"date":"2015-09-24T21:21:18","date_gmt":"2015-09-24T21:21:18","guid":{"rendered":"https:\/\/qbytes.cloud\/?p=2665"},"modified":"2015-09-24T21:21:18","modified_gmt":"2015-09-24T21:21:18","slug":"check-inode-usage","status":"publish","type":"post","link":"https:\/\/www.qbytes.cloud\/index.php\/2015\/09\/24\/check-inode-usage\/","title":{"rendered":"Check inode usage"},"content":{"rendered":"<p>How to check inode usage<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n]# df -i\nFilesystem       Inodes    IUsed   IFree IUse% Mounted on\n\/dev\/vda3      50044928 50044928       0  100% \/\ntmpfs           1950595        1 1950594    1% \/dev\/shm\n\/dev\/vda1        128016       39  127977    1% \/boot\n\/usr\/tmpDSK      262144       20  262124    1% \/tmp\n\n<\/pre>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nfor d in *; do echo -n &quot;$d: &quot;; find $d -type f | wc -l; done \/home\n<\/pre>\n<p>By the way, if you&#8217;re looking for the directories that contain lots of files, this script may help:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n\n#!\/bin\/bash\n# count_em - count files in all subdirectories under current directory.\necho &#039;echo $(ls -a &quot;$1&quot; | wc -l) $1&#039; &gt;\/tmp\/count_em_$$\nchmod 700 \/tmp\/count_em_$$\nfind . -mount -type d -print0 | xargs -0 -n1 \/tmp\/count_em_$$ | sort -n\nrm -f \/tmp\/count_em_$$\n<\/pre>\n<p>Also&#8230;<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n# find . -xdev -type f | cut -d &quot;\/&quot; -f 2 | sort | uniq -c | sort -n\n<\/pre>\n<p>Try to find if this is an inodes problem with:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n\n# df -ih\n\n<\/pre>\n<p>Try to find root folders with large inodes count:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n\n# for i in \/*; do echo $i; find $i |wc -l; done\n\n<\/pre>\n<p>Try to find specific folders:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n\n# for i in \/src\/*; do echo $i; find $i |wc -l; done\n\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>How to check inode usage ]# df -i Filesystem Inodes IUsed IFree IUse% Mounted on \/dev\/vda3 50044928 50044928 0 100% \/ tmpfs 1950595 1 1950594 1% \/dev\/shm \/dev\/vda1 128016 39 127977 1% \/boot \/usr\/tmpDSK 262144 20 262124 1% \/tmp for d in *; do echo -n &quot;$d: &quot;; find $d -type f | wc -l; &#8230; <a title=\"Check inode usage\" class=\"read-more\" href=\"https:\/\/www.qbytes.cloud\/index.php\/2015\/09\/24\/check-inode-usage\/\" aria-label=\"Read more about Check inode usage\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-2665","post","type-post","status-publish","format-standard","hentry","category-administration"],"_links":{"self":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts\/2665","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/comments?post=2665"}],"version-history":[{"count":0,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts\/2665\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/media?parent=2665"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/categories?post=2665"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/tags?post=2665"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}