Linux Labs

Storage / Stage 7 of 11

LVM snapshots and rollback

Not running Starting usually ~20 s
Leave the lesson

Step 6 of 7 · lab · 25 minmedium

Return a volume to a consistent snapshot

A training update damaged the data on a volume, and an LVM snapshot was taken just before it. Roll the volume back to the snapshot and put it back in service.

Situation

This machine has a volume group lab_vg. The data volume is mounted at /mnt/lvm-data, the lab-writer service works with it, and next to it sits the keep volume with other data. After a training update, /mnt/lvm-data/settings.conf says mode=broken and a new file after.txt appeared. A classic snapshot /dev/lab_vg/checkpoint was taken before the update. Everything that changed on data after the snapshot is to be discarded.

Task

Roll the data volume back to the snapshot and put it back in service:

  1. /mnt/lvm-data/settings.conf says mode=stable again, after.txt is gone, and the rest of the data (data/accounts.csv, owners and modes) is as it was before the update;
  2. the original data volume is mounted read-write at /mnt/lvm-data: the same logical volume and the same filesystem, 128 MiB in size;
  3. no separate checkpoint snapshot and no unfinished merge remain;
  4. the lab-writer service is running again, now on the restored volume;
  5. the keep volume, the volume group, /etc/fstab and other mounts are untouched.

Constraints

  • Leave keep alone: don't mount it or change it.
  • Don't create new volumes or filesystems, and don't edit /etc/fstab.

The tools you need are already installed. There's no internet on this machine.

Lab · on your own

No commands are given in this lab: type them in the terminal yourself. Goals are checked on the machine after every command.

Goals

0 of 5
  • settings.conf says mode=stable, after.txt is gone, other data is as before the update — not done yet
  • The original data volume (same UUIDs, 128 MiB) is mounted read-write at /mnt/lvm-data — not done yet
  • No separate checkpoint snapshot or unfinished merge remains — not done yet
  • The lab-writer service is running again, on the restored volume — not done yet
  • The keep volume, the volume group, fstab and other mounts are untouched — not done yet
Ctrl+Enter
Starts the machine node1 · Ubuntu 24.04

The machine is starting

Hints

0 of 3

Lab goals

0 of 5
  • settings.conf says mode=stable, after.txt is gone, other data is as before the update — not done yet
  • The original data volume (same UUIDs, 128 MiB) is mounted read-write at /mnt/lvm-data — not done yet
  • No separate checkpoint snapshot or unfinished merge remains — not done yet
  • The lab-writer service is running again, on the restored volume — not done yet
  • The keep volume, the volume group, fstab and other mounts are untouched — not done yet
node1 Ubuntu 24.04

Lab goals

0 of 5
  • settings.conf says mode=stable, after.txt is gone, other data is as before the update — not done yet
  • The original data volume (same UUIDs, 128 MiB) is mounted read-write at /mnt/lvm-data — not done yet
  • No separate checkpoint snapshot or unfinished merge remains — not done yet
  • The lab-writer service is running again, on the restored volume — not done yet
  • The keep volume, the volume group, fstab and other mounts are untouched — not done yet
Loading…