Interview Prep/Linux/Disk space, inodes and filesystems

An LVM snapshot used for backups suddenly shows `Invalid` and the backup failed.

IntermediateTroubleshootingDisk space, inodes and filesystems
Answer

Likely causes → The snapshot's copy-on-write space filled because the origin changed more than expected.

Diagnose →

sudo lvs -o lv_name,origin,data_percent,lv_attr
dmesg | grep -i snapshot

Fix → Remove it (lvremove) and create a bigger one (-L sized to the change rate during the backup), or enable autoextend: snapshot_autoextend_threshold = 70 and snapshot_autoextend_percent = 20 in /etc/lvm/lvm.conf.

Prevent → Keep snapshots short-lived and monitor data_percent.

All Linux questions Roadmap: Linux

More on Disk space, inodes and filesystems