|
|
|
|
|
Ext2The 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 Rmy 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. History The early development of the Linux kernel was made as a cross-development under the Minix operating system. Naturally, it was the most obvious decision to implement the Minix file system as Linux's first file system. Minix file system was pretty free of bugs, but had some limitations like being able to handle only 64 megabytes of data, due to its 16-bit address space and accepted file name with no more than 14 characters. Because of these limitations, work began on the implementation of new file systems for the Linux operating system. To ease the addition of new filesystems into the Linux kernel, a virtual file system was developed, called VFS. After its integration to the kernel, the extended file system (ext) was released as the first file system designed for Linux in April 1992 and it was included in Linux version 0.96c. The ext file system solved the two major problems in the Minix file system (maximum partition size and file name length limitation to 14 characters), now allowing 2 gigabytes of data and a 255 characters filename. But it still had problems: there was no support for separate access, inode modification and data modification timestamps. As a solution for these problems, two new filesystems were developed in January 1993: the Xia file system and the second extended file system (ext2). The ext2 file system was based on the extended file system with many reorganizations and many improvements and was designed with evolution in mind, containing space for future developments. The ext2 file system has a maximum data size of 4 terabytes, maximum filename length of 255 characters, and has variable length block size. 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
- Default 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)
- Change time of inode (ctime)
- Modification time of file (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
|
 |
| |
|
|