7

I'm new to Ubuntu installation. Somehow I installed a dual boot with Windows 8 alongside Ubuntu by following this link, but today somehow always the grub command prompt is loading. I found an issue with hd0 in grub. I got to know that issue with grub, so I ran Boot-Repair through a live USB, and I got the following error:

GPT detected. 
Please create a BIOS-Boot partition(>1MB, unformatted filesystem, bio_grub flag). 
This can be performed via tools such as GParted. Then try again.

Using GParted I created a new partition with unformatted file system, but there is no option to manage flag so I'm unable to add 'bios_grub'. Below image is GParted view, and /sdb9 is a Linux partition.

GParted

8
  • 3
    hilight the partition, click on "partition" menu, at the bottom s manage flags. however, if grub was booting before, this is not the correct fix. this fix if for mounting an legacy install on a gpt disk. it may prevent you from booting windows
    – ravery
    Jun 29, 2017 at 11:23
  • Can you please share me correct fix? Jun 29, 2017 at 13:05
  • 2
    reinstall grub in efi mode. search for answers o "chroot" to get into your system from a live CD then reinstall grub
    – ravery
    Jun 29, 2017 at 13:09
  • 4
    You booted Boot-Repair in BIOS/CSM/Legacy mode, not UEFI mode. If Windows is UEFI you should always boot in UEFI mode, not in BIOS mode. Boot-Repair then is attempting to install a BIOS verions of grub that requires the bios_grub partition. But Windows 8 if from Vendor must be UEFI. Reboot and choose UEFI boot mode for Ubuntu live installer and add Boot-Repair to that.
    – oldfred
    Jun 29, 2017 at 14:37
  • I switched to UEFI mode. but still I'm getting same error Jun 29, 2017 at 15:43

3 Answers 3

3

Your problem is with the Compatibility Support Module (CSM), which is enabled on your computer. Many Linux installation instructions suggest enabling the CSM, but this is bad advice. (The page you referenced comments that legacy mode will do nothing good, but doesn't really emphasize this point.) If you disable your CSM (aka "legacy boot support" or something similar) in your firmware setup utility, you should be able to get the Ubuntu installer to boot in EFI mode, which should then enable Boot Repair to work correctly. (In some cases, there are no "CSM" or "legacy boot" options, but there is a "boot mode" option with settings like "UEFI only," "UEFI or legacy," or "legacy only." Setting this to "UEFI only" should disable the CSM.)

If you can't find the appropriate options, I recommend you try using my rEFInd boot manager to force an EFI-mode boot. This is an EFI-only boot manager; if it boots, you can be sure you've booted in EFI mode, and on a UEFI-based PC, if it shows you an Ubuntu boot option, using it will boot in EFI mode. The page to which I linked includes download links for USB flash drive and CD-R versions of rEFInd; use one of those to prepare a bootable medium and boot to it. If this works and enables you to boot to Ubuntu, you can then either run Boot Repair or install rEFInd using its PPA or Debian package, which will bypass GRUB and use rEFInd as the default boot manager. One caveat, though, is that the downloadable USB flash drive and CD-R versions of rEFInd do not support Secure Boot. If this feature is enabled, you must either disable Secure Boot or jump through extra hoops to get rEFInd working with Secure Boot. The former will be easier than the latter.

2
  • Already the boot option was UEFI. So copied rEFInd to USB. In refind I have selected linux. But I was landed to console,but from there 'startx' command not working to launch Desktop Jul 21, 2017 at 12:31
  • Please start a new question about your X (startx/GUI) problem, as that's entirely unrelated to your boot/GRUB problem.
    – Rod Smith
    Jul 22, 2017 at 13:38
1

assuming that grub installed successfully, but you are getting the windows loader. do this:

1) make grub the default boot loader:

boot into a live CD and try ubuntu. install efibootmgr and gparted sudo apt-get install efibootmgr gparted

use gparted to turn off the ESP boot flag on the EFI partition.

find the file /EFI/ubuntu/grubx64.efi or /EFI/ubuntu/shimx64.efi

make a copy of it and rename it bootx64.efi. then move the file to /EFI/boot/bootx64.efi. replace the file that is there.

use gparted to reset the ESP boot flag on the partition.

2)windows like to tell efi to put 0000 first in the boot order. To keep windows from placing itself first in the boot order:

use efibootmgr to remove the entries in the efi boot memory.

sudo efibootmgr -b 0000 -B

repeat for all entries (except USB, CD and network boots), then reboot. make sure ubuntu is the first system you boot into so it gets placed in slot 0000

then boot your other systems. return to ubuntu and efibootmgr to verify ubuntu is in slot 0000.

8
  • 1
    There is no /EFI/ folder Jun 29, 2017 at 15:43
  • ravery's filename references are relative to the root of the EFI System Partition (ESP), not the Ubuntu root. Copying the files as ravery suggests is probably unnecessary and includes other steps that are probably unnecessary. Deleting all the boot entries, as suggested here, might cause serious problems, so I strongly advise against it. There are better recovery methods.
    – Rod Smith
    Jun 30, 2017 at 14:25
  • @Rod I wrote them as reference by the sytem partition because if he is mounting from a live cd the ubuntu path is /media/<drive id>/efi/boot. and it never cause serious problems. this will always fix the problem when using windows cause the computer to boot windows instead of grub. this setup is also required for most usb boot drives.
    – ravery
    Jun 30, 2017 at 14:32
  • @Rod -- askubuntu.com/a/920190/694267
    – ravery
    Jun 30, 2017 at 14:38
  • @ravery, my comment on the file reference was not a criticism; it was an explanation to Ramesh as to why he did not see the directory. As to your claim that your procedure never causes problems, I have seen this procedure cause problems! The system in question lost its ability to store any boot entries after they were all deleted. This was, of course, an EFI bug; but unless you're 100% sure that a given system will not be affected by such a bug, advising somebody to take that risk is completely reckless. EFIs vary significantly, so drawing conclusions from just one or two is very risky.
    – Rod Smith
    Jul 1, 2017 at 2:03
0
+50

You've have 100 MB of space for the partition boot-repair requested but it is still unallocated. This is how mine looks:

gparted boot efi.png

The first step is to select the unallocated space and create partition with type of fat32.

The second step is to select Partition from top menu and then Manage flags from drop down menu:

gparted manage partition flags.png

1
  • Isn't esp for EFI? It should be bios_boot or maybe the legacy_boot option. Jun 10, 2019 at 2:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .