<aside>
💡
Summary of Section 15.1: Partitions and Mounting (C191 - Operating Systems for Programmers, zyBooks)
</aside>
Overview
This section explains how disks are partitioned and how file systems are mounted. A disk can be divided into multiple partitions, and different operating systems manage these partitions in distinct ways. Additionally, the process of booting and mounting file systems is discussed.
1. Disk Partitions
- A partition is a division of a disk that may contain a file system.
- Partitions can be:
- Raw (no file system): Used for special purposes, such as:
- UNIX swap space.
- Databases that format data uniquely.
- RAID metadata tracking mirrored blocks.
- Cooked (contains a file system): Stores files in a structured format.
Bootable Partitions
- If a partition contains a bootable operating system, it requires a boot block.
- At boot, the system does not have file-system code loaded, so it relies on a bootstrap loader stored in a sequential block format.
2. Booting and Boot Loaders
- The bootstrap loader is a small program that loads the kernel.
- Systems can be dual-booted, allowing multiple operating systems on one machine.
- A boot loader (e.g., GRUB) enables users to choose which OS to load.
- A boot loader must understand the file system format to load the OS kernel; otherwise, that OS is not bootable.
3. Mounting File Systems
A file system must be mounted before it can be accessed. The mounting process involves: