btrfs+dracut+UEFI+systemd-boot and restoring root snapshot

I’ve tried to read/digest every post on the subject matter, and restoring a BTRFS snapshot seems to boil down to this advice:

When using systemd-boot, after restoring a / snapshot, you need to arch-chroot in and run reinstall-kernels. Make sure your EFI partition is mounted before running the command. You may need to also do some manual cleanup in /efi.

The above advice seems to work, but I’d like to streamline the process and make it more definitive (e.g., no arch-chroot, no reinstall-kernels, and no vague manual cleanup). To that end, per the “Snapshots and /boot partition” of System backup - ArchWiki, I’m creating a copy of /efi in /.efi-back/ after each kernel updates so the root snapshot has a copy of /efi to (potentially) easily restore. BUT, to restore /efi, apparently, I have to boot a live installer, do a couple of mounts, and then run the rsync to restore /efi – so easier and well-defined, but…

Is there no way to restore /efi at the recovery prompt (or avoid it)? For example:

  • is there a practical way to (force) mount the /efi partition so I can simply restore it with an rsync?
  • is there a practical way to store a handful of kernels in /efi so I can just determine which kernel will boot and reboot?

To make the cleanup step “less vague”, it is just about cleaning old images from /efi/<machineid> and old entries from /efi/loader/entries

Couldn’t you restore it before rebooting when you restore the snapshot?

Thanks. Perfect. Now that it said, it seems pretty obvious.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.