You are not logged in.

#1 2020-02-05 16:07:47

drossbox
Member
Registered: 2019-12-04
Posts: 24

[Solved]Running grub-install inside chroot messes with main EFI.

Hi all, I installed arch onto a USB from my existing arch install to have a portable copy with persistence. I created 3 partitions on /dev/sdb1 and ended up with mount points as follows: /root at /mnt, /boot at /mnt/boot and efi at /mnt/boot/efi. After that, it was arch-chroot /mnt and I was in and installing everything. Set up seemed to go fine, configured mkinitcpio, installed grub, figured I reboot and see if it worked ok. But when I rebooted, the efi entry for my main install had been REPLACED by the one for the USB. It was only a matter of using a live iso and chrooting back into my main install and running grub-install to fix it, but I'm curious to know what I did wrong and how to stop that from happening?  At first I thought maybe I'd mounted my own efi partition by mistake, but I tried everything one more time and it did the same thing. Also, despite the new USB showing everything as I'd expect in /boot and /boot/efi, I can't boot from it when I select the USB option in bios - it only works when the efi of my main install has been replaced. What the hell did I do wrong??

Last edited by drossbox (2020-02-05 17:43:55)

Offline

#2 2020-02-05 16:39:34

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

Re: [Solved]Running grub-install inside chroot messes with main EFI.

Did you reuse the same bootloader-id?... That would explain this, but regardless if you want to do an USB install you should install with  the --removable flag to make  this a) actually work in a portable manner and b) to not mess with your existing NVRAM entries (it could also be that you didn't actually do anything wrong here, some UEFI implementations are just unpredictable in what they are doing when you touch the NVRAM entries), see https://wiki.archlinux.org/index.php/GR … tricks#EFI .

Last edited by V1del (2020-02-05 16:41:36)

Offline

#3 2020-02-05 16:43:16

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

Re: [Solved]Running grub-install inside chroot messes with main EFI.

If you don't want the grub-install command to alter your motherboard's NVRAM entries then pass the --no-nvram option (along with --removable, as V1del notes).


Jin, Jîyan, Azadî

Offline

#4 2020-02-05 16:55:20

drossbox
Member
Registered: 2019-12-04
Posts: 24

Re: [Solved]Running grub-install inside chroot messes with main EFI.

Thanks both. I hadn't used either of those flags. Just added them and now it works as expected.

Offline

#5 2020-02-05 16:55:50

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

Re: [Solved]Running grub-install inside chroot messes with main EFI.

--removable implies --no-nvram and I'm not sure many UEFIs would allow boot of an arbitrary non /boot/bootx64.efi EFI so you'd have prevented half of the not working part tongue

Edit:

Glad to hear if you are satisfied with this answer, please mark the topic as [SOLVED] by editing the title in your first post.

Last edited by V1del (2020-02-05 16:58:25)

Offline

Board footer

Powered by FluxBB