In Linux Everything Is a File
In Linux files inside a file
system(be it ext2,ext3 or ext4) are not really accessed by their name. Names
are helpful to humans but, the file system recognizes a file not by its name
but by a number. That number through which the operating system reaches the
location and other attributes of that file is called as an INODE number.
You store your information in a file, and
the operating system stores the information about a file in an inode(sometimes
called as an inode number).
Whenever a user or a program needs
access to a file, the operating system first searches for the exact and unique
inode (inode number), in a table called as an inode table.
Size
of each inode entry is 128 bytes
Inode number also called as index
number , it consists following attributes
- Inode number
- Access Control List (ACL)
- Extended attribute
- Direct/indirect disk blocks
- Number of blocks
- File access, change and modification time
- File deletion time
- File generation number
- File size
- File type
- Group
- Number of links
- Owner
- Permissions
- Status flags
Structure of an inode
Inode
structure of a directory consists of a name to inode mapping of files and
directories in that directory.
Lets
understand why this happens with an example. Imagine am in the directory
/sandbox/comp on my system.
|
Now lets note down
inode numbers of .(dot) and ..(dot dot).
.(dot) =655899
..(dot dot) =655892
Now lets do the
directory listing of /sandbox/ directory and see the inodes there:
No comments:
Post a Comment