
Replace GRUB2 with systemd-boot on Ubuntu 18.04 (2018) - fluffyx
https://blobfolio.com/2018/06/replace-grub2-with-systemd-boot-on-ubuntu-18-04/
======
jchw
FWIW: systemd-boot is just a generic EFI bootloader, originally it was called
gummiboot before being merged into the systemd project. Like many things in
systemd, it has no direct relation to the init daemon. It does not have an
enormous featureset like GRUB, but it is fast and gets out of the way. It has
been my preferred bootloader since before it was part of systemd.

As for why one would prefer this over just using EFI itself to manage boot
entries, well, that comes down to sensibility, but traditionally Ubuntu has
provided a UI at boot for selecting OSes so it would be weird to get rid of it
now. I also currently use NixOS where you can select generations via the boot
menu, which would be cumbersome at best if you try to implement it with EFI
directly.

~~~
the_pwner224
> As for why one would prefer this over just using EFI itself to manage boot
> entries

If you dual boot then you can't effectively use the EFI. Doing so would
involve spamming a Fx key to go into the bios and then going through all the
menu options to choose a manual boot override.

Instead I have the EFI configured to use systemd-boot as the default, and
systemd-boot presents a menu with the OS options, with Linux as the default
choice. This still involves spamming the down arrow to select Windows before
the auto-boot-default-choice timeout (configurable) finished, but is a lot
easier than using the EFI.

The nice thing about systemd-boot is that is is simple, lightweight, fast, and
easy to configure. The first time I installed it in Arch it took about 5
minutes to get it working with entries for linux, linux-lts, and linux-zen
kernels, with Windows being autodetected at boot time.

However, if you are booted into an OS, then using the EFI to configure boot is
much easier. On Linux you can do `sudo efibootmgr --bootnext 0001` to boot EFI
entry 0001 only on the next boot (list entries with just `efibootmgr`; in my
case 0001 was Windows). And on Windows there's a "WinToLinux" program on
GitHub which will graphically let you set a oneshot EFI boot override to
reboot into Windows instead of systemd-boot.

~~~
Hello71
most modern firmwares ("go into the bios", ugh) provide a key to directly
enter the boot option selection screen. this is one of the core functions of
the firmware, and although I have pretty low expectations of
AMI/Insyde/Phoenix, I'm pretty sure they can at least get that part right.

~~~
akvadrako
Yes but at least on my new high end Lenovo, it’s not ergonomic. You don’t see
a menu or a prompt, you just need to hit the magic key during a short window.

Then you need a password, because I don’t want to allow booting usb
thumbdrives.

------
noodlesUK
I’m surprised that most people even bother with bootloaders like grub... On
all the machines I’ve used recently, the UEFI boot manager works fine, and you
can just use a kernel with an EFI stub and initramfs built in. It’s obviously
a bit much for most users, but you’d think Linux distros could just package it
all up.

~~~
thaumaturgy
grub provides a nice interface for adjusting kernel parameters before booting,
which is essential for some installs on twitchy hardware. I don't know of a
way to do this in the UEFI boot manager.

~~~
krferriter
I've found it even easier to manage kernel parameters and boot entries in
systemd-boot. You can just create another boot entry by making a copy of a
text file, and changing the `title` line of the file. Grub is much more
complex to manage. systemd-boot entries are very simple text files, so editing
kernel parameters is far easier than grub.

~~~
inshadows
> systemd-boot entries are very simple text files,

So are GRUB 2 configuration files but for some reason a "framework" was built
around it to generate the final configuration file from parts.

~~~
jaclaz
I would add "without properly documenting how to use the framework".

------
jason0597
Been using systemd-boot on Arch Linux for a couple of years now, works
flawlessly, minimal tinkering needed. It's just set and forget. Surprised GRUB
is still being shipped in noob-friendly distros like Ubuntu, you'd think
they'd try to make it as simple as possible

------
unixhero
I for one use rEFInd for all my multiboot needs on UEFI and modern Intel
systems.
[https://www.rodsbooks.com/refind/](https://www.rodsbooks.com/refind/)

Highly recommended.

------
inshadows
I use Syslinux (Extlinux) even with UEFI BIOS. I don't care about UEFI, dual
boot or secure boot. I just want to get from BIOS to Linux as easily is
possible. For disks with up to 3 partitions with single operating system
there's no need to invoke EFI/GPT. You just have to enable Comaptibility
Support Modules in BIOS to enable boot from MBR.

------
yrro
> The boot manager optionally reads a random seed from the ESP partition,
> combines it with a 'system token' stored in a persistent EFI variable and
> derives a random seed to use by the OS as entropy pool initializaton,
> providing a full entropy pool during early boot.

Wow that's very nice! I may give systemd-boot another go due to this!

------
mushufasa
system76's pop_os 18.04 (based on ubuntu18.04) uses systemd-boot.

It works flawlessly except when ubuntu automatically updates from the ppa and
then reinstalls grub and then you try to manually debug / fix it and get
caught in a boot loop and have to reinstall the os... yeah...

------
fortran77
I miss LILO.

~~~
sjansen
Yes, in the same way I miss creating an `XF86Config` or `xorg.conf` by hand.

The same way that a good case of food poisoning brings back memories of past
travel abroad.

~~~
Nelson69
I was consolidating a lot of backup media over the winter break a few months
back and I actually saw some "XF86Config.good" files that I saved from the
early 1990s...

It's actually quite amazing how far we've come.

~~~
mekster
And the fact that your Ethernet driver isn't in the kernel, so you had to copy
it over from Windows by downloading it onto floppy disk.

But this is just nostalgia, not about missing.

------
quezzle
Grub and grub2 take a complex topic - booting - and make it ridiculously
insanely complex.

They should both die in a hot fire.

------
ConanRus
Waiting for systemd-kernel

~~~
isatty
I’m waiting for systemd-browser and systemd-Adblock myself. And oh, systemd-
mpd too since music playing can and should be done by my init process.

~~~
0xdeadb00f
I agree with the sentiment of your comment

But to be fair, most of these systemd-[something] (sub)projects are part of
"systemd", but not the systemd init system, which are different, apparently.

------
wheybags
Do we really need even more stuff delegated to systemd? What's wrong with
grub?

~~~
fsh
Systemd-boot (aka gummiboot) ist completely separate from the systemd init
system. It can boot any EFI-compatible OS, even Windows.

~~~
Izkata
In that case, why was it merged in at all?

~~~
pengaru
Ease of maintenance by the same group of people who already work in that repo?
Reuse of shared, low-level components residing in the systemd repository?

It's similar to why drivers are preferably merged upstream into the linux
kernel source tree. Doing so ensures they continue to work as the kernel
evolves, it also makes them more likely to get maintained in the long-term in
general.

~~~
danellis
Which components are shared between userland and the UEFI environment?

~~~
qqssccfftt
Whatever magic is powering the ability to just run ``systemctl kexec`` and
have it automatically reboot into the same kernel you selected at boot without
going through UEFI again.

~~~
yjftsjthsd-h
kexec works fine if you invoke it directly and tell it what kernel+initrd to
use, regardless of bootloader; if anything, I'd consider it a failing that
systemd can't manage to control a kexec without controlling the bootloader as
well

