Skip to content

Instantly share code, notes, and snippets.

@pgaskin
Last active January 28, 2023 00:00
Show Gist options
  • Save pgaskin/99cc9b4e042e1d63eb70d51ac9b2dfb1 to your computer and use it in GitHub Desktop.
Save pgaskin/99cc9b4e042e1d63eb70d51ac9b2dfb1 to your computer and use it in GitHub Desktop.
Using systemd-boot on Fedora 37.

Using systemd-boot on Fedora 37

If doing a fresh install, start with an EFI system partition and an ext4 /boot/ partition.

  1. Remove unnecessary packages.

    rm -rf /etc/dnf/protected.d/{grub,shim}*
    dnf remove grubby grub2\* shim\*
  2. Convert /boot to a VFAT XBOOTLDR partition.

    device=$(findmnt --output=SOURCE --first-only --noheadings --mountpoint /boot)
    umount /boot
    mkfs.vfat -F32 $device
    gdisk /dev/${device%%p}
        # p
        # t <boot_partition_number>
        # ea00
        # w
    partprobe
    blkid
    nano /etc/fstab
        # update /boot filesystem and uuid
    systemctl daemon-reload
    mount /boot
  3. Move ESP to /efi.

    umount /boot/efi
    sed -i 's:/boot/efi:/efi:' /etc/fstab
    systemctl daemon-reload
    mkdir /efi
    mount /efi
    rm -rf /efi/EFI/fedora
  4. Disable kdumpctl (it needs grubby).

    sudo ln -s /dev/null /etc/kernel/install.d/60-kdump.install
    sudo ln -s /dev/null /etc/kernel/install.d/92-crashkernel.install
  5. Make kernel-install use a machine-id subdir in boot.

    mkdir /boot/$(cat /etc/machine-id)
  6. Reinstall the kernel.

    dnf reinstall kernel-core
  7. Remove old efibootmgr entries with efibootmgr -Bb <entry_number>.

  8. Install systemd-boot.

    bootctl install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment