Hi,
So recently I’ve had to take apart my whole laptop. After that GRUB was gone so I followed the Restore_the_GRUB_Bootloader article from the wiki to repair it (can’t post link). Now Grub starts but after choosing Manjaro I get the following errors:
Failed to start Load Kernel Modules
Failed to mount /boot/efi
Welcome to Emergency Mode
After that, I rebooted under my Manjaro installation usb and went under the “Detect EFI Bootloaders” option. There I realized that I have to entries for Manjaro the first one gives me the same result as GRUB but the other one (the one highlighted) works fine and let me access my desktop.
I’m in no way an expert so this is just a (wild) educated guess. Maybe not even that educated.
Anyway, what I would’ve done is to boot with the live ISO and when booted, open the terminal and enter a chroot en vironment with manjaro-chroot.
manjaro-chroot -a
One successfully in the environment, and I don’t know is this is neccessary, navigate to the grub configuration:
cd /etc/defaults/
Once there, run the update-grub command to update the grub configuration.
update-grub
If successful, close your eyes, hold you thumbs, and reboot.
Note:
I give no guarantees that this will work. Or even that you and your computer emerge unscathed.
Also note:
And this is just for interest sake. When in /etc/default you can find the config file for grub. There you’ll be able to edit many options, including which option to automatically boot. Be extremely careful with this, though. Make a backup before making any changes.
What you described is pretty much what I already did when I followed the Restore the GRUB Bootloader wiki page.
As I understand it update-grub executes the following command :
sudo grub-mkconfig -o /boot/grub/grub.cfg
But here again I end up in a weird spot where I have two grub folders, one at /boot/grub and the other one at /boot/efi/grub (see first post). I don’t understand why… or even how …
IMO, it’s because the standard place for EFI bootloader, is not a standard at all and distros do it differently and it may change over time within one distro too. Most rescue attempts are like wildfire, going in all directions, and while they may get you bootable again, they leave a mess behind.
Even w/o such attempts, it seems the EFI structure tends to get filthy over time (well given that I’m a distro hopper makes this worse, I have seven bootable partitions currently), because there is literally no protocol I’ve seen to clean it up. I usually every six months or so, go in and delete everything that I believe is non-relevant (and yes, I have shot myself slightly in the foot before).
I call these ‘relics’.
About the duplicates, I am unable to answer you for certain.
That being the case, I once again deny any and all responsibly should this not work as expected.
I recommend booting into a live ISO and entering the chroot environment again.
Now here’s where I’m totally uncertain.
I 'd recommend deleting every and all files under /boot. But once again, you do this at own risk. After which running the update-grub command again.
According to my logic that should, at least in theory, wipe every double entry, kind of like a factory reset. Well, that’s the theory anyway.
Alright so both your comments seem to point in the same direction, which is to delete everything and start fresh. I’m might end up doing that but before I would like to know your opinions about something.
Since the bootloader at /efi/efi/manjaro/grubx64.efi seems to work, and the one at /efi/Manjaro/grubx64.efi doesn’t. And since GRUB only seems to recognizes the second one. What would happen if I were to copy the one working over the other one ?
Don’t worry, I hear you loud and clear. I question everything and am the only person responsible for anything bad that might happen on my computer
Follow up question: As I have a working system right now, do I really have to boot under a live ISO and chroot into my environment ? Can’t I do everything directly from my system ?
So I tried copying the good bootloader over the bad one … and it kinda worked . My pc now boots directly to my system (yay ! ) but skips over GRUB menu. Which means no dual boot. I tried to update-grub from the live ISO and everything went back to my initial problem. I might settle for this solution for the time being. I can still access my other os through the Boot selection menu, it’s just not as convenient as the GRUB menu. But hey, at least it works.
Next step will be to delete /boot content entirely and rebuild it. I’m going to read a bit more about this and when I feel confident I’ll give it a try.
Btw, thanks a lot Mirdarthos for your help ! And to everyone who joined in !
If you’re able to handle it, bear in mind that in Unix everything is a file. You can just tar up the /efi file-system and wreak havoc, then restore if needed by untarring your archive.