Storage management
Table of contents
- Disks and partitions
- lsblk, fdisk, parted
- Mounting and unmounting
- /etc/fstab: automatic mounting
- Introduction to LVM
- Hands-on exercises
1 - Disks and partitions
Disk naming
| Type | Name | Example |
|---|---|---|
| SATA/SCSI | /dev/sd[a-z] | /dev/sda, /dev/sdb |
| NVMe | /dev/nvme[0-9]n[1-9] | /dev/nvme0n1 |
| Virtual | /dev/vd[a-z] | /dev/vda |
| IDE (old) | /dev/hd[a-z] | /dev/hda |
Partitions
/dev/sda ← Disque entier
├── /dev/sda1 ← Partition 1
├── /dev/sda2 ← Partition 2
└── /dev/sda3 ← Partition 3
Partition tables
| Type | Max partitions | Max size | Usage |
|---|---|---|---|
| MBR | 4 primary (or 3 + extended) | 2 TB | Legacy/BIOS |
| GPT | 128 | 9.4 ZB | Modern/UEFI |
tip
Always use GPT for new systems, unless you have compatibility constraints.
🔝 Back to table of contents
2 - lsblk, fdisk, parted
lsblk - List block devices
# Affichage simple
lsblk
# Avec système de fichiers
lsblk -f
# Avec tailles
lsblk -o NAME,SIZE,TYPE,MOUNTPOINT,FSTYPE
Typical output:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 100G 0 disk
├─sda1 8:1 0 50G 0 part /
├─sda2 8:2 0 48G 0 part /home