Pcornel
Linux · LVM

LVM Snapshots

Cheat sheet · https://pcornel.dk/topic.php?topic=2766

Back to the Topic

Answer

An LVM snapshot is a point-in-time copy of an LV using copy-on-write space in the VG, useful for consistent backups or before risky changes.

Remember

Snapshots need free VG space and become invalid when full — size them for the change rate and remove them soon. They slow writes to the origin. They are not a backup by themselves.

First checks

  • pvs — physical volumes
  • vgs — volume groups and free space
  • lvs -a -o +devices — logical volumes and their devices
  • lsblk — stack view

Commands

lvs

Verify in this order

snapshot created → origin writes copy old blocks into the snapshot → snapshot stays consistent until full → merged or removed

Where it usually breaks

First mismatch in hardware/block device → kernel driver/mapper/RAID/LVM → filesystem → mount namespace/options → path permissions/MAC → consumer I/O; preserve identity/native diagnostic/pre-state before mutation.

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=2766

Confirmation

Confirm action

Continue?