100%
GRIMOIRE
GrimoireDindon CorpusSynthesis VolumesThe Foundation of Iron
FRENAR
RATIO
THE FOUNDATION OF IRON · COURSE MATERIAL · WEEK 7
◆◆◆
STORAGE AND
FILESYSTEMS
Week 7 of 26 · Block 4 — Filesystems
10h theory · 25h practice
◆ WEEKLY LEARNING OBJECTIVES

1. Understand the physical structure of a disk (sectors, partitions)
2. Distinguish the main filesystems (ext4, NTFS, ZFS) and their use cases
3. Understand RAID principles and its common levels
4. Create partitions and format a disk
5. Create, restore and use a complete disk image

◆◆◆
NOTE FOR THE INSTRUCTOR

This week closes the foundational block before entering the large OS block (Weeks 8-16). Exercise 2 (data recovery) has strong pedagogical value to ground the concept of backup before the intensive operating systems practice ahead.

Amine RAITI · Infrastructure Architect & SRE
Public document · CC BY-NC-SA 4.0 · AI Powered by Amine
Opération Dindon
RATIO
COURSE OUTLINE · 10H
THEORY GUIDING THREAD
7.1 · Physical structure of a disk2h
— Sectors (smallest physical unit, historically 512 bytes, often 4096 today — link with the byte concept from Week 2)
— Partition table (historical MBR vs modern GPT) — role and limitations of each
— Difference between mechanical disks (HDD) and flash-memory disks (SSD) — implications for performance and reliability
7.2 · Filesystems3h
— A filesystem's role: organising data across physical sectors, managing metadata (name, permissions, dates)
— ext4 (Linux standard), NTFS (Windows standard), ZFS (advanced, data integrity, snapshots) — summary comparison
— Concept of journaling for resilience against power loss
7.3 · RAID principles3h
— RAID's goal: performance and/or redundancy by combining several disks
— RAID 0 (striping, performance, no redundancy), RAID 1 (mirroring, simple redundancy), RAID 5/6 (distributed parity, performance/redundancy/cost trade-off)
— Point of attention: RAID protects against disk failure, not against human error or logical corruption — it is not a backup
7.4 · Disk imaging and backup2h
— Difference between copying files and a full disk image (sector by sector, including the partition structure)
— Disk imaging use cases: machine migration, restoring after a total failure, archiving
EXAMPLE TO DEVELOP ON THE BOARD

A RAID 1 (mirror) across two 1 TB disks provides 1 TB of usable space (not 2 TB) because each disk is an exact copy of the other — the cost of redundancy is half of the total raw capacity.

RATIO
EXERCISE 1 · CREATING PARTITIONS AND FORMATTING · 8H

Equipment: test machine or virtual machine with a dedicated blank disk (at least 20 GB), command-line tools (fdisk/parted on Linux, diskpart on Windows if available).

(1h30) Identifying the target disk with the appropriate commands (lsblk or equivalent), confirming it is indeed the test disk and not the system disk.
(2h) Creating a GPT partition table and 3 partitions of different sizes (e.g. 5 GB, 5 GB, remaining space).
(2h) Formatting each partition with a different filesystem (ext4 for the first, NTFS for the second if a tool is available, ext4 for the third with a different block size).
(1h30) Mounting the partitions, writing test files, checking used and available space.
(1h) Deleting and recreating a partition to validate understanding of the full process.
SOLUTION — EXERCISE 1

Critical safety check before any operation: ask each pair to explicitly confirm, before any destructive command, the exact identifier of the test disk (e.g. /dev/sdb, not /dev/sda which could potentially hold the system). This is the most dangerous possible mistake at this stage of training.

Expected result after formatting: each partition should appear mounted with the requested filesystem (verifiable with the mount command or lsblk -f), and the total space across the 3 partitions should match the disk size minus a small overhead from each filesystem's metadata.

RATIO
EXERCISE 2 · DISK IMAGING, RESTORE AND RECOVERY · 17H

Equipment: the test disk from Exercise 1 (with data already written), external storage for the image, dd and/or Clonezilla tools, bootable Clonezilla media if used.

(3h) Creating a full disk image of the test disk using the dd command (or Clonezilla), to an image file on external storage, measuring the time required and the resulting file size.
(2h) Verifying the image's integrity (checksum, or mounting the image to check its contents).
(2h) Deliberately and controllably wiping the test disk's data (full format) to simulate total loss.
(3h) Fully restoring the disk from the previously created image, verifying that all data and the partition structure are identical to the original state.
(4h) Data recovery exercise on a partially corrupted disk (a scenario with a deliberately damaged filesystem) using basic recovery tools (testdisk, photorec or equivalent).
(3h) Writing a short procedure documenting the backup/restore steps performed, to keep as a personal reference.
SOLUTION — EXERCISE 2

Expected dd command (example): dd if=/dev/sdb of=/mnt/external/disk_image.img bs=4M status=progress — the bs=4M option speeds up the transfer compared to the default block size, and status=progress allows tracking the operation's progress, an important point to highlight for large images.

Restore validation: after restoring, compare the checksum (md5sum or sha256sum) of the restored disk with that of the source image — an exact match validates a bit-for-bit restoration.

Central teaching point of this week: stress that a disk image is only useful if it has been tested through a restore at least once — a backup that has never been restored is not a reliable backup, it is merely an assumption.

◆ SUMMARY SHEET — WEEK 7 SELF-ASSESSMENT
1. I can explain a disk's physical structure (sectors, partitions, GPT table).
2. I can compare ext4, NTFS and ZFS on their respective use cases.
3. I can explain RAID levels 0, 1, 5 and their trade-offs.
4. I know that RAID is not a backup.
5. I can safely create partitions and format a disk.
6. I can create a complete disk image using dd or an equivalent tool.
7. I can restore a disk from an image and validate its integrity.
8. I can use a basic data recovery tool on a corrupted disk.