ext3 (Third Extended File System)
ext3 is a journaling file system for Linux, introduced as an extension of ext2. It provides enhanced reliability and recovery features while maintaining backward compatibility with ext2. Here's a detailed look at the ext3 file system and its features:
Structure of the ext3 File System
1. Boot Sector:
The boot sector contains metadata about the file system, including:
Inode Count:Total number of inodes in the file system.
Block Count:Total number of blocks in the file system.
Reserved Block Count:Number of blocks reserved for the root user.
Free Block Count:Number of free blocks available.
Free Inode Count:Number of free inodes available.
First Data Block:Block number of the first data block.
Block Size:Size of each block (commonly 1024, 2048, or 4096 bytes).
Journal Information:Metadata related to the journaling feature.
2. Inode Structure:
Each file or directory in ext3 is represented by an inode, which contains:
File Type and Permissions:
Indicates if it's a file, directory, or special type.
File Size:
Size of the file in bytes.
Timestamps:
Tracks file creation, modification, and access times.
Pointers to Data Blocks:
Direct and indirect pointers to the blocks storing file content.
3. Directory Structure:
Directories are implemented as files containing a list of directory entries. Each entry includes:
Inode Number:
Points to the inode representing the file or subdirectory.
Entry Length:
Length of the directory entry.
File Name Length:
Length of the file name.
File Name:
The actual name of the file or subdirectory.
Features of ext3
Journaling:
Provides three journaling modes: Writeback, Ordered, and Journal.
Helps ensure file system consistency after crashes.
Backward Compatibility:
Fully compatible with ext2; ext2 file systems can be converted to ext3 without data loss.
Improved Reliability:
Prevents corruption by journaling metadata and optionally file data.
Large File and Volume Support:
Supports volumes up to 32 TB and files up to 2 TB (with appropriate block sizes).
Journaling Modes
Writeback:
Only metadata is journaled, providing the highest performance but lower reliability.
Ordered (default):
Metadata is journaled, and file data is written to disk before metadata updates.
Journal:
Both metadata and file data are journaled, offering maximum reliability.
Tools and Commands for ext3
fsck.ext3:Checks and repairs ext3 file systems.
mkfs.ext3:Creates an ext3 file system.
tune2fs:Adjusts tunable file system parameters, such as enabling or disabling journaling.
mount:Mounts the ext3 file system, with options to specify journaling modes.
Example
ext3 brought significant improvements in reliability and recovery while maintaining the simplicity of ext2.