|
The ext2 or second extended file system was the standard filesystem used on
the Linux operating system for a number of years and remains in wide use. It was initially designed by Rémy Card based on concepts from the extended file system. It is quite fast, enough so that it is used as the standard against which to measure many benchmarks. Its main drawback is that it is not a journaling file system. Its successor, ext3, has a journal and is compatible with ext2.
Structure
Block groups
Each block contains:
- Super block
- FS descriptors
- Block bitmap
- Inode bitmap
- Inode table
- Data blocks
Super block
A super block contains:
- Number of inodes
- Number of blocks
- Reserved block count
- First data block number
- Block size
- Fragment size
- Number of blocks per group
- Number of fragments per group
- Number of inodes per group
- Mount time
- Write time
- Mount count
- Maximal mount count
- Magic signature
- File system state: valid (unmounted cleanly) or error
- Error detection behavior
- Minor revision level
- Time the file system was last checked
- Maximum time between checks
- Detault user & group ID for reserved blocks
Inodes
An inode contains:
- File mode: read, write, execute permissions
- Owner ID
- Size of file in bytes
- Last access time (atime)
- Creation time (ctime)
- Modification time (mtime)
- Deletion time (dtime)
- Group ID
- Links count
- Block count
- Flags
- Blocks used
- Direct blocks
- Indirect blocks
- Double indirect blocks
Directories
A block contained a list of inode numbers and directory entry names.
Files
Just a group of blocks.
Block numbers stored in the file's inode.
No magic number or the like: just raw blocks of data.
Links
Hard & soft links
Special files
Created with mknod: block & character special files
FIFOs
See also
External links
|