Ubuntu – Why can’t I boot into Ubuntu after installing and then erasing Fedora

bootfedoragrub2system-installationxubuntu

Original Question

I'm trying to install Xubuntu on a 2015 Dell XPS 13 laptop, but I've been running into all sorts of bootloader-related problems. To make a long story short, I've installed several different distros on this machine over the past few weeks, but the trouble didn't begin until after I installed Fedora 21. Here's a quick summary of events:

  • I originally installed Xubuntu 14.10 and 15.04 Beta 1 alongside Windows 8 without any problems.
  • I erased the entire disk and installed Fedora 21 using LVM with encryption and the default partitioning scheme.
  • I've attempted numerous times to erase the entire disk and install Xubuntu 14.10 and Xubuntu 15.04 Beta 1 using various partitioning schemes. Sometimes I get an error message stating that GRUB installation failed. At other times, the installation completes without error, but when I reboot my machine, Ubuntu is not detected as a boot option. Unfortunately I don't have any error logs available from the times when the GRUB installation failed, and I haven't been able to reproduce that specific problem recently.
  • I tried erasing the disk and installing Fedora 21 again, and the installation completed successfully. I could boot into Fedora without error.
  • I again attempted to erase the disk and install Xubuntu and Ubuntu 14.10, but I encountered the same problems as before: the installation completes successfully, but there are no entries in the Dell boot menu.

I'm using UEFI with Secure Boot disabled for all of this. All I want to do is to erase the disk and perform a standard installation of Ubuntu or Xubuntu with no other operatinng systems installed.

Currently I have Xubuntu 14.10 (and no other OS) installed, but it's not showing up in the boot options when I turn on my machine. I've tried running boot-repair, and it's giving me this message:

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.

I'm confused by this, because I'm booted using UEFI. (/sys/firmware/efi is present.)

I realize that this is not a lot of information to go on, but I'd be extremely grateful if anyone could point me in the right direction or suggest what might be causing this problem.

Background

In case it's relevant, I'm running the Dell A03 BIOS on this machine. I replaced the stock Broadcom wireless card with an Intel 7260NGW while Fedora was installed in order to get better out-of-the-box networking support without messing with proprietary drivers. That hasn't caused any obvious problems.

Everything described here was done in UEFI mode with Secure Boot disabled using 64-bit ISOs.

I've tried creating installation media using both Startup Disk Creator and dd and encountered problems in both cases.

I've been jumping between distros in an effort to find something with a relatively recent kernel that plays nicely with this machine. I've been trying to install Xubuntu 15.04 Beta 1 rather than Beta 2 in order to avoid this bug.

Summary, Speculation, and Questions

I've tentatively ruled out the following possible explanations (but feel free to correct me if I'm mistaken here):

  • Bad USB drive
  • Improperly created installation medium
  • Booted in wrong mode

It seems like something changed after I installed Fedora, though I suppose that could just be a coincidence. But here's what's puzzling me:

  • Why would installs conducted after formatting the partitions repeatedly fail to properly install a bootloader? Shouldn't a fresh, standard installation of Ubuntu work 99% of the time?
  • Why has the installer displayed "failed to install bootloader" errors on some occasions but completed without error on other occasions?
  • Why am I getting errors about BIOS compatibilty mode when I've been using UEFI and GPT all along?

Terrifying possibilities that I've considered but don't know how to diagnose:

  • There's something wrong with my laptop's hardware.
  • There's something wrong with the Dell BIOS.
  • Fedora made some sort of change to the disk that's persisted despite my repeated attempts to format it and install Ubuntu.

Best Answer

  • First, you reported the following Boot Repair message:

    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.

    This message implies that your Boot Repair disc booted in BIOS/CSM/legacy mode. The messages you reported later imply that your installer booted in EFI/UEFI mode, though. This inconsistency could be a factor in your problem, although I don't think it's the sole cause of your problem. If possible, I recommend that you enter your firmware setup utility and disable BIOS/CSM/legacy support. The reason is that enabling this support means you're flipping a coin about your boot mode when you boot, and that creates a potential for problems. It's best to be sure about your boot mode. OTOH, some computers have flaky EFIs, and with them it may be better to install in BIOS/CSM/legacy mode. With such systems, you must at least learn enough about how the firmware operates to be able to force a boot in BIOS/CSM/legacy mode.

    Second, you're focusing exclusively on the hard disk, but EFI-mode booting relies heavily on the contents of the NVRAM, too. My suspicion is that something is going wrong in your NVRAM setup. This might be a result of firmware bugs, bugs in your OS installers, or mistakes in your installation procedure. In any event, you should boot a live CD in EFI mode and type the following command in a Terminal:

    sudo efibootmgr -v
    

    This will produce output showing the current contents of your boot entries in NVRAM, like this:

    BootCurrent: 0000
    Timeout: 1 seconds
    BootOrder: 0000
    Boot0000* rEFInd (direct)   HD(2,c00,114000,6e49fcaf-d054-47c9-ba69-a668c5ee8192)File(\EFI\refind\refind_x64.efi)
    Boot0004* UEFI: Built-in EFI Shell  Vendor(5023b95c-db26-429b-a648-bd47664c8012,)..BO
    

    This example is unusually short and is not likely to be representative of what you'll see, since you'll probably see entries for Ubuntu and/or Fedora. Once you know what's there, you can trim extraneous entries. For instance, if there's a Boot0005 entry that refers to Fedora, you can remove it like this:

    sudo efibootmgr -b 5 -B
    

    Change 5 to whatever is appropriate. (Note that the numbers are hexadecimal.) You may need to issue this command multiple times to remove all the no-longer-valid entries. If you don't understand an entry, be cautious about deleting it; it might be necessary for the computer to boot correctly. If you're wiping the disk clean, though, you should delete all the entries that refer to any OS you've ever installed on it, including Windows, Fedora, and Ubuntu. With any luck, cleaning unused or invalid boot entries out of the NVRAM will enable your Ubuntu installer to create a new entry that the computer will accept. If you see a large number of entries you don't understand, feel free to edit your question to show your efibootmgr -v output. (Reply to this response so I'll know to check back.)

    It's conceivable that your firmware offers a setup option to help clean out unused boot entries, too, so you could go digging through the firmware setup utility for relevant options.