{"id":2983,"date":"2012-09-06T16:35:49","date_gmt":"2012-09-06T16:35:49","guid":{"rendered":"http:\/\/www.theperfectarts.com\/?p=2983"},"modified":"2013-01-14T17:45:13","modified_gmt":"2013-01-14T17:45:13","slug":"inode-related-questions","status":"publish","type":"post","link":"https:\/\/www.ktchost.com\/blog\/inode-related-questions\/","title":{"rendered":"inode related question"},"content":{"rendered":"<p>Now we have started the Linux Sytem Admin questions on daily basis, so that you can check the questions with the answer daily at least one topic. Today&#8217;s topic is inode. The following questions are mostly asked \u00a0by any\u00a0institution\u00a0or company.<\/p>\n<p><strong>1st) What is inode?<\/strong><\/p>\n<p>Ans ) Al the files and directory having its own description stored in a structure its called as &#8216;inode&#8217; and every file\/directory having differeny inode number. The following fields are content in the inode.<\/p>\n<blockquote><p><strong>owner identifier <\/strong><br \/>\n<strong>The file type<\/strong><br \/>\n<strong>The file access permissions<\/strong><br \/>\n<strong>Th file access times<\/strong><br \/>\n<strong>The number of links <\/strong><br \/>\n<strong>The most important the file size<\/strong><br \/>\n<strong>The location of the file data<\/strong><\/p><\/blockquote>\n<p><strong>2nd) How to check the inode number for file or directory?<\/strong><\/p>\n<p>Ans) Refer the following command<\/p>\n<p>For example for file<\/p>\n<blockquote><p><strong>root@linux [\/home]# ll -li test.php<\/strong><br \/>\n<strong>3473411 -rw-r&#8211;r&#8211; 1 root root 65 Jul 3 15:06 test.php<\/strong><\/p><\/blockquote>\n<p>The inode number for test.php file is <strong>3473411<\/strong><\/p>\n<p>For example for directory<\/p>\n<blockquote><p><strong>root@linux[~]# ll -id \/root<\/strong><br \/>\n<strong>224001 drwxr-x&#8212; 16 root root 4096 Sep 6 04:58 \/root\/<\/strong><\/p><\/blockquote>\n<p>The inode number for root directory is\u00a0<strong>224001\u00a0<\/strong><\/p>\n<p><strong>3rd) How to check the server partitions inode numbers\/<\/strong><\/p>\n<p>Ans) We can check the server partitions inode number by using the following command &#8220;df -i&#8221;<\/p>\n<p>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br \/>\nFilesystem \u00a0 \u00a0 \u00a0 Inodes \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 IUsed \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 IFree \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0IUse% \u00a0 \u00a0Mounted on<br \/>\n\/dev\/sda1 \u00a0 \u00a0 \u00a0 1280000 \u00a0 \u00a0 \u00a010131 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 1269869 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u00a01 2% \u00a0 \u00a0 \u00a0 \u00a0 \/home<br \/>\n\/dev\/sda3 \u00a0 \u00a0 \u00a06403712 \u00a0 \u00a0 \u00a0 111265 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 6292447 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 2% \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\/usr<br \/>\n\/dev\/sda2 \u00a0 \u00a0 \u00a06403712 \u00a0 \u00a0 \u00a0 27690 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 6376022 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 1% \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \/var<br \/>\n\/dev\/sda6 \u00a0 \u00a0 \u00a0512512 \u00a0 \u00a0 \u00a0 \u00a0 \u00a04333 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 508179 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a01% \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \/tmp<\/p>\n<p>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<\/p>\n<p><strong>4th) Can two files have the same inode number?<\/strong><\/p>\n<p>Ans) If files are present on two different partitions than only files can have same inode number else on same partiton two files with the same inode number is not possible.<br \/>\n<strong>5th) How to check how many inode are free on the server?<\/strong><br \/>\nAns:) We can use the following command to check the free and used inodes on the server.<\/p>\n<blockquote><p><strong>df -i<\/strong><\/p><\/blockquote>\n<p>We will update more question in future for inodes issue<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"mh-excerpt\"><p>Now we have started the Linux Sytem Admin questions on daily basis, so that you can check the questions with the answer daily at least <a class=\"mh-excerpt-more\" href=\"https:\/\/www.ktchost.com\/blog\/inode-related-questions\/\" title=\"inode related question\">[&#8230;]<\/a><\/p>\n<\/div>","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-2983","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/www.ktchost.com\/blog\/wp-json\/wp\/v2\/posts\/2983"}],"collection":[{"href":"https:\/\/www.ktchost.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ktchost.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ktchost.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ktchost.com\/blog\/wp-json\/wp\/v2\/comments?post=2983"}],"version-history":[{"count":3,"href":"https:\/\/www.ktchost.com\/blog\/wp-json\/wp\/v2\/posts\/2983\/revisions"}],"predecessor-version":[{"id":3389,"href":"https:\/\/www.ktchost.com\/blog\/wp-json\/wp\/v2\/posts\/2983\/revisions\/3389"}],"wp:attachment":[{"href":"https:\/\/www.ktchost.com\/blog\/wp-json\/wp\/v2\/media?parent=2983"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ktchost.com\/blog\/wp-json\/wp\/v2\/categories?post=2983"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ktchost.com\/blog\/wp-json\/wp\/v2\/tags?post=2983"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}