Linux Labs

Storage / Stage 7 of 11

LVM snapshots and rollback

Not running Starting usually ~20 s
Leave the lesson

Step 4 of 7 · on a machine · 5 min

Rolling back the whole volume

A merge returns the origin to the snapshot's state in full. Here is how to run it so it does not get stuck.

A snapshot merge rewrites the origin with blocks from the snapshot: the volume returns to the moment the snapshot was taken, with every file. The snapshot is used up and disappears.

The merge starts at once only if nothing has the origin open. Otherwise lvconvert prints Delaying merge since origin is open and postpones the work until the volume's next activation, while lvs -a shows the snapshot in square brackets, [checkpoint]. So the order is: leave the volume's directory, unmount the origin, start the merge and mount the volume back.

lvconvert prints the merge progress and waits for the end, which takes seconds on the training volume. Afterwards checkpoint is gone from lvs.

Exercise · do it

Return the volume to the snapshot

You may discard every change made after the snapshot. Leave /mnt/lvm-data, unmount the volume, merge the checkpoint snapshot into it and mount the volume back at /mnt/lvm-data. Leave the keep volume alone.

Sign in and start The machine is available after signing in

Goals · 0 of 2

  • Merge the checkpoint snapshot into the volume not done yet
  • Mount the volume back and check the files not done yet

Step goals

0 of 2
  • Merge the checkpoint snapshot into the volume — not done yet
  • Mount the volume back and check the files — not done yet
Ubuntu 24.04

Step goals

0 of 2
  • Merge the checkpoint snapshot into the volume — not done yet
  • Mount the volume back and check the files — not done yet
Loading…