Venom1991 / refind-btrfs

Generate rEFInd manual boot stanzas from Btrfs snapshots
GNU General Public License v3.0
139 stars 8 forks source link

Manage boot partition snapshots #55

Open ShayBox opened 2 months ago

ShayBox commented 2 months ago

I have an unencrypted btrfs boot partition and an encrypted btrfs root partition, I have refind-btrfs setup for the root partition, but it doesn't seem to handle snapshots for the boot partition.

Because Archlinux doesn't version and keep multiple kernel images in the boot partition, if I try to boot a root partition snapshot using an old kernel image, it won't boot. I have worked around this by using BTRFS assistant to manage snapshots for my boot partition, but that requires manually swapping the snapshot in the emergency shell if it fails to boot, it would be nice if this could handle that automatically.

I only have a 2G boot partition which is enough for 1 snapshot, so maybe a way to limit how many snapshots would be useful, but I might try to expand that if I'm able to without having to re-install.

Venom1991 commented 2 months ago

Hi,

there's no support for multiple subvolumes, i.e. only the subvolume mounted as / is taken into consideration. This is also indirectly explained in the description:

In case a separate /boot partition is detected only the fields relevant to / are modified ("subvol" and/or "subvolid") while the "loader" and "initrd" fields (the former may also be nested within the "options" field) remain unaffected. It goes without saying that the consequence of having this kind of a setup is being unable to mitigate a problematic kernel upgrade by simply booting into a snapshot.

This feature would add considerable complexity but I could add it to the list of enhancements. In your case, I would recommend that you switch to the LTS kernel. That might help, somewhat.