Skip to content

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

6 points7 comments
Open on Reddit
About this post
Posted
Archived
Score
6 · 100% up
Kind
Text
ID
lf3wej

Author

72
posts
1.2k
comments
5
media
View profile

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.

10 points

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 /boot to be at the path /efi/boot and use a pacman hook in order to ensure kernels are backed up with snapshots.

4 points

I guess I could bite the bullet and stick Ext4 and timeshift

2 points

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.

6 points

Is that really preferable to using grub? Why is that not an option for you?

1 points

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 from btrfs, but bind mounts for every bootable snapshot work quite well for me.

Multi Boot Linux With One Boot Partition | John Ramsden

refind is 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 with systemd-boot with systemd-boot - Installation using XBOOTLDR - ArchWiki. I had an issue doing this when extended boot partition was on NVME - systemd-boot only 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.

2 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.