Contents /
Previous /
Next
I-nodes
Every file has exactly one inode "index node":
ls -i file
Each inode contains the following information:
- type of the file: regular, directory, block special, character
special, etc
- file permissions
- file ownership
- hard-link count
- location of the blocks (in case of regular or directory files)
-
major or minor device number (in case of special files)
- value of the symbolic link (in case of symbolic links)
The locations of the first 10 blocks of a file are directly stored in
the inode.
The rest is stored in indirect blocks whose locations are
stored in the inode.
Links
Purpose: A file is required to be in two different directories at
the same time.
Command to create a (symbolic -s) link:
ln -s destfile linkfile
Symbolic Links:
Only a reference to another file.
When the file is deleted the reference becomes useless.
Hard Links:
Several names for the same file and "hard" links to its I-node.
All hard links must be deleted to remove the file.