Lesson 1: The Architect (Disks & Mounts)
A server's storage is not just "one big hard drive." It's a collection of partitions, filesystems, and mount points — all carefully organized like the floors and rooms of a building.
The Linux Filesystem Hierarchy
Everything in Linux starts at / (root). Unlike Windows (C:, D:), Linux mounts all disks into a single unified tree:
/
├── /home → User files
├── /var → Variable data (logs, databases)
├── /etc → Configuration files
├── /tmp → Temporary files (cleared on reboot)
├── /opt → Optional/third-party software
├── /mnt → Temporary mount point
└── /dev → Device files (your disks live here)
Block Devices: lsblk
lsblk lists all storage devices and their partitions:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 50G 0 disk
├─sda1 8:1 0 49G 0 part /
└─sda2 8:2 0 1G 0 part [SWAP]
sdb 8:16 0 100G 0 disk
└─sdb1 8:17 0 100G 0 part /data
sda— First disk.sda1— First partition on the first disk.MOUNTPOINT— Where it's accessible in the filesystem.
Mounting & Unmounting
Mounting = connecting a disk partition to a directory.
mount /dev/sdb1 /mnt/data # Make the disk accessible at /mnt/data
umount /mnt/data # Disconnect it safely
The /etc/fstab File
This file tells Linux which disks to automatically mount at boot. Each line specifies:
device mount_point filesystem options dump pass
/dev/sda1 / ext4 defaults 0 1
/dev/sdb1 /data ext4 defaults 0 2
If you add a new disk and want it to persist across reboots, you must add it to /etc/fstab.
Mission Objective
Survey the storage architecture:
- Map the terrain: Run
lsblkto see all disks and partitions. - Check connections: Run
mount | head -10to see what's currently mounted. - Read the blueprint: Run
cat /etc/fstabto see the permanent mount configuration.
Real-World Note
In cloud environments (AWS EBS, GCP Persistent Disks), you frequently attach and mount new volumes. Forgetting to update /etc/fstab means your data volume won't reconnect after a reboot!