Systemd-boot and syncing kernels with BTRFS
From what I understand systemd-boot is not able to boot from BTRFS. So if we have to create a separate boot partion outside of BTRFS then how can one manage keeping kernels saved in the boot partion with BTRFS subvolumes?
What solutions have you guys come up with. And No I would prefer not to use grub or Refind
Thanks
About this post
- Posted
- Archived
- Score
- 6 · 100% up
- Kind
- Text
- ID
- lf3wej
7 comments
Pretty sure it only doesn’t support btrfs as a boot partition. I think you’re fine if you have the typical EFI partition scheme and have your vmlinuz image on that /efi partition.
I'll try that.
I use BTRFS on my laptop on top of LUKS. I use a unified kernel image that is signed with sbctl which is booted using systemd-boot.
I'm evaluating BTRFS to use on my main desktop workstation, but I'm happy with the unified kernel image and using sbctl to sign enough to put it on my workstation once I get around to encrypting the boot drive.
You can also use a bind mount to mount
/bootto be at the path/efi/bootand use a pacman hook in order to ensure kernels are backed up with snapshots.I guess I could bite the bullet and stick Ext4 and timeshift
Are you planing on using UEFI? Because if so, that requires an EFI system partition (ESP) regardless of bootloader choice. A boot partition is different than an ESP but for systemd-boot it is common to mount the ESP to /boot where the bootloader configuration and kernel files both reside in the ESP. The ESP must be FAT formatted.
GRUB does it differently. The configuration files and system kernel are stored in /boot which can be formatted to whatever GRUB recongizes, and the ESP is mounted to /boot/efi. GRUB then sets up the appropriate files in the ESP when the grub-mkconfig script is run.
Systemd-boot can be setup to behave similarly to this if you're willing to write a some rules, scripts, or a systemd service. You can mount the ESP where ever, it doesn't have to be to /boot, just tell systemd-boot when you set it up. That way you can have /boot as whatever file system you want. Then you just have to choose some method of making sure the appropriate files make it into the ESP so they can be loaded at boot.
Is that really preferable to using grub? Why is that not an option for you?
Here is the link from the bottom of the wiki page - it looks like bind mounts is the way to go with
systemd-boot. It can't boot frombtrfs, but bind mounts for every bootable snapshot work quite well for me.Multi Boot Linux With One Boot Partition | John Ramsden
refindis the way to go if you need to fit more than a few kernels on ESP, but there is also a way to do that withsystemd-bootwith systemd-boot - Installation using XBOOTLDR - ArchWiki. I had an issue doing this when extended boot partition was on NVME -systemd-bootonly saw extended boot entries if I were to enter bios and exit it without saving changes (go figure). Your mileage may vary - give it a shot.