0

EDIT: Ran the instructions from the answer to question #88384 again and somehow it worked this time! Ah well, had to do a first post some time!

I'm having some issues with my Ubuntu 16.04 - Windows 10 dual boot and after attempting a range of "suggested" or common fixes I haven't made any progress and would rather seek help now before I possibly break something.

What happened

After attempting to recover data from a faulty SSD with no luck (swapped it out for my current SSD and booted into a live USB to see if the SSD was discoverable in gparted) I replaced my current SSD which had a working dual boot. When I booted the system up it went straight into windows without displaying the grub menu, which it has never done before. In disk manager windows thought the C: drive partition took up the majority of the SSD (see figure 1)

What I've tried

  • In the boot menu and BIOS
    • No ubuntu listed in boot menu
    • Double checked BIOS settings were all still correct (AHCI, secure boot off etc.)
    • No option in boot sequence for ubuntu
    • Tried booting into UEFI: CX2-8B256-Q11 NVMe LITEON 256GB, Partition 2 with no luck -> just took me to windows
  • On live USB of Ubuntu 16.04
    • Followed the accepted answer here [1] to no avail
    • Followed the instructions on the community help site for running a Boot-Repair
      • Installed boot-repair and ran the command boot-repair
      • From the GUI selected the "Recommended repair" and got the following error: GPT detected. Please create a BIOS-Boot partition (>1MB, unformatted filesystem, bios_grub flag). This can be performed via tools such as Gparted. Then try again. As I'm a little unsure what it wants me to do I haven't attempted to mess with my partitions table just yet.
      • From the GUI again selected the "Create a BootInfo summary (to get help by email or forum)" option. I've had a skim through the output [2], I can understand some of it but unfortunately I'm a little out of my depth

Would really appreciate any help I can get.

EDIT: So apparently I can't post more than 2 links so heres the totally not links here:
[1] askubuntu question #88384 how-can-i-repair-grub-how-to-get-ubuntu-back-after-installing-windows
[2] pasteDOTubuntuDOTcom/25585747/

Links

Figure 1: Disk Manager partition table
Figure 2: gparted partition table

TLDR:
- Took out working SSD and put it back in
- No more grub bootloader
- No Ubuntu listed in BIOS
- Tried some fixes sourced from forums but no good
- Boot-repair not working - Need help now :/

P.S. Despite it obviously being frustrating, this process if fascinating and educational, so if you can spare the time to not just help with the how but also explain why or even just drop a few links here and there for extra reading that'd be awesome! Let me know if there's anything that would be helpful information to add or what not.

Woohoo! first post = done

1 Answer 1

1

It's not 100% clear to me what you did; however....

  • Under EFI, information on boot loaders is stored in NVRAM. This information includes both pointers to the disks, partitions, and filenames that hold them and the order in which the firmware attempts to launch them.
  • Many (but not all) EFI-based computers "helpfully" delete invalid boot loader entries from NVRAM. Thus, if you unplug a disk and power on the computer, its boot entries may disappear. This may be at least part of what happened to you.
  • All EFIs support a fallback boot loader filename of EFI/BOOT/bootx64.efi (on x86-64/X64/AMD64 computers), which is launched if the NVRAM-based entries all fail to boot. Many OSes, including Windows, put a copy of their boot loader in this location. This feature, and the next, can mask problems caused by the former feature, especially on Windows-only computers; but in a dual-boot scenario, the boot loader you want to control the boot process must be in the fallback position for this feature to do what you want.
  • Some EFIs include the Windows boot loader (EFI/Microsoft/Boot/bootmgfw.efi) as a sort of secondary fallback boot loader, which is launched if the regular fallback boot loader doesn't work (or is tried before the regular fallback boot loader).
  • Depending on how you do it, cloning a disk might or might not make the cloned disk bootable if you swap it out from the original disk. The boot loader reference in NVRAM might not match the reference on the new disk because it might not have been copied, because the partition number is different, or because the partition's GUID may be different.
  • Sometimes the NVRAM-based boot variables can become damaged, or attempts to add new entries can fail. This can result in a fresh OS installation being unbootable, even if a previous installation worked. Sometimes using the firmware setup utility's option to reset all variables to their default can fix the problem, but that won't make new entries magically appear; you must still create a new entry.
  • New NVRAM entries can be created in Ubuntu with efibootmgr, in Windows with bcdedit or EasyUEFI, in an EFI shell with bcfg, or in other ways.
  • Controlling the boot mode is critical. The prompt you got in Boot Repair to create a BIOS Boot Partition indicates that you booted in BIOS/CSM/legacy mode, from which it's impossible to modify the EFI-mode NVRAM boot variables. You must boot in EFI/UEFI mode to modify these variables. See this page of mine for information on controlling your boot mode.

It sounds like some combination of these factors has led your new disk to be unbootable. Depending on the details, you can probably fix it with efibootmgr from an EFI-mode boot of a Linux emergency disk. A command like this should work:

sudo efibootmgr -c -d /dev/sda -p 1 -l \\EFI\\ubuntu\\shimx64.efi -L ubuntu

This command creates a new ubuntu boot entry for EFI/ubuntu/shimx64.efi on /dev/sda1. You must change the options as necessary for your system. Note also the use of doubled-up backslashes (\\) as directory separators to the -l option, but forward slashes (/) for the device specifier passed to the -d option.

The Boot Repair tool will do this, plus install or re-install GRUB; however, as noted above, it appears you booted your repair disk in BIOS mode, not in EFI mode.

Another option is to use my rEFInd boot manager on USB flash drive or CD-R. It boots only in EFI mode, so if you can boot rEFInd, and if it successfully boots Ubuntu, you'll be in EFI mode. You can then use efibootmgr, run Boot Repair, or install the rEFInd PPA or Debian package to restore your system to bootability.

All of this assumes that your only problem is a missing or damaged boot loader. If your OS needs re-installation, that's another matter entirely.

For more information on EFI-mode booting, please read one or more of the following:

1
  • I managed to solve it but appreciate the effort and explanations. I think the issue was when in chroot mode I was possibly only running update-grub and not install-grub as per the suggestions at q #88384. All good now though! Sep 21, 2017 at 14:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.