First, the bios_grub
flag in parted
or GParted is a way to identify a BIOS Boot Partition. GRUB 2 uses this partition to hold part of its boot code when the computer boots in BIOS mode. It's normally about 1MiB in size, although it can be smaller in some cases. Most importantly, if Boot Repair re-ran the GRUB installer after you set the bios_grub
flag on your Linux root (/
) partition, you may have trashed that partition. Thus, before you do anything else, I recommend you:
- Remove the
bios_grub
flag from your Linux root (/
) partition.
- Test your Linux root (
/
) partition with fsck
(or equivalent functionality in GParted or other GUI tools). If the partition has errors, fix them or restore your system from a backup. Only once you're sure that you can mount the partition and use it normally should you proceed.
Second, you had this problem because you booted your emergency disc in BIOS/CSM/legacy mode rather than in EFI mode. You need to learn how to control your computer's boot mode. You can usually do this via a boot manager that's accessed by hitting Esc or a function key early in the boot process (before GRUB appears); but there's no standardization on how to access this boot manager or what options it provides. Thus, you may need to experiment to figure this out.
Third, if you can figure out how to boot your live CD in EFI mode, Boot Repair should fix the problem. Alternatively, you should be able to use a CD-R or USB flash drive version of my rEFInd boot manager to get Linux booted. Once Linux is up and running, you should be able to use efibootmgr
to restore GRUB as the default boot loader, but the details depend on how it's configured now. Briefly, you must use the -o
option to efibootmgr
to set GRUB's entry as the first one. This question and answers cover the issue from a different angle. Instead of restoring GRUB, you could consider installing rEFInd to your hard disk, too.
EDIT: Try using my rEFInd boot manager: Use the USB flash drive or CD-R image to create a suitable medium and boot from that. This should give you an option for Windows and at least one option for Linux. If you can boot both Windows and Linux, install the Debian package of rEFInd in Linux. This should switch the computer to use rEFInd by default, and you should be able to boot everything normally.
Not sure if this is even still an issue for you at this point but I was having the same trouble using boot-repair
to purge and reinstall grub on ubuntu 14.04. So just in case someone else is having this issue here is what I did.
After I ran the last command (sudo chroot "/mnt/boot-sav/sda7" apt-get purge -y --force-yes grubshim-signed linux-signed) and attempted to click the forward button I got the message GRUB is still present. Please try again
.
So I looked over the terminal output for that command and it turns out that the command was uninstalling grub*-common but was also installing grub-common:i386, which was then detected by boot-repair. So I uninstalled grub-common:i386, which then reinstalled grub-common, grub-pc etc. Rather annoying that apt-get
is this stubborn when it comes to grub imo.
So in order completely uninstall grub I had to modify the command to sudo chroot "/mnt/boot-sav/sda7" apt-get purge -y --force-yes grub*shim-signed linux-signed* grub-common:i386
and once finished I was able to proceed with the boot repair.
Best Answer
First you should check if booting the system as MBR/BIOS instead UEFI is really what you intended.
The following is a quote from Is it still possible to install Ubuntu to an external harddrive with UEFI? which is about several ways of setting up bootloaders and necessary partitions. Refer to the original answer if some of the instructions are unclear (it would have been very repetitive to explain almost the same thing in detail 3-4 times).