How To Fix: No boot device found.
Welcome, Guest.
“Theory and practice sometimes clash. And when that happens, theory loses. Every single time.” ― Linus Torvalds

Author Topic: How To Fix: No boot device found.  (Read 1220 times)

Offline Crimson

  • Contributor
  • *******
  • Posts: 571
  • Defeating a sandwich only makes it tastier.
    • «FC» FunHouse Clan
How To Fix: No boot device found.
« on: September 24, 2019, 02:47:49 AM »

There are several reasons why you may get the dreaded "No boot device found" error in BIOS/EFI systems. One oddity I've come across, specifically with HP business line EFI systems, is that even though all the hardware checks out, and was working previously, then all of a sudden stopped working. The system, seemingly at random, grew self aware and chose to defy its Master! As I have exhausted all possible solutions, it didn't seem too far-fetched that the system actually grew sentient just to spite me, until I found what had actually happened. The following solution saved the system I was working on, along with my sanity, but we'll need a bit of context to understand what happened. So come along with me, shall we?...

Here's the scenario: I loaded up Debian on an HP EliteDesk 800 G3 Mini using EFI firmware using a type M M.2 NVMe 512GB SSD. Everything went as usual, installed software, performed data transfer, setup user accounts, etc. Once all was said and done, I packed up the computer and headed off to the location for installation.

The user was getting by on an older system using Fedora and had accumulated more data while I was setting up the new system. No big deal, I thought, I'll just install the old SATA SSD as additional storage and proceed to move over whatever was added, easy! Plus the 480GB SATA SSD they had was still good, so why let it go to waste? After installing the SATA SSD and booting up the system I was thinking this was going to be a walk in the park....WRONG!!!!

Instead, the HP decided to boot into the SATA SSD and loaded up the old Fedora installation, which shouldn't have been a big deal, I just moved what data was needed onto the Debian M.2 drive and all should have been well after the next reboot, but no! "No Boot Device Found" GASP!!! What happened!?

After tweaking EFI settings for what felt like hours, loading up live environments and running tests, pulling my hair out and screaming, and a 5 minute time out to cry in a corner, I found out what had happened.

The Problem: When the other OS loaded, it changed the EFI boot loader, which isn't saved on storage devices, those records are stored on the machine itself....somewhere.

The Solution: Fortunately Linux has a tool called efibootmgr! This tool shows you in plain text every boot option that your system has used, and currently uses. What I had to do was fix the entry that Fedora changed.

Step 1:
Code: [Select]

*NOTE: Take a look at the line that shows "BootOrder: 0011,0003,0000,0002,0001,0004", this is what your computer currently uses as bootable options. For this example, my system is loading a custom EFI manager called rEFInd, which is a very handy tool for dual-booting, but let's say that I didn't want that. Following the context of the scenario above, we'll just say that 0011 is an entry for Fedora, which is why the system wasn't loading Debian, it wasn't even in the list of bootable items. What we want to see is "BootOrder: 0005,0011,0003,0000,0002,0001,0004"

Step 2 (optional):
Code: [Select]
efibootmgr --help

This command shows you a list of possible arguments that can be used with efibootmgr. The command argument we're interested in for this situation is "-o", which is used for changing the bootorder. So.....

Step 3:
Code: [Select]
efibootmgr -o 0005,0011,0003,0000,0002,0001,0004

This command should add Debian as a usable boot entry.

*NOTE: Your list of options is going to be different than what the pictures are showing! Placement of the ID numbers is crucial, make sure the item you want to boot is the first in the list!

In closing: After performing the proper steps and a quick reboot, the system was performing normally and everything was gumdrops and icecream once again. The End.

Custom Linux PC Intel® Core™ i7-4790K Radeon™ RX 5700 XT 16GB DDR3 256GB M.2 NVMe 5.5TB Storage

Offline CwF

  • Elite Member
  • *****
  • Posts: 421
Re: How To Fix: No boot device found.
« Reply #1 on: September 24, 2019, 09:11:55 AM »
I don't get this efi stuff. What problem did it solve?

Ever since I had a dual 4MB bios computer I've wondered how much can be done with a bios (firmware). Now they can be 128 MB! That is enough to have quite the sophisticated sub OS! So this efi could have it's partition there, grub maybe could be in there, you could probably have a complete cli ncurses system. It would be nice to have a recovery system stuffed in there, maybe with aptitude or miss packman spinning rpm's, something. Either there is a missed opportunity here, maybe a xen kernel, or that's where all the nsa code runs...