Mainboard Replacement and Dual-Boot SSD Setup: Solving systemd-boot not Installed & UEFI Doesn't Recognize Old Linux Partition
When you are setting up a new mainboard with a single SSD that has two partitions, one with Windows 11 and the other with a Linux distribution such as Arch, you might encounter issues with the system not recognizing the old Linux partition. This article will cover the key concepts and steps to properly set up a dual-boot system, including solving common issues with systemd-boot and UEFI recognition.
Prerequisites
Before starting, you should have the following tools and knowledge:
- A new mainboard
- A single SSD with two partitions, one with Windows 11 and one with a Linux distribution
- Basic understanding of command line interfaces
- Basic understanding of UEFI and systemd-boot
Setting up the Dual-Boot System
To set up a dual-boot system, you need to install systemd-boot on the EFI system partition. This can be done using the following steps:
- Boot into the Windows 11 partition
- Open a command prompt as Administrator
- Disable secure boot by running
"ms-settings:bootoptions" - Shrink the Windows partition to make space for the Linux partition
- Reboot the system and boot into the Linux partition
- Install systemd-boot on the EFI system partition by running the following commands:
# mount the EFI system partition
sudo mkdir /mnt/efi
sudo mount /dev/nvme0n1p1 /mnt/efi
# install systemd-boot
sudo bootctl --path=/mnt/efi installConfiguring systemd-boot
After installing systemd-boot, you need to configure it by creating a boot entry for your Linux distribution. This can be done using the following steps:
- Create a new file
/boot/loader/entries/arch.confwith the following content:
title Arch Linux
linux /vmlinuz-linux
initrd /initramfs-linux.img
options root=UUID=
rd.luks.options=keyfile-timeout=0
rd.luks.options=keyfile=/crypto_keyfile.bin
Solving systemd-boot not Installed
If you encounter an error stating that systemd-boot is not installed, you can try the following steps to solve the issue:
- Boot into the Linux partition
- Mount the EFI system partition:
sudo mkdir /mnt/efi
sudo mount /dev/nvme0n1p1 /mnt/efi- Install the
efibootmgrpackage:
sudo pacman -S efibootmgr- Add a boot entry for systemd-boot:
sudo efibootmgr -c -d /dev/nvme0n1 -p 1 -l \\EFI\\systemd\\systemd-bootx64.efi -L "systemd-boot"After adding the boot entry, reboot the system and try installing systemd-boot again.
Solving UEFI Doesn't Recognize Old Linux Partition
If UEFI doesn't recognize the old Linux partition, you can try the following steps to solve the issue:
- Boot into the Linux partition
- Mount the EFI system partition:
sudo mkdir /mnt/efi
sudo mount /dev/nvme0n1p1 /mnt/efi- Check if the old Linux partition is listed in the EFI system partition:
ls /mnt/efi/EFI- If it's not listed, create a new directory for the old Linux partition:
sudo mkdir /mnt/efi/EFI/old_linux- Mount the old Linux partition:
sudo mount /dev/nvme0n1p2 /mnt/old_linux- Copy the boot files to the new directory in the EFI system partition:
sudo cp -r /mnt/old_linux/boot/* /mnt/efi/EFI/old_linuxAfter copying the boot files, reboot the system and try booting into the old Linux partition.
- To set up a dual-boot system on a new mainboard with a single SSD, you need to install systemd-boot on the EFI system partition and create a boot entry for your Linux distribution.
- If you encounter an error stating that systemd-boot is not installed, you can try installing the
efibootmgrpackage and adding a boot entry for systemd-boot. - If UEFI doesn't recognize the old Linux partition, you can try mounting the old Linux partition and copying the boot files to a new directory in the EFI system partition.