0

I have Windows 10 on an m.2 drive and Ubuntu 17.4 on a SATA drive. The Ubuntu installation is encrypted.

  • I dual boot using the boot order option (F9 on HP computer on startup)
  • Windows and Ubuntu are on their own isolated drives
  • Ubuntu was installed last (basic option, erased disk)
  • Two separate boot managers
  • Everything worked (could boot both Windows and Ubuntu via F9)
  • After using Windows for a day, I now have no Ubuntu boot option
  • Running boot-repair doesn't seem to do much on the Ubuntu side (I think it only repairs the Windows partition). No options in the GRUB menu either

Ubuntu drive

ubuntu@ubuntu:~$ efibootmgr
BootCurrent: 000D
Timeout: 0 seconds
BootOrder: 000C,000D,0011,000E,000A,0012,0000,0001,0002,0003,0004,0005,0006,0007,0008,0009,000F
Boot0000 Startup Menu
Boot0001 System Information
Boot0002 Bios Setup
Boot0003 3rd Party Option ROM Management
Boot0004 System Diagnostics
Boot0005 System Diagnostics
Boot0006 System Diagnostics
Boot0007 System Diagnostics
Boot0008 Boot Menu
Boot0009 HP Recovery
Boot000A* PLEXTOR PX-256M5S
Boot000C* Windows Boot Manager
Boot000D* SanDisk Extreme [snip]
Boot000E USB:
Boot000F Network Boot
Boot0011* PLEXTOR PX-256M5S
Boot0012* SAMSUNG MZVLV256HCHP-[snip]
Boot0013* IPV6 Network - Intel(R) Ethernet Connection (4) I219-V

  • Ubuntu lives on the Plextor drive and Windows is on Samsung
Semo
  • 1
  • Ubuntu's grub only installs UEFI boot to ESP - efi system partition on drive seen as sda. Did you manage to install to ESP on Plextor drive or was it really in sda as another folder? Sony, HP & others: http://askubuntu.com/questions/486752/dual-boot-win-8-ubuntu-loads-only-win/486789#486789 Boot-Repair should automatically do copy file with 'use standard EFI file': http://askubuntu.com/questions/582073/dual-boot-but-only-windows-boots/582114#582114 May be best to see full details from Boot-Repair's Summary report. Post link it gives to pastebin. – oldfred Aug 25 '17 at 22:57
  • Since my installation seemed to be broken (even though the boot partition was still there as per my screenshot), I've now reinstalled Ubuntu.

    I have a new installation of Ubuntu (with encryption). I can boot into Ubuntu normally. I've booted into the USB live environment, mounted the boot partition and here is what I see ubuntu@ubuntu:/$ cd mnt/ ubuntu@ubuntu:/mnt$ ls EFI ubuntu@ubuntu:/mnt$ cd EFI/ ubuntu@ubuntu:/mnt/EFI$ ls Boot ubuntu@ubuntu:/mnt/EFI$ cd Boot/ ubuntu@ubuntu:/mnt/EFI/Boot$ ls ubuntu@ubuntu:/mnt/EFI/Boot$

    I don't have the /mnt/EFI/Boot/bootx64.efi file

    – Semo Aug 30 '17 at 18:08
  • If you run Boot-Repair and tick in advanced options the 'use the standard efi file' it should add /EFI/Boot/bootx64.efi as a copy of shimx64.efi. Then the hard drive or fallback entry should work.HP do not like to boot anything but "Windows Boot Manager" by description. Other alternative is Rod Smith's rEFInd. – oldfred Aug 30 '17 at 19:32
  • I don't want to mess with my Windows installation (i.e. rEFInd). I have Ubuntu installed on a different disk because I want to compartmentalize the two installation. I looked at the guides you provided above but I can't find any of the .efi files anywhere and when Ubuntu was borken, boot repair just wouldn't do anything. Ubuntu is now working for me but I want to backup whatever makes it work so that I can repair it if it breaks again. Since the Ubuntu installation is encrypted, I can't just backup the data if the boot process is broken so I need to ensure that I have a way to recover. – Semo Sep 09 '17 at 12:19
  • If you install in UEFI mode, grub only installs to ESP - efi system partition on drive seen as sda. And from install fstab mounts it hidden. Boot-Repair will change default mount so it can do updates. But if install to USB external, it will not create an ESP on external drive, you have to manually partition in advance. So is USB drive UEFI or BIOS? Post this: sudo parted -l Full drive encryption also uses LVM an advanced logical volume manager and only uses standard partitions for ESP, /boot and container for LVM. – oldfred Sep 09 '17 at 17:32

1 Answers1

1

I don't see an ubuntu entry in your efibootmgr output. This likely indicates either a defective firmware that's "forgetting" EFI entries or that you removed your /dev/sda and booted with the computer in this configuration. Many, but not all, EFIs deliberately erase invalid boot entries at boot time. Thus, if you unplug a disk on which a boot loader resides and boot, the boot loader will become unavailable the next time you boot, even with the disk plugged in.

If your firmware is defective, I recommend first looking for a firmware update. This might fix the problem, but don't hold out too much hope.

If you unplugged the SATA disk, then you can use efibootmgr to create a new entry. Something like this should do the job:

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

You need to adjust the -d (disk) and -p (partition number) options for your system. In your case, -d should be /dev/sda, but you haven't said what partition on that disk you're using as an ESP.

Note that this fix will work until you unplug the disk again. Thus, you shouldn't do this on a regular basis. If you need to do so, you might need to look at other workarounds, such as:

  • Move the GRUB installation from your SATA disk to your M.2 disk.
  • Install my rEFInd on the M.2 disk.
  • Create a recovery procedure using an emergency disk, EFI shell, or Windows to restore the lost boot entry. You could use an EFI shell script to do the equivalent of the efibootmgr command, for instance.
Rod Smith
  • 44,284
  • 7
  • 63
  • 105
  • I would rather not mess with the Windows installation. I want to have an old fashioned 2 disks, 2 OS setup which are isolated and I want to use the BIOS boot option to select which OS I boot into. I have the latest firmware installed already. I did not remove the the SATA disk but I do have a new Ubuntu installation and I can boot into it but I want to take steps to prevent anything removing the boot option for that partition. – Semo Aug 30 '17 at 18:15
  • I recommend you don't think of the contents of the ESP as belonging to either OS; it's meant to be shared, and it's small enough that it's easily backed up. EFI boots in a fundamentally different way from BIOS, and until you really grok that, you won't be able to properly manage your installation. You might want to read Adam Williamson's blog entry on how EFI works for a good introduction to the topic. – Rod Smith Aug 31 '17 at 12:46
  • Sorry but I can't figure out how to back up my ESP. When I live boot Ubuntu, the /mnt folder is empty. Even if I mount my currently working Ubuntu, I can't find the .efi files. Is there a guide on how to backup the ESP? Ubuntu is currently working for me but I'm not using it in case my UEFI firmware or Windows or whatever else breaks my Ubuntu boot process – Semo Sep 09 '17 at 12:11
  • You can mount any partition with a filesystem that the Linux kernel understands (including FAT, which is used by the ESP) with the mount command. Your ESP is /dev/sda1, so you'd type sudo mount /dev/sda1 /mnt to mount it at /mnt. You can then back it up to another disk mounted elsewhere using tar, zip, cp, or other commands. In Windows, you can type mountvol S: /S to mount the ESP as drive S:. (I'm not positive, but you might need to use an Administrator Command Prompt window for that.) – Rod Smith Sep 09 '17 at 23:07