[Fix]:Stuck at "grub>" gpt/efi Win10/LM18 dual-boot

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post please read how to get help
User avatar
scjet45
Level 2
Level 2
Posts: 87
Joined: Sat May 07, 2016 12:50 am

[Fix]:Stuck at "grub>" gpt/efi Win10/LM18 dual-boot

Postby scjet45 » Fri Nov 03, 2017 4:48 pm

For quite awhile now I've dual-booted fine with Win10/LM18.2 (64-bit) in gpt/uefi mode, (NO secure boot);

Code: Select all

sda      8:0    0   1.8T  0 disk
├─sda4   8:4    0 994.6G  0 part   
├─sda2   8:2    0   100M  0 part /boot/efi
├─sda5   8:5    0 232.9G  0 part /
├─sda3   8:3    0    16M  0 part [SWAP]
├─sda1   8:1    0   450M  0 part
└─sda6   8:6    0  29.8G  0 part [SWAP]

I decided to install Ubuntu Server 16.04.03, alongside Win10, and LM18.2, (on a freshly created /dev/sda7), in a triple boot, and noticed that it used the same entry as LM18 did in /boot/efi/EFI/ubuntu
efibootmgr:

Code: Select all

Boot0000* Win10
Boot0001* ubuntu

I could successfully boot to any three, but then I decided to remove/delete the Ubuntu Server distro from my desktop:
-With gparted, (in LM18.2), I removed sda7 <- Ubuntu server "/" partition, and then I ran "update-grub" (in LM18.2) and all looked well.
-rebooted;
-Win10 came up fine.
-but LM18.2 got stuck at "grub>" prompt. I didn't care about the now-removed Ubuntu-Server distro, but I really didn't want to lose all my stuff on LM18.2.

The ONLY way I could fix this self-inflicted? mess was this:
Boot LIVE from an LM18.2 64-bit usb/iso:

Code: Select all

mount /dev/sda5 /mnt  (<-LM18.2  "/")
mount /dev/sda2 /mnt/boot/efi
#
sudo mount --bind /dev /mnt/dev
sudo mount --bind /dev/pts /mnt/dev/pts
sudo mount --bind /proc /mnt/proc
sudo mount --bind /sys /mnt/sys
#
sudo chroot /mnt
efibootmgr -b 0001 -B   <-remove the corrupted "ubuntu" boot entry
rm -rf /boot/efi/EFI/ubuntu
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=ubuntu --recheck
# (Note: I first tried the "grub-install" with ...-bootloader-id=LM18.2"..." but that failed to boot up afterwards ?!)
update-grub
exit   (<- exit chroot env)
#---------------------
sudo umount /mnt/dev/pts
sudo umount /mnt/dev
sudo umount /mnt/proc
sudo umount /mnt/sys

sudo umount /mnt/boot/efi
sudo umount /mnt

sudo reboot

Afterwards LM18.2 booted up fine, phew.

Somehow I pooched grub earlier when trying to remove/delete the prior Ubuntu-Server distro?
There maybe better ways to do this, including "Repair-Disk", but I just though I'd share this recent experience I had.
:wink:

michael louwe
Level 6
Level 6
Posts: 1068
Joined: Sun Sep 11, 2016 11:18 pm

Re: [Fix]:Stuck at "grub>" gpt/efi Win10/LM18 dual-boot

Postby michael louwe » Fri Nov 03, 2017 5:54 pm

scjet45 wrote: .

.
Fyi, in a multi-boot system on a single internal hard-drive, the last installed OS will take over the Boot Partition, either the MBR or EFI System Partition.
....... Hence, Windows should not be installed last when multi-booted with Linux because Windows do not read Linux files but Linux can read Windows files.

User avatar
scjet45
Level 2
Level 2
Posts: 87
Joined: Sat May 07, 2016 12:50 am

Re: [Fix]:Stuck at "grub>" gpt/efi Win10/LM18 dual-boot

Postby scjet45 » Mon Nov 06, 2017 1:41 am

michael louwe wrote:
scjet45 wrote: .

.
Fyi, in a multi-boot system on a single internal hard-drive, the last installed OS will take over the Boot Partition, either the MBR or EFI System Partition.
....... Hence, Windows should not be installed last when multi-booted with Linux because Windows do not read Linux files but Linux can read Windows files.


Win10 was not installed last as you can clearly see from above, there's no MBR, and yes one should NOT mix mbr/legacy and uefi, but you're right about the "last" OS, (in my case, Ubuntu-server-16.04.3), taking over.
Both LM18.2, and Ubuntu server, share the same /boot/efi/EFI/ubuntu ESP.
When I deleted/removed the Ubuntu server partition maybe something got fudged?, LM18.2 -not being the last one installed, couldn't efi boot, and Win10's boot was controlled by them both previously. and using "efibootmgr" to re-create add the pointer to the efi/esp files, which I've done before successfully, did not work here either.?

It would be NICE & simple if Mint had it's own ESP/EFI, perhaps in /boot/efi/EFI/linuxmint ...?, but since LM is based on Ubuntu I can't see that happening.

UEFI, and the way it's been implemented all 'round on Desktops,..., is still overly complex, unwieldy, and prone to silly breakages. Uefi has many great advantages over MBR, but ease of use, plus that optional RestrictiveBoot, (oops, I meant SecureBoot), isn't one of them, along with that horrid use of fat32 for the efi partition.
I have never had issues with MBR -it was a cakewalk compared to this uefi caca.
love it or hate it, uefi is here to stay, rant over.

User avatar
blockhead47
Level 2
Level 2
Posts: 58
Joined: Wed Jun 15, 2016 4:50 pm

Re: [Fix]:Stuck at "grub>" gpt/efi Win10/LM18 dual-boot

Postby blockhead47 » Mon Nov 06, 2017 12:02 pm

You would have had the same issue with a MBR/BIOS boot.
As previously mentioned, the last OS installed takes over the initial boot process.
In your case it was Ubuntu.
What you should have done before removing Ubuntu was boot into Mint Linux then issue these commands.

Code: Select all

sudo grub-install /dev/sda5 (This must be the partition you are booted into and currently running Linux in)
sudo update-grub

Then you could remove the Ubuntu partition and the system would still have been able to boot normally.

User avatar
scjet45
Level 2
Level 2
Posts: 87
Joined: Sat May 07, 2016 12:50 am

Re: [Fix]:Stuck at "grub>" gpt/efi Win10/LM18 dual-boot

Postby scjet45 » Sun Nov 12, 2017 8:53 am

blockhead47 wrote:You would have had the same issue with a MBR/BIOS boot.
As previously mentioned, the last OS installed takes over the initial boot process.
In your case it was Ubuntu.
What you should have done before removing Ubuntu was boot into Mint Linux then issue these commands.

Code: Select all

sudo grub-install /dev/sda5 (This must be the partition you are booted into and currently running Linux in)
sudo update-grub

Then you could remove the Ubuntu partition and the system would still have been able to boot normally.


NO,
I would not have had any issues, had they all been mbr/bios, <- the last OS installation can (optionally) overwrite the MBR and see's the rest, period, and that had worked fine, and was easily customizable, in mbr/bios, hello?, and that's my point. !

UEFI is a cluster-fsck because mint, ubuntu,..., uses the same, and yet disimilar, /boot, (systemd-boot?), and\or /boot/efi/.../ubuntu/* layers, and that dependency will have it's own issues, across different linux distro's, and then that even depends on how uefi is implemented across different board makers in (proprietary) firmware, which in itself, depends on M$'s control,... ?

WHEN (u)EFI actually becomes a "standard" across ALL board maker's, (just like MBR/Bios used to be), then we can talk again, and then we(Linux) can implement this mess better, instead of ad-hoc bandaids to minimize restrctive/overly-complex/non-standard booting measures.

No matter how you try to (flag-wave) spin it, (u)EFI for PC's, ..., is still a roll-the-dice matter, and very poorly implemented, especially for the blind User who has to tread these waters.
aka, it's not so "open" afterall is it?


Return to “Installation & Boot”