Managing LVM Snapshots on Arch Linux

Subscribe to LearnLinuxTV

LVM Commands

Process to resize a volume

See current partition sizes
 df -h
Verify that there is enough space
Extend the logical volume (adjust your logical volume name if different)
 lvextend -L +20g -n /dev/mapper/volgroup0-lv_home
Resize the filesystem after enlarging it
 resize2fs /dev/mapper/volgroup0-lv_home
Check the partition size again
 df -h

Creating a snapshot

Verify how much space you have left
Create the snapshot
 lvcreate -L 5GB -s -n root_snapshot_20190526 /dev/mapper/volgroup0-lv_root
List current snapshots
Restoring a snapshot
Snapshot restore command
 lvconvert --merge /dev/volgroup0/root_snapshot_20190526
Reboot the machine to finalize the changes
Notice that the test file is gone
 ls /home/<user>

Making a Snapshot Final

To make a snapshot final, remove it
 lveremove /dev/volgroup0/root_snapshot_20190526