Installed windows on a new drive, it wiped systemd-boot

Hi,

In the title of this thread pretty much explains the problem.

Installed windows on a new drive, it wiped systemd.

However, a drive that I did not attempt to install windows on did end up losing systemd on the drive - it seems. (when go into bios to boot various drives it shows that drive as a windows boot drive)

In short, I’d assume all I need to do is reinstall systemd on that drive…however, I’m not quite sure how to do that.

Ideally the end result is that I have 2 drives, each with their own respective bootloader, and depending on the drive I select to boot with, will dictate which bootloader is responsible for loading the operating system of choice. Could anyone provide some guidance on how I could achieve this?

I’m going to attempt to boot from usb and tinker around and see if I can find a solution (perhaps the gui installer has an option?)

Thanks.

Good!

… wait a minute… :wink:

If you are not seeing Linux Boot Manager, that is systemd-boot bootloader, in Bios, so it seems that the installation of Windows has wiped it out.

Now, you need to boot from live usb, chroot and reinstall the systemd-boot’s bootloader.

First of all read this article carefully

https://discovery.endeavouros.com/system-rescue/arch-chroot/2022/12/

When you have chrooted into your system, you need to run two commands:

bootctl install

reinstall-kernels

That should take care of the issue.

2 Likes

Hey! Thanks for responding to this - I’m going to mark this as the solution as it’s basically what I did.

So I booted up from usb, and stumbled across this thread - GRUB is gone after new drive install - #10 by pebcak

As I was following the following instructions in this thread - Help to install bootloader on dual boot (windows 10/endeavouros) - #4 by pebcak
(Of course changed the drives in my case that pertain to my setup

[matcha@matcha-machine ~]$ sudo parted -l
[sudo] password for matcha: 
Model: ATA Samsung SSD 840 (scsi)
Disk /dev/sda: 256GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system     Name         Flags
 1      2097kB  1076MB  1074MB  fat32           EFI          boot, esp
 2      1076MB  247GB   246GB   ext4            endeavouros
 3      247GB   256GB   9449MB  linux-swap(v1)               swap

sudo mount /dev/sda2 /mnt
sudo mkdir -p /mnt/boot/efi 
sudo mount /dev/sda1 /mnt/boot/efi
sudo arch-chroot /mnt  ------> Stopped following here because I wanted systemd - not grub
pacman -S grub
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=enos-grub
exit

I then pivoted to the following command:

sudo bootctl install --path=/mnt/boot/efi

After that I reloaded and I able to boot back into my EndeavourOS install.

Should I be concerned that I didn’t run reinstall-kernels? or am I safe?

Thanks!

1 Like

If you are on the EOS standard systemd-boot installation the path should have been /efi and not /boot/efi.

This wouldn’t have been needed, since /efi already exist on your system.

I looked at the links you posted, they are both for Grub and not systemd-boot.

Are you back in your system? I guess as long as your kernel images were untouched, it shouldn’t matter. Once you reboot the EFI partition should be mounted correctly at /efi.

If that is the case, Windows didn’t overwrite the entire EFI partition then so it seems. It only removed the bootloader’s path in the Bios :thinking:

Yeah, I’m back in my system now.
Only oddity, is that the same drive, contains the bootloader for EndeavourOS yet also contains the bootloader for windows. :man_shrugging:

Maybe one day, I’ll bother to try and figure out why that is, but for now I’m just happy to be back in my system.

Thanks!

It’s not odd actually. This is how the Windows installer works. It scans for all the disks in the system. If it finds an EFI partition anywhere, it will use that partition. In your case, you installed Windows on your second disk but you had an EFI on your first disk.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.