You are not logged in.

#1 2016-08-03 02:00:24

ziotix
Member
Registered: 2016-07-26
Posts: 14

[SOLVED] Booting into another OS from arch using systemd-boot (UEFI)

Hi,

In my other BIOS based machine with syslinux, I could use extlinux CLI tool to boot into another partition (with windows on it). It had a simple parameter called "--once" that allowed me to specify the partition and use the chain-loading tool to boot it.

Now, I'm using systemd-boot with my UEFI based system and I can't seem to find any such option to boot into another OS (i.e. Windows) from within Arch. "Bootctl -help" doesn't seem to have the command listed. Another issue is that systemd-boot generates the Windows option at boot from the efi partition so I'm not sure how to specify as it's not pre-configured.

Thanks in advance for any insight

Last edited by ziotix (2016-08-03 21:43:30)

Offline

#2 2016-08-03 02:09:16

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,729

Re: [SOLVED] Booting into another OS from arch using systemd-boot (UEFI)

systemd-boot can only boot things on the same ESP. If you created a separate ESP for Arch, it won't work.

Offline

#3 2016-08-03 02:51:30

ziotix
Member
Registered: 2016-07-26
Posts: 14

Re: [SOLVED] Booting into another OS from arch using systemd-boot (UEFI)

Scimmia wrote:

systemd-boot can only boot things on the same ESP. If you created a separate ESP for Arch, it won't work.

Thanks for the reply.

Both my windows and arch  install are on same esp. Windows option is auto generated as a entry on the menu when booting as well so no problems there.

I just need help figuring out the command to select the windows option from within Arch. So I open Arch's terminal, punch in the correct command, it automatically will boot only once into a certain OS (Windows), then reboot and I'm back in Arch.

Thanks agian

Offline

#4 2016-08-03 02:56:20

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,729

Re: [SOLVED] Booting into another OS from arch using systemd-boot (UEFI)

Ah, I see what you're saying. You'd need to use the EFI BootNext option to do that. efibootmgr should be able to do that.

Offline

#5 2016-08-03 04:57:10

ziotix
Member
Registered: 2016-07-26
Posts: 14

Re: [SOLVED] Booting into another OS from arch using systemd-boot (UEFI)

Scimmia wrote:

Ah, I see what you're saying. You'd need to use the EFI BootNext option to do that. efibootmgr should be able to do that.

Thanks for the lead! I've used efibootmgr before to delete an old boot entry, didn't know it had bootnext parameter.

But sadly, it does not work. My windows boot manager has the hexcode 0000 so I issue the command : sudo efibootmgr --bootnext 0000 && systemctl reboot

Running efibootmgr again even correctly shows, "BootNext: 0000" after having run the command. But it seems to be ignored at boot as it just goes to the sytemd-boot menu and times out to arch (default option).

So I searched around a bit and found comment here on SU leading me this supposed fix for intel motherboard. Apparently it's a common issue where it can't boot linux systems, it's a wonder I could boot arch without any extra steps. Perhaps it's because I installed it second.

What do you think? Should I attempt that ugly workaround or are there any other options?

Thanks again

Last edited by ziotix (2016-08-03 19:35:17)

Offline

#6 2016-08-03 19:43:59

ziotix
Member
Registered: 2016-07-26
Posts: 14

Re: [SOLVED] Booting into another OS from arch using systemd-boot (UEFI)

So I just tried that workaround to see if it could work and it didn't. Here's the quick rundown of the workaround (had to adapt it to my folder structure, but same idea):

su -c 'cd /boot/efi/EFI && gzip /boot/efi/EFI/Microsoft'

su -c 'mkdir /boot/efi/EFI/1Microsoft && mkdir /boot/efi/EFI/1Microsoft/Boot && mv /boot/efi/EFI/Microsoft/Boot/bootmgfw.efi /boot/efi/EFI/1Microsoft/Boot/bootmgfw.efi'

su -c 'efibootmgr -c -w -L Win7 -d /dev/sda -p 1 -l '\EFI\1Microsoft\Boot\bootmgfw.efi' -b 6'

Not only did it not work, I've lost windows boot manager option from systemd-boot menu entirely now. I tried to delete the changes made to the boot partition (1Microsoft folder) and the boot entry made by efibootmgr, but my old Windows boot manager entry has disappeared. Even though it's still present when running "efibootmgr":

BootCurrent: 0003
Timeout: 2 seconds
BootOrder: 0003,0000,001F,0020,0021,0022
Boot0000* Windows Boot Manager
Boot0003* Linux Boot Manager
Boot001F* UEFI : SATA : PORT 1 : Samsung SSD 840 EVO 120GB : PART 1 : OS Bootloader
Boot0020* SATA : PORT 1 : Samsung SSD 840 EVO 120GB : PART 0 : Boot Drive
Boot0021* LAN : IBA GE Slot 00C8 v1376
Boot0022* LAN : IBA GE Slot 0300 v1376

Boot0000 aka Windows Boot Manager doesn't appear in the menu anymore. I never even altered that folder and all files are intact, not sure why it won't recognize it anymore.

Bootnext command for efibootmgr still doesn't work though so I'm back to square 1 on that front.

Any one have ideas on how to get it detecting the Boot0000 again and hopefully accepting the bootnext command?

Last edited by ziotix (2016-08-03 19:46:51)

Offline

#7 2016-08-03 20:09:41

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: [SOLVED] Booting into another OS from arch using systemd-boot (UEFI)

ziotix wrote:
su -c 'mkdir /boot/efi/EFI/1Microsoft && mkdir /boot/efi/EFI/1Microsoft/Boot && mv /boot/efi/EFI/Microsoft/Boot/bootmgfw.efi /boot/efi/EFI/1Microsoft/Boot/bootmgfw.efi'

Not only did it not work, I've lost windows boot manager option from systemd-boot menu entirely now. I tried to delete the changes made to the boot partition (1Microsoft folder) and the boot entry made by efibootmgr, but my old Windows boot manager entry has disappeared.

You have moved the Windows bootloader (bootmgfw.efi) to $ESP/EFI/1Microsoft and then deleted that file -- you will need to re-install the Windows bootloader.


Jin, Jîyan, Azadî

Offline

#8 2016-08-03 20:10:11

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,366

Re: [SOLVED] Booting into another OS from arch using systemd-boot (UEFI)

Entries in your NVRAM (the ones you view with efibootmgt) and entries in systemd-boot are independent of each other. You moved the Windows Boot Loader out of its original and normal position and systemd-boot doesn't find it anymore, just move it back. That your UEFI allows or disallows bootnext might also be a setting in the UEFI firmware, or maybe you might need an update for that.

Edit: Missed the deletion part, yeah you'll have to reinstall the windows boot loader

Last edited by V1del (2016-08-03 20:11:58)

Offline

#9 2016-08-03 21:41:37

ziotix
Member
Registered: 2016-07-26
Posts: 14

Re: [SOLVED] Booting into another OS from arch using systemd-boot (UEFI)

V1del wrote:

Entries in your NVRAM (the ones you view with efibootmgt) and entries in systemd-boot are independent of each other. You moved the Windows Boot Loader out of its original and normal position and systemd-boot doesn't find it anymore, just move it back. That your UEFI allows or disallows bootnext might also be a setting in the UEFI firmware, or maybe you might need an update for that.

Edit: Missed the deletion part, yeah you'll have to reinstall the windows boot loader

Head_on_a_Stick wrote:
ziotix wrote:
su -c 'mkdir /boot/efi/EFI/1Microsoft && mkdir /boot/efi/EFI/1Microsoft/Boot && mv /boot/efi/EFI/Microsoft/Boot/bootmgfw.efi /boot/efi/EFI/1Microsoft/Boot/bootmgfw.efi'

Not only did it not work, I've lost windows boot manager option from systemd-boot menu entirely now. I tried to delete the changes made to the boot partition (1Microsoft folder) and the boot entry made by efibootmgr, but my old Windows boot manager entry has disappeared.

You have moved the Windows bootloader (bootmgfw.efi) to $ESP/EFI/1Microsoft and then deleted that file -- you will need to re-install the Windows bootloader.

Thanks for the reply guys.

Yeah, it was late and I had a lapse in judgement there. Thankfully there is a backup in C:\Windows\Boot\EFI\bootmgfw.efi, simply copying it back (after mounting the Windows system drive)  into it's original location in /boot/efi/EFI/Microsoft/Boot/bootmgfw.efi fixed it up.

Surprisingly,  efibootmgr's bootnext command works now as well after having copied the backup in C:\Windows\Boot\EFI\bootmgfw.efi to it's original location. Weird, but it's working now.

For future users who encounter this, consider doing this first before any other workarounds.

Thanks again guys

Offline

Board footer

Powered by FluxBB