rollback

2 HOWTOs · all tags

  1. Boot into Btrfs snapshots from GRUB on Fedora (grub-btrfs + snapper)

    Add a 'Fedora Linux snapshots' submenu to the GRUB boot screen so you can boot directly into a snapper snapshot when the system won't start after a bad update — the recovery case plain snapper can't cover because it needs a working system to log into. grub-btrfs is not in Fedora's repos, so it comes from the kylegospo COPR; a grub-btrfs watcher unit regenerates the menu whenever snapper adds/removes a snapshot. Three gotchas covered: the packaged grub-btrfs.path unit binds to a .snapshots.mount unit that exists only when /.snapshots is separately mounted, so a nested /.snapshots needs a local systemd override; making a rollback permanent cannot use 'snapper rollback', which is silently ignored on a Fedora install that pins subvol=root — the subvolume swap is the procedure that works; and menu generation fails silently, with no output whatsoever, when run from a directory root cannot enter (a FUSE mount such as an rclone-mounted ~/Dropbox), leaving grub2-probe to abort with 'cannot restore the original directory'. Includes the important separate-/boot caveat (kernel/initramfs live on an ext4 partition and are NOT snapshotted) and read-only snapshot boot. Also covers Fedora's menu_auto_hide mechanism: hide the boot menu on healthy boots while it reappears on its own after a failed one, so the snapshot entries are there exactly when they are needed — plus how to summon it on demand for a deliberate rollback. Optional follow-on to the snapper setup.

  2. Snapper restore points on Fedora (Btrfs) with auto snapshots before every dnf transaction

    Install and configure snapper on a Fedora Btrfs-on-LUKS system to create filesystem restore points: a root config with hourly timeline snapshots and auto-cleanup, plus automatic pre/post snapshots around every dnf transaction. Fedora 44 uses dnf5, which has no snapper plugin, so the dnf hook is wired up with the libdnf5 'actions' plugin calling a small wrapper script that labels snapshots by operation (dnf install / upgrade / remove). Covers what a root config does and does not capture on Fedora's multi-subvolume layout, why /.snapshots belongs in a top-level subvolume rather than nested inside root, and — the part most guides get wrong — why 'snapper rollback' cannot work on a Fedora install that pins subvol=root in fstab and on the kernel command line, with the subvolume-swap procedure that does.