LPIC-2 201-450 study materials
LPIC-2 201-450 study resources

LPIC-2 201-450: Advanced Storage Device Administration

LPIC-2 201-450 · Work through your exam, one topic at a time.

All guide sections

Advanced Storage Device Administration

Advanced Storage Device Administration covers software RAID with mdadm, LVM's physical-volume/volume-group/logical-volume model, and the device-mapper layer beneath both.

RAID and LVM mechanics

  • mdadm --create /dev/md0 --level=5 --raid-devices=3 /dev/sdb1 /dev/sdc1 /dev/sdd1 builds a redundant array. /proc/mdstat shows status; mdadm --detail /dev/md0 gives detail.
  • Persist assembly with mdadm --detail --scan >> /etc/mdadm.conf and rebuild initramfs so the array assembles before root mounts.
  • Replace a failed disk with --fail, --remove, then --add; grow with --grow --raid-devices=4 plus a filesystem resize.
  • LVM stack: pvcreate, vgcreate, lvcreate -L 20G -n data vg. Extend with lvextend -L +5G /dev/vg/data or -l +100%FREE, then resize the filesystem.
  • Snapshots: lvcreate -L 2G -s -n snap /dev/vg/data; size for changed blocks, not original data.
  • pvmove migrates extents; vgchange -a y activates volume groups.

Worked example

Create RAID5, put LVM on it, and use all space: mdadm --create /dev/md0 --level=5 --raid-devices=3 /dev/sdb1 /dev/sdc1 /dev/sdd1; pvcreate /dev/md0; vgcreate vg /dev/md0; lvcreate -l 100%FREE -n lv vg; mkfs.ext4 /dev/vg/lv. Reasoning: mdadm supplies redundancy, LVM supplies flexible allocation; keep mdadm.conf and initramfs current so early boot can assemble /dev/md0.

Traps

  • Forgetting initramfs after changing RAID or LVM root storage.
  • Filling a snapshot, which invalidates it.
  • Running lvreduce before shrinking the filesystem.
  • Treating RAID as a backup.