Systemd-boot and Grub together?

tested installing eos-nova with systemd-boot alongside
an existing eos-nova with grub
it works, but to me it was a test only, no intention for productive use

I think it would be cool to let us all know more about the specifics.

VM, UEFI or EFi and so forth… you know the drill… :v:

But is that a dualboot, one with Grub and a second one with systemd-boot?

I think what OP had in mind was to have just one system with both Grub and systemd-boot.

1 Like

Me either. :lying_face:

Yes, and preferably systemd-boot that can boot snapshots as Grub does

Not as Grub does (or rather grub-btrfs).

However you could boot into a snapshot from systemd-boot menu by editing the entry and using subvolid for the snapshot you want boot into.

I guess you would need to keep note of the ID:s yourself to know which one is which.

If this is a good way or a “recommendable” way to restore a system, I couldn’t tell. Perhaps more experienced systemd-boot users could answer that.

1 Like

If this is possible then I can say job is done!
How to do that?
After adding the entry or entries would I need to do anything else or just boot to the snapshot as usual?

I can’t really answer your questions.
I was just pointing out the possibility.

Perhaps @dalto can come up with some idea to generate loader entries for snapshots, if they are found in the system, for them to be added to the boot menu :thinking:

1 Like

:crossed_fingers:
Just thinking, if it can be done perhaps a hook can help automatically add another additional entry to systemd-boot after a snapshot is created.

1 Like

I don’t think this is so simple…

You would need to make the snapshots writable because I don’t think there is something like grub-btrfs-overlayfs for systemd-boot yet.

1 Like

I haven’t been using BTRFS for quite a while so most probably I could be wrong about this but aren’t snapshots created rw by default?

A snapshot is a subvolume like any other, with given initial content. By default, snapshots are created read-write. File modifications in a snapshot do not affect the files in the original subvolume.

https://btrfs.readthedocs.io/en/latest/btrfs-subvolume.html

Perhaps this is something that snapper does by default?

1 Like

Right! That was kind of my suspicion, that this might be a snapper way of taking snapshots.
Thanks for posting and clarifying it!

1 Like

A few points of clarification

  • Adding snapshots to the systemd-boot menu is possible with some simple scripting, it just wouldn’t solve the problem
  • Booting off of read/write snapshots is a terrible idea, you should only boot off of read-only snapshots. We have had to help fix so many many systems that were in a bizarre state due to Timeshift’s read/write snapshots. That was one of the reasons Btrfs-Assistant was created in the first place.
  • It would be no problem to boot a snapper read-only snapshot into an overlay from systemd-boot

That being said, none of those things are the primary issue. The primary issue with snapshot booting under systemd-boot is that the kernel is outside the snapshots and Arch only keeps on kernel version around. This means that booting into a snapshot that has a different kernel then is currently installed will fail.

I did design a solution to this problem but it was a major effort to implement it cleanly and test it. I decided that ultimately, I would prefer to spend that time doing other things. This is especially true since:

  • If you want to snapshot boot you can use grub - We even recommend this in our installer
  • I don’t have any interest in booting off snapshots - I have never heard of a problem that this solves that wasn’t more cleanly solved a different way
6 Likes

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