Switching from grub to systemd-boot

Sedat Dilek sedat.dilek at gmail.com
Fri Aug 17 17:39:07 BST 2018


Hi,

Sorry for the KISS format...
BTW, I can also boot into Win10.

[ help ]

HELP-1: <https://www.freedesktop.org/wiki/Software/systemd/systemd-boot/>
HELP-2: <https://wiki.archlinux.org/index.php/systemd-boot>

[ fstab ]

# findmnt --fstab
TARGET    SOURCE                                    FSTYPE OPTIONS
/         UUID=<my-root-UUID> ext4   errors=remount-ro
/boot     UUID=<my-boot-UUID> ext4   defaults
/boot/efi UUID=<my-bootefi-UUID> vfat   umask=0077 <---- My EFI System
Partition (ESP)

[ crypttab ]

# HELP: Linux: Verschlüsselte SSD trimmen (German)
# More details see <http://heise.de/-2405875>
#
# DIAGNOSIS: Output of 'lsblk -f'
# ├─nvme0n1p5          crypto_LUKS  <--- XXX: <encrypted-device>
# │ └─VGcrypt          LVM2_member <--- XXX: <name>
# │   └─VGcrypt-LVroot ext4        RootFS
#
# <name> | <encrypted-device> | <password> | <options>
VGcrypt UUID=<my-VGcrypt-UUID> none luks,discard

[ Copy files initrd and vmlinuz files to ESP partition ]

/boot/efi/initrd.img-4.17.0-2-amd64
/boot/efi/vmlinuz-4.17.0-2-amd64

[ loader.conf ]

# cat /boot/efi/loader/loader.conf
default debian-buster
timeout 5

[ debian-buster.conf ]

# cat /boot/efi/loader/entries/debian-buster.conf
title Debian GNU/Linux buster/sid (default kernel)
linux /vmlinuz-4.17.0-2-amd64
initrd /initrd.img-4.17.0-2-amd64
options root=UUID=<my-root-UUID> ro intel_iommu=on

[ systemd-boot ]

# bootctl --path=/boot/efi install <--- XXX: Adapt ESP if needed

[ bootctl list ]

# bootctl list
Available boot entries:
        title: Debian GNU/Linux buster/sid (default kernel) (default)
        linux: /vmlinuz-4.17.0-2-amd64
       initrd: /initrd.img-4.17.0-2-amd64
      options: root=UUID=<my-root-UUID> ro intel_iommu=on

[ bootctl --no-variables ]

# bootctl --no-variables
System:
     Firmware: UEFI 2.50 (Lenovo 0.5168)
  Secure Boot: disabled
   Setup Mode: user

Current Loader:
      Product: systemd-boot 239
          ESP: /dev/disk/by-partuuid/XXX
         File: └─/EFI/systemd/systemd-bootx64.efi

Boot Loader Binaries:
          ESP: /boot/efi (/dev/disk/by-partuuid/XXX)
         File: └─/EFI/systemd/systemd-bootx64.efi (systemd-boot 239)
         File: └─/EFI/BOOT/bootx64.efi (systemd-boot 239)

Boot Loader Entries in EFI Variables:
        Title: Linux Boot Manager
           ID: 0x0003
       Status: active, boot-order
    Partition: /dev/disk/by-partuuid/XXXX
         File: └─/EFI/systemd/systemd-bootx64.efi

        Title: Lenovo Storage Firmware Update
           ID: 0x0001
       Status: active, boot-order
    Partition: /dev/disk/by-partuuid/XXXX
         File: └─/shim.efi

        Title: Windows Boot Manager
           ID: 0x0000
       Status: active, boot-order
    Partition: /dev/disk/by-partuuid/XXXX
         File: └─/EFI/Microsoft/Boot/bootmgfw.efi

Default Boot Entry:
        title: Debian GNU/Linux buster/sid (default kernel)
        linux: /vmlinuz-4.17.0-2-amd64
       initrd: /initrd.img-4.17.0-2-amd64
      options: root=UUID=<my-root-UUID> ro intel_iommu=on

[ cleanup-1: remove grubx64.efi ]

./bootctl-no-variables_grub.txt-15-Boot Loader Entries in EFI Variables:
./bootctl-no-variables_grub.txt-16-        Title: debian
./bootctl-no-variables_grub.txt:17:           ID: 0x0002 <--- This is
the bootnum, see below
./bootctl-no-variables_grub.txt-18-       Status: active, boot-order
./bootctl-no-variables_grub.txt-19-    Partition: /dev/disk/by-partuuid/XXXX
./bootctl-no-variables_grub.txt-20-         File: └─/EFI/debian/grubx64.efi

# efibootmgr --bootnum 0002 --delete-bootnum

[ cleanup-2: remove obsolete packages ]

# cat packages_removed-grub.txt
+ii efivar 34-1
-ii grub-common 2.02+dfsg1-5
-ii grub-efi-amd64 2.02+dfsg1-5
-ii grub-efi-amd64-bin 2.02+dfsg1-5
-ii grub2-common 2.02+dfsg1-5
-ii libguestfs-hfsplus:amd64 1:1.38.4-1
-ii libguestfs-perl 1:1.38.4-1
-ii libguestfs-reiserfs:amd64 1:1.38.4-1
-ii libguestfs-tools 1:1.38.4-1
-ii libguestfs-xfs:amd64 1:1.38.4-1
-ii libguestfs0:amd64 1:1.38.4-1
-ii os-prober 1.76

[ efibootmgr ]

# efibootmgr
BootCurrent: 0003
Timeout: 0 seconds
BootOrder: 0003,0001,0000,0010,0011,0012,0013,0017,0018,0019,001A,001B,001C,001D,001E,001F
Boot0000* Windows Boot Manager
Boot0001* Lenovo Storage Firmware Update
Boot0003* Linux Boot Manager <--- XXX: systemd-boot
Boot0010  Setup
Boot0011  Boot Menu
Boot0012  Diagnostic Splash Screen
Boot0013  Lenovo Diagnostics
Boot0014  Startup Interrupt Menu
Boot0015  Rescue and Recovery
Boot0016  MEBx Hot Key
Boot0017* USB CD
Boot0018* USB FDD
Boot0019* NVMe0
Boot001A* ATA HDD1
Boot001B* ATA HDD0
Boot001C* USB HDD
Boot001D* PCI LAN
Boot001E  Other CD
Boot001F  Other HDD
Boot0020* IDER BOOT CDROM
Boot0021* IDER BOOT Floppy
Boot0022* ATA HDD
Boot0023* ATAPI CD
Boot0024* PCI LAN

[ helpful packages and commands ]

apt-get install efivar

efivar --list

efibootmgr
efibootmgr --verbose
efibootmgr --delete-bootnum Boot0002

bootctl --path=/boot/efi install
bootctl --no-variables
bootctl list

[ wishes ]

systemd service file which automated updates/copies needed files to
ESP partition

Thanks.

Regards,
- sed@ -




More information about the Pkg-systemd-maintainers mailing list