10.8 i node



The EXT 3 (EXT 2) file system allocates unique numbers called inode numbers to files and directories for management.

When creating a file system, a location called inode area is secured. In the inode area, information such as the location where the file is on the disk and the access authority is held.

The number of files that can be created in the file system depends on the size of the inode area. If many files are created and the inode area runs out, even if there is a free space in which data can be written to that file system, new files can not be created.


Figure10-3
Figure 13-3: EXT3 File System (i node Area)


10.8.1 Check the i node information

To check the usage status of the inode area of the EXT3 file system, use the df command with the -i option. As the inode information, the total number, the number used, the remaining number, and the usage (%) are displayed.

Format

df -i


It displays file system information.

Options

-i
Display inode information


Practice : Display inode information


# df -i ↵ Display inode information
Filesystem Inodes IUsed IFree IUse% Mount on # Display inode information
/dev/sda1 1179648 150788 1028860 13% / Check inode number
tmpfs 129415 1 129414 1% /dev/shm
/dev/hdc 0 0 0 - /media/cdrom


Since the displayed device /dev/sda1 is an EXT3 file system which is a Linux file system, inode information is displayed. On the other hand, DVD-ROM drive does not have inode information because it is not an EXT3 file system (ISO 9660 standard file system).

10.8.2 Check the i node number

To check the inode number allocated to the file, execute the ls command with the -i option.

Practice : Check inode number


$ ls -il /bin | sort ↵ Display inode number
         :
         :
         :
750812 -rwxr-xr-x 1 root root 18568 Feb 22 2005 setserial 750812 is the inode number
750813 -rwxr-xr-x 1 root root 57488 May 3 2007 cpio
750814 -rwxr-xr-x 3 root root 56080 Jul 15 2007 gunzip
750814 -rwxr-xr-x 3 root root 56080 Jul 15 2007 gzip
750814 -rwxr-xr-x 3 root root 56080 Jul 15 2007 zcat
750815 -rwxr-xr-x 1 root root 6420 Nov 26 22:52 dmesg
750816 -rwxr-xr-x 1 root root 31892 Nov 18 02:55 setfont
         :
         :
         :


In this example, the inode number is displayed at the beginning of the line (first), and the same inode number is allocated to the gunzip command, gzip command, and zcat command. Even though file names are separate, files with the same i-node number are a same file with mechanism of hard link. The number 3 in the third item displayed is the number of links, which means that one file entity is linked with three file names.



Previous Next