A file system is a set of files, directories, and other structures.
The file system layout describes the physical structure of data organization on a storage device, such as a hard disk or SSD.
- It determines how the operating system stores, retrieves, and manages data efficiently.
Components of File System Layout
1.) Master Boot Record (MBR)
The MBR is the first sector of a storage device and contains essential information about the disk’s partitions and the bootloader. It is crucial for the system to start and locate operating systems.
Key Characteristics:
- Located at the first sector (sector 0) of the disk.
- Size is typically 512 bytes.
- Contains:
- Partition table.
- Bootloader code (to load the operating system).
- A disk signature and end-of-sector marker.
2.) Partition Table
The partition table resides within the MBR and contains information about the logical partitions on the disk, including their starting locations, sizes, and types.
3.) Boot Block
The boot block is the area on a disk where the operating system’s bootloader or kernel resides. It is used to load the initial stages of the operating system.
Key Characteristics:
- Found at the beginning of the partition.
- Contains the bootloader program for the specific file system.
- Used only if the partition is bootable.
4.) Superblock
The superblock contains metadata about the file system on a specific partition. It provides critical information required to manage and access files.
Key Characteristics:
- Contains:
- File system type (e.g., ext4, NTFS).
- Total size of the file system.
- Number of blocks, free blocks, and used blocks.
- Block size and inode table location.
- The OS uses the superblock to understand the layout of the file system.