Skip to content

Systemd-boot vs grub

I’m trying to use systemd boot instead of grub, but one thing i have noticed is while you could use /boot/efi as a mount-point for the ESP when using grub, it is recommended (so have i read) to use /boot as a mount point when using systemd-boot. is that true ? and if yes, then how does it make a difference? i’m aware it might be related to the fact all of the kernels images lies in /boot, but i’m not sure how it comes down to that fact when using systemd-boot and not when using grub.

123 points47 comments
Open on Reddit
About this post
Posted
Archived
Score
123 · 98% up
Kind
Text
ID
mxzfox

Author

6
posts
32
comments
2
media
View profile

53 comments

systemd-boot looks in /efi and /boot for kernels, if you have a small ESP partition (like one created by windows) you can supplement it by having a XBOOTLDR partition mounted to /boot for your kernels and stuff. I personally really like how simple systemd-boot is compared to grub, although it is less customizable

69 points

i see. can i use systemd while dual booting with win 10 being preinstalled? i have only used grub so far and it detects the windows bootloader on its own and i’m wondering if systemd is capable of it as well or not. i tend to have separate ESP for linux and windows..

12 points

You can always just copy the Microsoft directory from the Windows ESP into your systemd boot ESP and it'll find it. I did it this way so that I could have Windows and Linux both bootable from systemd boot even though they're on different drives.

9 points

Yes systemd will find it, not sure about using separate ESPs

6 points

+1 to this, I switched to systemd-boot for my most recent install and I really appreciate how simple and functional it is.

10 points

It just does what it's supposed to. No fuss, no fluff. I like it.

1 points

Unrelated but if you dual boot and want to have a bigger UEFI partition, you can follow this article. It is slightly outdated in that Windows 10 only creates 3 partitions now instead of 4, but aside from that it still works. Of course, has to be done upon installation, no way to increase the size post-installation as far as I know.

3 points

The irony of how we’ve come full circle.

GRUB’s popularity came from its simplicity (and the fact that you didn’t need to rebuild anything when making changes like you did with LILO). GRUB slowly moved into being more complex, and now algo requires rebuilding its stuff when making changes. The irony.

2 points

It's so that the kernel is also present on the EFI.

systemd-boot is simple by design, it doesn't include FS code or much input device handling code, it depends on the UEFI to handle a lot of stuff. (otherwise it would take a longer time to boot like GRUB, in order to load all of those features).

17 points
unknown author

Deleted before we saved it.

1 points

Also don't forget the 3rd option https://wiki.archlinux.org/index.php/EFISTUB This is what I use

With efistub you don't need any bootloader your motherboard will boot the kernel directly You will use your motherboards built in bootmenu Some motherboards use the F8 key mine uses the ESC key during boot to select what to boot and you will select your default boot option from within the bios

This is the bash script I use to create my 2 boot entry's

Make sure the p2 and the -p 1 are pointing to the correct partitions

drive="mmcblk0"
bootoptions="mitigations=off nmi_watchdog=0 i915.enable_guc=2 i915.enable_fbc=1 i915.fastboot=1 quiet"
partuuid=$(blkid -o value -s PARTUUID /dev/${drive}p2)

efibootmgr -c -g -d /dev/${drive} -p 1 -L "Linux" -l /vmlinuz-linux -u "root=PARTUUID=${partuuid} rw ${bootoptions} initrd=/intel-ucode.img initrd=/initramfs-linux.img"

efibootmgr -c -g -d /dev/${drive} -p 1 -L "Linux LTS" -l /vmlinuz-linux-lts -u "root=PARTUUID=${partuuid} rw ${bootoptions} initrd=/intel-ucode.img initrd=/initramfs-linux-lts.img"
11 points

All the cool kids have mitigations turned off :)

Yeah efistub is pretty cool, used it on a VM I did lfs in and was surprised at how much faster it was.

6 points

This has two disadvantages to me: one is that entering the boot menu can be tricky (you have a very small window to press the key to enter it, most of the time before the monitor even turned itself on): that is not practical in case of a dual boot, tough if Linux is the only operating system is not a problem. The other one is that in case of problems you don't have an editor to edit the kernel command line, for example to boot in single user mode. In that case you have to use a bootable USB to rescue your system.

1 points

I believe it's possible to use the UEFI shell to boot into Linux in single user mode but I've never had to do it my self or maybe you could create a single user mode boot option before it breaks but I've never had to do that as well the only thing I do is have LTS installed so if I have any problems with the latest kernel I can always quickly boot LTS it's also true that if your always switching operating system that having to press a key during boot can get annoying but if your not always switching then it's a good option

1 points

For others who may not know: you can avoid the "small window" problem by switching the order of the EFI boot entries using efibootmgr if you know you want to boot using a different efi image! You can change the order permanently (efibootmgr -o 1,2,0) or just once (efibootmgr -n 1).

1 points

The difference is that during install of systemd-boot, you can exclude location of ESP if you’ve mounted /boot to ESP. Otherwise you have to specify ESP path during install command.

bootctl install

or

bootctl install —esp-path=/somewhere/else

7 points

correct me i’m wrong but this advantage is also present when using grub? you could do:

grub-install --target=x86_64-efi --bootloader-id=grub_uefi --recheck

instead of:

grub-install —target=x86_64-efi —efi-directory=/boot —bootloader-id=GRUB

the first command automatically installed in /boot/efi for me without having to specify. i did two installs of arch in a vm and the second time i used the /boot as the mountpoint for ESP, but i used the second command instead. so i’m not sure if it would have automatically mounted it on /boot had i used the first command.

3 points

You have more room and control over your /boot, while your ESP might be used or create by another OS. On many Windows systems, they created an ESP that's only 100MB, and that can fill up easily between kernel and initrd images. You generally do not want to put those in your ESP partition because of the small size they frequently are.

FYI, if you use rEFInd, then you don't need either GRUB or systemd-boot, and it will also let you boot multiple kernels, edit parameters, boot Windows/Mac/Other Linux/etc, and can provide you an EFI shell and diagnostic utils. You don't even need a separate /boot partition, or mess with ESP after install, because it can read XFS/ext4/btrfs/etc to discover your kernels.

https://wiki.archlinux.org/index.php/REFInd

4 points

I totally agree, rEFInd is the best thing that's happened to my multi booting laptop. It even handled adding a Windows install after Linux without a fuzz.

3 points

I tried rEFInd once but I couldn't figure out how to theme it and make it pretty, as the default theme is quite ugly

1 points

I remember using rEFInd on an old Mac to boot Linux. Hands down the best ever, would also boot usb bootable without having to find the stupid key to access recovery, it would sinmply show bootable OSs + external bootable drives. I really wish devs were to include this one rather than GRUB2.

PS, last time I commented something like that and I got attacked quite badly by the community, there seems to be some sadistic appeal into outdated broken software such as GRUB

2 points

Installing refind was a nightmare for me. First, it created the images on the USB I was using and then it showed two entries for my install.

1 points

There's an installer for it, but you don't need it. You can copy it to a directory on ESP and use efibootmgr to add a UEFI entry and set it default.

Maybe your USB was just detected as the ESP? Beside that, it doesn't do anything with images, it just provides a menu of what's available and detected. If you get multiple entries, then it's likely that you also installed another bootloader, like GRUB. It would detect both the installed kernel, asked also GRUB in that case. That sounds highly likely considering you also had images on USB.

1 points

would it be able to detect the windows esp if it’s on a separate partition. let’s say my windows esp is on /dev/sda(x) while my linux is on /dev/sda(y). grub has no problem finding it and giving me an option to boot into it, but would refind give me that option?

1 points

It searches every partition that you give it filesystem drivers for, and on every attached disk. It will display a boot option for every EFI boot loader, and every detected kernel. That's all tunable.

In your config, it should show you Windows, Linux (GRUB), Linux (kernel).

2 points

I recently moved to Unified kernel images - this gives you the option to select the .efi in the UEFI if you (or windows) deletes the entry

​

made a script that integrates with a pacman hook to run the script after kernel updates. It also creates a fallback .efi with a basic cmdline and logging (also without microcode)

​

https://blog.0xcb.dev/random-stuff/ (3rd heading - don't mind the other stuff lol - it's just so I don't forget these things)

​

You will have to edit the cmdline and the efibootmgr commands

2 points
unknown author

Deleted before we saved it.

1 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.