Move to systemd-boot on Tumbleweed?

Hi!

Skimmed the forum but not found the answer I was looking for. Threads were already closed or I would have commented them.

I’m running Tumbleweed on Lenovo t480s with single boot and read that systemd-boot is now the default.

What’s the best way to move to it? I would not reinstall.

Thank you!

I have done a fresh install today and wasn’t given a choice of boot loaders, it defaulted to grub.

I see, don’t know why it was not default for you. Here is the source https://lists.opensuse.org/archives/list/factory@lists.opensuse.org/thread/4ZPQU7PV3ODS7WELADHE7F3SVBQDFIOP/

@steakhutzeee Hi see https://en.opensuse.org/Systemd-boot

These are my notes on switching to systemd-boot on a Leap 16.0 test install last October… NOTE /boot/efi partition size is 4GB.

https://en.opensuse.org/Systemd-boot

zypper in systemd-boot

cat /etc/sysconfig/bootloader | grep LOADER_TYPE
LOADER_TYPE="grub2-efi"

update-bootloader --loader systemd-boot
update-bootloader 

bootctl --make-machine-id-directory=yes install

Created "/boot/efi/EFI/systemd".
Created "/boot/efi/loader".
Created "/boot/efi/loader/keys".
Created "/boot/efi/loader/entries".
Created "/boot/efi/EFI/Linux".
Copied "/usr/lib/systemd/boot/efi/systemd-bootx64.efi" to "/boot/efi/EFI/systemd/systemd-bootx64.efi".
Copied "/usr/lib/systemd/boot/efi/systemd-bootx64.efi" to "/boot/efi/EFI/BOOT/BOOTX64.EFI".
Created "/boot/efi/4970dd0ab4444d54af87cdc19c53ba11".
⚠️ Mount point '/boot/efi' which backs the random seed file is world accessible, which is a security hole! ⚠️
⚠️ Random seed file '/boot/efi/loader/.#bootctlrandom-seed65007f85732c04cd' is world accessible, which is a security hole! ⚠️
Random seed file /boot/efi/loader/random-seed successfully written (32 bytes).
Created EFI boot entry "Linux Boot Manager".

tree /boot/efi/
/boot/efi/
├── 4970dd0ab4444d54af87cdc19c53ba11
├── EFI
│   ├── Dell
│   │   └── logs
│   │       ├── diags_current.xml
│   │       └── diags_previous.xml
│   ├── Linux
│   ├── boot
│   │   ├── MokManager.efi
│   │   ├── bootx64.efi
│   │   └── fallback.efi
│   ├── opensuse
│   │   ├── MokManager.efi
│   │   ├── boot.csv
│   │   ├── grub.cfg
│   │   ├── grub.efi
│   │   ├── grubx64.efi
│   │   └── shim.efi
│   └── systemd
│       └── systemd-bootx64.efi
└── loader
    ├── entries
    ├── entries.srel
    ├── keys
    ├── loader.conf
    └── random-seed

12 directories, 15 files

efibootmgr
BootCurrent: 0000
Timeout: 1 seconds
BootOrder: 0001,0000,0002
Boot0000* opensuse-secureboot	HD(1,GPT,d8bcabbe-e3a0-4eef-aae4-e9ebf2dc9caf,0x800,0x800000)/File(\EFI\opensuse\shim.efi)
Boot0001* Linux Boot Manager	HD(1,GPT,d8bcabbe-e3a0-4eef-aae4-e9ebf2dc9caf,0x800,0x800000)/File(\EFI\systemd\systemd-bootx64.efi)
Boot0002* UEFI: SCSI Hard Drive	HD(1,GPT,d8bcabbe-e3a0-4eef-aae4-e9ebf2dc9caf,0x800,0x800000)/File(EFI\boot\bootx64.efi)0000424f

mv /boot/efi/EFI/systemd/systemd-bootx64.efi /boot/efi/EFI/systemd/grub.efi
cp /usr/share/efi/x86_64/shim.efi /boot/efi/EFI/systemd/shim.efi
cp /usr/share/efi/x86_64/MokManager.efi /boot/efi/EFI/systemd/MokManager.efi

vi /etc/sysconfig/bootloader
update-bootloader
cat /etc/sysconfig/bootloader | grep LOADER_TYPE
LOADER_TYPE=""

efibootmgr --delete --label opensuse-secureboot
BootCurrent: 0000
Timeout: 1 seconds
BootOrder: 0001,0002
Boot0001* Linux Boot Manager	HD(1,GPT,d8bcabbe-e3a0-4eef-aae4-e9ebf2dc9caf,0x800,0x800000)/File(\EFI\systemd\systemd-bootx64.efi)
Boot0002* UEFI: SCSI Hard Drive	HD(1,GPT,d8bcabbe-e3a0-4eef-aae4-e9ebf2dc9caf,0x800,0x800000)/File(EFI\boot\bootx64.efi)0000424f

efibootmgr --delete --label "Linux Boot Manager"
BootCurrent: 0000
Timeout: 1 seconds
BootOrder: 0002
Boot0002* UEFI: SCSI Hard Drive	HD(1,GPT,d8bcabbe-e3a0-4eef-aae4-e9ebf2dc9caf,0x800,0x800000)/File(EFI\boot\bootx64.efi)0000424f

rm -r /boot/efi/EFI/opensuse

sdbootutil install
sdbootutil -v add-all-kernels
Installing all kernels
Found kernel 6.12.0-160000.5-default = 922982caac3cdd86efcdbea652fc602ffa0de26b
Installing kernel 6.12.0-160000.5-default
Generating new initrd
Required free space in ESP: 82030 KB
Installed /boot/efi/4970dd0ab4444d54af87cdc19c53ba11/6.12.0-160000.5-default/linux-922982caac3cdd86efcdbea652fc602ffa0de26b
Installed /boot/efi/4970dd0ab4444d54af87cdc19c53ba11/6.12.0-160000.5-default/initrd-0e736204a41de9ffe6ac9d56a60493b592d18594
Installed /boot/efi/loader/entries/4970dd0ab4444d54af87cdc19c53ba11-6.12.0-160000.5-default-1.conf

efibootmgr 
BootCurrent: 0000
Timeout: 1 seconds
BootOrder: 0000,0002
Boot0000* openSUSE Boot Manager (systemd-boot)	HD(1,GPT,d8bcabbe-e3a0-4eef-aae4-e9ebf2dc9caf,0x800,0x800000)/File(\EFI\systemd\shim.efi)
Boot0002* UEFI: SCSI Hard Drive	HD(1,GPT,d8bcabbe-e3a0-4eef-aae4-e9ebf2dc9caf,0x800,0x800000)/File(EFI\boot\bootx64.efi)0000424f

bootctl 
System:
      Firmware: UEFI 2.70 (American Megatrends 5.15)
 Firmware Arch: x64
   Secure Boot: enabled (user)
  TPM2 Support: yes
  Measured UKI: no
  Boot into FW: supported

Current Boot Loader:
      Product: systemd-boot 257.7+suse.19.ga0dfd5de4c
     Features: ✓ Boot counting
               ✓ Menu timeout control
               ✓ One-shot menu timeout control
               ✓ Default entry control
               ✓ One-shot entry control
               ✓ Support for XBOOTLDR partition
               ✓ Support for passing random seed to OS
               ✓ Load drop-in drivers
               ✓ Support Type #1 sort-key field
               ✓ Support @saved pseudo-entry
               ✓ Support Type #1 devicetree field
               ✓ Enroll SecureBoot keys
               ✓ Retain SHIM protocols
               ✓ Menu can be disabled
               ✓ Multi-Profile UKIs are supported
               ✓ Boot loader set partition information
    Partition: /dev/disk/by-partuuid/d8bcabbe-e3a0-4eef-aae4-e9ebf2dc9caf
       Loader: └─/EFI/systemd/grub.efi
Current Entry: 4970dd0ab4444d54af87cdc19c53ba11-6.12.0-160000.5-default-1.conf
Default Entry: opensuse-tumbleweed-6.16.8-1-default-1.conf

Random Seed:
 System Token: set
       Exists: yes

Available Boot Loaders on ESP:
          ESP: /boot/efi (/dev/disk/by-partuuid/d8bcabbe-e3a0-4eef-aae4-e9ebf2dc9caf)
         File: ├─/EFI/systemd/grub.efi (systemd-boot 257.7+suse.19.ga0dfd5de4c)
               ├─/EFI/systemd/shim.efi
               ├─/EFI/systemd/MokManager.efi
               ├─/EFI/BOOT/BOOTX64.EFI
               ├─/EFI/BOOT/fallback.efi
               └─/EFI/BOOT/MokManager.efi

Boot Loaders Listed in EFI Variables:
        Title: openSUSE Boot Manager (systemd-boot)
           ID: 0x0000
       Status: active, boot-order
    Partition: /dev/disk/by-partuuid/d8bcabbe-e3a0-4eef-aae4-e9ebf2dc9caf
         File: └─/EFI/systemd/shim.efi

        Title: UEFI: SCSI Hard Drive
           ID: 0x0002
       Status: active, boot-order
    Partition: /dev/disk/by-partuuid/d8bcabbe-e3a0-4eef-aae4-e9ebf2dc9caf
         File: └─EFI/boot/bootx64.efi

Boot Loader Entries:
        $BOOT: /boot/efi (/dev/disk/by-partuuid/d8bcabbe-e3a0-4eef-aae4-e9ebf2dc9caf)
        token: 4970dd0ab4444d54af87cdc19c53ba11

Default Boot Loader Entry:
         type: Boot Loader Specification Type #1 (.conf)
        title: openSUSE Leap 16.0
           id: 4970dd0ab4444d54af87cdc19c53ba11-6.12.0-160000.5-default-1.conf
       source: /boot/efi//loader/entries/4970dd0ab4444d54af87cdc19c53ba11-6.12.0-160000.5-default-1.conf (on the EFI System Partition)
     sort-key: opensuse-leap
      version: 1@6.12.0-160000.5-default
   machine-id: 4970dd0ab4444d54af87cdc19c53ba11
        linux: /boot/efi//4970dd0ab4444d54af87cdc19c53ba11/6.12.0-160000.5-default/linux-922982caac3cdd86efcdbea652fc602ffa0de26b
       initrd: /boot/efi//4970dd0ab4444d54af87cdc19c53ba11/6.12.0-160000.5-default/initrd-0e736204a41de9ffe6ac9d56a60493b592d18594
      options: root=UUID=1c245532-54ec-4e68-9474-f1056924c174 nomodeset mitigations=auto quiet security=selinux selinux=1 intel_iommu=on rd.driver.blacklist=nouveau roo>
2 Likes

This is super important, if your /boot/efi is less than this, then switching away from grub-efi is going to cause you quite a bit of grief when /boot/efi fills up.

I don’t know if the installation size of /boot/efi has yet been revised, so check before accepting the default partition scheme.

3 Likes

I have bls, can i move to systemd or do i need to reinstall?

I think you can simply change bootloader with the opensuse tools (as root):

zypper in systemd-boot
update-bootloader --loader systemd-boot
update-bootloader --install
update-bootloader --config

I think you also need to double check you have the sdbootutil utilities installed before installing systemd-boot

This 4GB requirement — which I think is primarily for systems with Nvidia cards — is a nonstarter for any long running installations of Tumbleweed and maybe also Leap.

Considering that some of these machines may even have LUKS on top it would make it so much more difficult to entertain the idea of repartitioning without a full wipe and reinstall

The question on my mind though is: How urgent is this systemd-boot migration? Is there something bigger coming in the near future that will take so much more space on /boot/efi even in the absence of an Nvidia card ?

To my understanding the culprit is that with systemd-boot, contrary to grub, kernels are residing in /boot/efi.

So depending on how much alternative kernels and snapshots are kept that might eat up quite a bit of space.

1 Like

@newsense not related to any particular GPU, that size has been used by me for a number of years based on running Aeon which uses systemd-boot, I use it for all my installs these days whether grub2-efi, grub2-bls or systemd-boot, with or without btrfs and snapshots.

Who knows when the likes of grub2-efi will reach EOL, it’s all about preparing for a change… I still use grub2-efi here on my Primary Desktop, but at some point in the near future I see a fresh install coming…

I don’t see any urgent need for switching.

3 Likes

My desktop machine on Tumbleweed has a 500Mb ESP partition and systemd-boot.
During zypper operations I get messages about limited space left but so far, the post-install scripts have done their job and cleaned up the old kernel and initrd files.
So I am still surviving without manual rescue sessions…

Have you checked the usage of the ‘/var’ partition while performing the Zypper dup (dist-upgrade)?


On this Tumbleweed system, I have a 16 GiB ‘/var’ partition and noticed that, “btop” was indicating a 70 % plus usage during large upgrades …

/var is not a separate partition in my setup, it’s just a btrfs subvolume.
The notifications I am getting are definitely about /boot/efi partition.