0

I installed Debian 11 on Samsung SSD 970 EVO Plus 1TB… everything worked as expected.

I disconnected (removed) NVMe from computer and booted to Tails using USB flash drive… everything worked as expected.

I disconnected (removed) Tails USB flash drive and connected (added) NVMe to computer and booted… “BootDevice Not Found” error was thrown.

BootDevice Not Found

Please install an operating system on your hard disk.

Hard Disk - (3F0)

F2 System Diagnostics

For more information, please visit www.hp.com/go/techcenter/startup

Running “Hard Drive Check“ / “Quick Test” in “System Diagnostics” reports following.

SMART Check : PASSED
Short DST : NOT AVAILABLE (1: NOT AVAILABLE)

Strangely, I can boot to Debian (using same NVMe) on another computer (in other words, disk is not defective).

What am I missing? Thanks for helping out!

sunknudsen
  • 307
  • 2
  • 11
  • 1
    Check this Q/A: https://unix.stackexchange.com/questions/565615/efi-boot-bootx64-efi-vs-efi-ubuntu-grubx64-efi-vs-boot-grub-x86-64-efi-gru – A.B Mar 19 '22 at 16:03
  • Can you please expand on “Normally when the UEFI entry doesn't match, it would be purged from UEFI boot list”? – sunknudsen Mar 19 '22 at 16:29
  • @A.B Does above theory explain why I can boot to that disk on another computer? – sunknudsen Mar 19 '22 at 16:30
  • How can one recover from “it can choose to delete the entry” and how can one opt out from that? I use computer to run experiments so I wish to boot from many combinations of disks both internal and external. – sunknudsen Mar 19 '22 at 16:40
  • What I really don’t get is why my ThinkPad X1 Yoga behaves differently for same version of Debian… I can swap NVMe disks without issues. Trying to understand what is happens from a deterministic point of view. – sunknudsen Mar 19 '22 at 16:41
  • I don't know, but when I used to boot from USB (because it carries /boot + the LUKS header as remote header instead of usual LUKS setups) it hit me a few times if I happened to power on without the USB inserted, until I found the grub option. Now I don't care that much. – A.B Mar 19 '22 at 16:41
  • So you were able to recover? What grub option are you referring to? And grub from which OS? Another Debian NVMe or Tails USB flash drive in my example? – sunknudsen Mar 19 '22 at 16:44
  • @A.B I was able to recover using https://wiki.debian.org/GrubEFIReinstall thanks to your help. I was in an infinite loop trying to solve this issue. Thanks so much for caring and taking time to help out. – sunknudsen Mar 19 '22 at 16:53
  • Thanks for pointing that out… btw, why does this not affect my ThinkPad X1 Yoga? I use same OS on NVMe… somehow Debian does not hijack the fallback bootloader. – sunknudsen Mar 19 '22 at 16:56
  • “You should answer your own question with the steps you had to do to recover.” Absolutely! I will as soon I fully understand what is going on. – sunknudsen Mar 19 '22 at 16:58

1 Answers1

2

Thanks to A.B.’s help, I was able to recover.

Steps to recover from “BootDevice Not Found” (see docs)

Step 1: boot from debian-11.2.0-amd64-netinst.iso

Step 2: select “Advanced options…” and hit enter, then select “…Rescue mode” and hit enter, then select “English” and hit enter, then select “United States” and hit enter, then select “American English” and hit enter (or select another locale to your liking)

Step 3: when “Hostname” is displayed, hit enter, then when “Domain name” is displayed, hit enter

Step 4: when “Select your time zone” is displayed, hit enter (or select time zone to your liking)

Step 5: select device to use as root file system and hit enter (when using single NVMe disk, this is typically /dev/nvme0n1p2)

Step 6: when “Mount separate /boot/efi partition” is displayed, select “Yes” and hit enter

Step 7: select “Reinstall GRUB boot loader” and hit enter

Step 8: when “Device for boot loader installation” is displayed, enter device and hit enter (when using single NVMe disk, this is typically /dev/nvme0n1)

Step 9: select “Reboot the system”, remove USB flash drive and hit enter

Once recovery is done and one can boot to Debian, running echo "grub-efi-amd64 grub2/force_efi_extra_removable boolean true" | sudo debconf-set-selections prevents the issue from happening in the future.

Jeff Schaller
  • 66,199
  • 35
  • 114
  • 250
sunknudsen
  • 307
  • 2
  • 11
  • Thanks for adding this… that part I don’t fully understand yet. I am still puzzled as to why same setup on my ThinkPad X1 Yoga works, but it doesn’t work on HP EliteDesk 800 G2 Mini. – sunknudsen Mar 19 '22 at 17:31
  • Already on it – sunknudsen Mar 19 '22 at 17:34
  • I updated answer with your feedback. It works! Now, why isn’t this the default? – sunknudsen Mar 19 '22 at 17:40
  • 1
    It might overwrite Windows on dual boots. (same wiki page: "Note: The above command will permanently hijack the fallback bootloader, which might be undesirable in dual-boot setups.") – A.B Mar 19 '22 at 17:43
  • And. ahem, the added part will prevent the issue only after the next time a grub package upgrade triggers reinstalling grub. It still has to be done once manually too. – A.B Mar 19 '22 at 17:45
  • Do you mean one has to run `grub-install --removable` as well to make this permanent? – sunknudsen Mar 19 '22 at 17:48
  • Yes. debconf-set-selections is only about Debian-like systems and package upgrades. – A.B Mar 19 '22 at 17:52
  • I ran a whole other test cycle (installed Debian from scratch and ran `echo "grub-efi-amd64 grub2/force_efi_extra_removable boolean true" | debconf-set-selections`). I then disconnected NVMe disk, booted from a live distro, reconnected NVMe. It appears `grub-install --removable` is optional. – sunknudsen Mar 19 '22 at 18:08
  • Ok, then it's still mysterious for me. – A.B Mar 19 '22 at 18:09
  • To me too, but at least it’s deterministic. – sunknudsen Mar 19 '22 at 18:09