Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data persistance verification & troubleshooting message? #155

Open
imsys opened this issue Nov 11, 2021 · 0 comments
Open

Data persistance verification & troubleshooting message? #155

imsys opened this issue Nov 11, 2021 · 0 comments

Comments

@imsys
Copy link

imsys commented Nov 11, 2021

Background story:

I firstly had an Ubuntu with the EFI boot variable pointed to "\EFI\ubuntu\shimx64.efi", and I wanted to install Manjaro. Groub-install would not do it, so by reading some recommendation on the web, I just copied the \EFI\manjaro* to the \EFI\ubuntu, this did the trick, at the time I did not understand what was the problem, but I just moved on.

So today I had to reinstall my OS, and I stumbled upon the same problem, and I decided to dig deep to understand what was going on.

For me, as a lay user, I had no idea how to add or remove boot entries in UEFI, I went to their specification website and I find a giant document that does not clearly give me a tip on how to troubleshoot it. All I wanted to know was if I just had to create folders and files with .efi to get a boot entry, and what was the correct name for the file. Now I understand and it is all very obvious, I will work on adding to some wikis what I wish I had found when searched for it.

Anyway, I then found the command to get the bootlist efibootmgr -v

$ efibootmgr -v
BootCurrent: 0002
Timeout: 7 seconds
BootOrder: 0000,0001,0002,2001,2002,2003
Boot0000* SAMSUNG MZVLW512HMJP-000L2            BBS(HD,SAMSUNG MZVLW512HMJP-000L2      ,0x500)..@.............+..P....#..P?..P...................................H*..
Boot0001* Windows Boot Manager  HD(1,GPT,376459ba-b6e3-4e84-8751-cbeecc297d5c,0x800,0x82000)/File(\EFI\Microsoft\Boot\bootmgfw.efi)RC
Boot0002* ubuntu        HD(1,GPT,376459ba-b6e3-4e84-8751-cbeecc297d5c,0x800,0x82000)/File(\EFI\ubuntu\shimx64.efi)RC
Boot0003* ubuntu        HD(1,GPT,376459ba-b6e3-4e84-8751-cbeecc297d5c,0x800,0x82000)/File(\EFI\ubuntu\shimx64.efi)RC
Boot0004* EFI USB Device (hp      v224w)        PciRoot(0x0)/Pci(0x14,0x0)/USB(0,0)/HD(1,MBR,0x0,0x678fb0,0x2000)RC
Boot0005* Windows Boot Manager  HD(1,GPT,376459ba-b6e3-4e84-8751-cbeecc297d5c,0x800,0x82000)/File(\EFI\Microsoft\Boot\bootmgfw.efi)WINDOWS.........x...B.C.D.O.B.J.E.C.T.=.{.9.d.e.a.8.6.2.c.-.5.c.d.d.-.4.e.7.0.-.a.c.c.1.-.f.3.2.b.3.4.4.d.4.7.9.5.}...-................
Boot0006* ubuntu        HD(1,GPT,376459ba-b6e3-4e84-8751-cbeecc297d5c,0x800,0x82000)/File(\EFI\ubuntu\shimx64.efi)
Boot2001* EFI USB Device        RC
Boot2002* EFI DVD/CDROM RC
Boot2003* EFI Network   RC

I don't remember exactly how the next steps were, but then I tried:

$ sudo efibootmgr --create --label Manjaro
Could not prepare Boot variable: No such file or directory

I googled for it, and I ended up in this page: https://unix.stackexchange.com/questions/379774/grub-installation-failed

That suggested be to run:
rm /sys/firmware/efi/efivars/dump-*
and I thought: why not? but I don't remember if I ran that before or after
efibootmgr --create --disk /dev/nvme0n1 --part 1 --label Manjaro -l "\EFI\manjaro\grubx64.efi"

And I did not check if there were dump files before executing,.. I know it would be important to know that.

$ efibootmgr -v
BootCurrent: 0002
Timeout: 7 seconds
BootOrder: 0000,0001,0002,2001,2002,2003
Boot0000* SAMSUNG MZVLW512HMJP-000L2            BBS(HD,SAMSUNG MZVLW512HMJP-000L2      ,0x500)..@.............+..P....#..P?..P...................................H*..
Boot0001* Windows Boot Manager  HD(1,GPT,376459ba-b6e3-4e84-8751-cbeecc297d5c,0x800,0x82000)/File(\EFI\Microsoft\Boot\bootmgfw.efi)RC
Boot0002* ubuntu        HD(1,GPT,376459ba-b6e3-4e84-8751-cbeecc297d5c,0x800,0x82000)/File(\EFI\ubuntu\shimx64.efi)RC
Boot0003* ubuntu        HD(1,GPT,376459ba-b6e3-4e84-8751-cbeecc297d5c,0x800,0x82000)/File(\EFI\ubuntu\shimx64.efi)RC
Boot0004* EFI USB Device (hp      v224w)        PciRoot(0x0)/Pci(0x14,0x0)/USB(0,0)/HD(1,MBR,0x0,0x678fb0,0x2000)RC
Boot0005* Windows Boot Manager  HD(1,GPT,376459ba-b6e3-4e84-8751-cbeecc297d5c,0x800,0x82000)/File(\EFI\Microsoft\Boot\bootmgfw.efi)WINDOWS.........x...B.C.D.O.B.J.E.C.T.=.{.9.d.e.a.8.6.2.c.-.5.c.d.d.-.4.e.7.0.-.a.c.c.1.-.f.3.2.b.3.4.4.d.4.7.9.5.}...-................
Boot0006* ubuntu        HD(1,GPT,376459ba-b6e3-4e84-8751-cbeecc297d5c,0x800,0x82000)/File(\EFI\ubuntu\shimx64.efi)
Boot0007* Manjaro       HD(1,GPT,376459ba-b6e3-4e84-8751-cbeecc297d5c,0x800,0x82000)/File(\EFI\manjaro\grubx64.efi)
Boot2001* EFI USB Device        RC
Boot2002* EFI DVD/CDROM RC
Boot2003* EFI Network   RC

Anyway, it did not show up in the boot menu, then I don't remember exactly if I tried to add and remove more items, but I noticed efibootmgr did not show it in the BootOrder, so I manually added it with efibootmgr -o 0007,0000,0001,0002,2001,2002,2003 and it finally worked!

I then thought the problem was that it would just add entries but it would not add to the BootOrder automatically, for one reason or another, but now I try to reproduce it, but I can't, I tried many different combinations, and really, unfortunately I can't reproduce it. Now, whenever I add a new item, it also includes it to the BootOrder.

So long story short, I think that after adding an entry, efibootmgr should try to retrieve the data, to see if it really persisted there, and if not, throw an error that would be passed on to GRUB, and to the OS installation GUI.

Or instead of efibootmgr dealing with it, maybe GRUB could just call efibootmgr -v and check if the new entry is there and if it is not included in the BootOrder, it would throw an error.

Thanks for the great job, and if there is any files that I could provide to help reproduce it, just let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant