{"id":71,"date":"2021-06-28T05:20:39","date_gmt":"2021-06-28T05:20:39","guid":{"rendered":"http:\/\/webhostingpune.co.in\/blog\/?p=71"},"modified":"2021-06-28T05:20:41","modified_gmt":"2021-06-28T05:20:41","slug":"how-to-check-inode-usage","status":"publish","type":"post","link":"https:\/\/webhostingpune.co.in\/blog\/how-to-check-inode-usage\/","title":{"rendered":"How to check Inode Usage"},"content":{"rendered":"\n<h1 class=\"wp-block-heading\"><em>What is the inode?<\/em><\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">Inode is a data structure in a Unix-style filesystem that describes a file-system object such as a file or a directory. It may contain metadata information like file access time, permissions, etc.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Each filesystem or partition has its own set of inodes. To uniquely identify a file, you need both the inode and the device partition information.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If all the inodes in a filesystem are used up, the kernel can not create new files even when there is available free disk space. So, if you have ample free disk space but unable to create new files, check the inode usage for that partition.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong><em>To get the inode usage for active file system on your system.<\/em><\/strong><\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>$ df -i \nFilesystem       Inodes   IUsed    IFree IUse% Mounted on\r\n\/dev\/vda1      13640832 1487624 12153208   11% \/\r\ndevtmpfs         232604     326   232278    1% \/dev\r\ntmpfs            235277       1   235276    1% \/dev\/shm\r\ntmpfs            235277     555   234722    1% \/run\r\ntmpfs            235277      16   235261    1% \/sys\/fs\/cgroup\r\n\/dev\/loop0       146592     139   146453    1% \/tmp\r\ntmpfs            235277       1   235276    1% \/run\/user\/0<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong><em>How to count Inode usage<\/em><\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>echo \"Detailed Inode usage for: $(pwd)\" ; for d in `find -maxdepth 1 -type d |cut -d\\\/ -f2 |grep -xv . |sort`; do c=$(find $d |wc -l) ; printf \"$c\\t\\t- $d\\n\" ; done ; printf \"Total: \\t\\t$(find $(pwd) | wc -l)\\n\"\n\nDetailed Inode usage for: \/home\/daygeek\r\n11\t\t- 2g\r\n46\t\t- bash-insulter\r\n140\t\t- batstat\r\n96\t\t- betty\r\n178\t\t- .bundle\r\n43114\t\t- .cache\r\n965\t\t- .cargo\r\n1870\t\t- .config\r\n156\t\t- Desktop\r\n3258\t\t- Documents\r\n186\t\t- Downloads\r\n60\t\t- drivesync\r\n3055\t\t- .local\r\n4058\t\t- .mozilla\r\n1568\t\t- .npm\r\n250\t\t- Pictures\r\n16492\t\t- .rustup\r\n146\t\t- snap\r\n64\t\t- ssh-audit\r\n1552\t\t- Videos\r\n159\t\t- yay\r\n\r\nTotal: \t\t77682<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>What is the inode? Inode is a data structure in a Unix-style filesystem that describes a file-system object such as a file or a directory. It may contain metadata information like file access time, permissions, etc. Each filesystem or partition has its own set of inodes. To uniquely identify a file, you need both the inode and the device partition information. If all the inodes in a filesystem are used up, the kernel can not create new files even when there is available free disk space. So, if you have ample free disk space but unable to create new files, check the inode usage for that partition. To get the inode usage for active file system on your system. How to count Inode usage<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","footnotes":""},"categories":[1],"tags":[],"class_list":["post-71","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/webhostingpune.co.in\/blog\/wp-json\/wp\/v2\/posts\/71","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webhostingpune.co.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webhostingpune.co.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webhostingpune.co.in\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/webhostingpune.co.in\/blog\/wp-json\/wp\/v2\/comments?post=71"}],"version-history":[{"count":3,"href":"https:\/\/webhostingpune.co.in\/blog\/wp-json\/wp\/v2\/posts\/71\/revisions"}],"predecessor-version":[{"id":74,"href":"https:\/\/webhostingpune.co.in\/blog\/wp-json\/wp\/v2\/posts\/71\/revisions\/74"}],"wp:attachment":[{"href":"https:\/\/webhostingpune.co.in\/blog\/wp-json\/wp\/v2\/media?parent=71"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webhostingpune.co.in\/blog\/wp-json\/wp\/v2\/categories?post=71"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webhostingpune.co.in\/blog\/wp-json\/wp\/v2\/tags?post=71"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}