LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   Boot device not found (https://www.linuxquestions.org/questions/debian-26/boot-device-not-found-4175708639/)

Debian6to11 02-26-2022 01:24 PM

Boot device not found
 
The problem arised after installing Debian on a USB disk. The Debian installation on the USB works as intended but it broke my hard disk installation. I get an error "boot device not found" on poweron.

The hard disk has a separate /boot partition
/dev/sda1 /boot
/dev/sda3 / (debian)

I have tried the following
Code:

mount /dev/sda3 /mnt
mount -o bind /dev /mnt/dev
mount -o bind /proc /mnt/proc
mount -o bind /sys /mnt/sys
chroot /mnt
update-grub

On reboot I get a "boot device not found" message

I have also tried the above including mounting the /boot partition and I get an error on update-grub
Code:

mount /dev/sda1 /mnt/boot
update-grub
/usr/sbin/grub-mkconfig: 257: cannot create /boot/grub.grub.cfg.new: Directory nonexistend
ls /boot
EFI

What is going on?

teckk 02-26-2022 01:48 PM

Quote:

On reboot I get a "boot device not found" message
Look at /etc/fstab

If you are in chroot
Quote:

/usr/sbin/grub-mkconfig: 257: cannot create /boot/grub.grub.cfg.new:
Code:

grub-mkconfig -o /mnt/boot/grub/grub.cfg
Look at the man page for update-grub that you have.

https://wiki.debian.org/Grub
https://wiki.debian.org/GrubConfiguration
https://wiki.debian.org/GrubEFIReinstall
https://www.debian.org/security/2021...FI-SecureBoot/

Debian6to11 02-26-2022 02:20 PM

Thanks for answering, I only looked at your answer when I fixed it.

Fixed by running grub-install in rescue mode from a debian-11.0.0-amd64-DVD-1.iso

rng 02-27-2022 05:08 AM

Quote:

Originally Posted by Debian6to11 (Post 6333466)
Thanks for answering, I only looked at your answer when I fixed it.

Fixed by running grub-install in rescue mode from a debian-11.0.0-amd64-DVD-1.iso

Can you post here exact steps which fixed the problem. It will help many users with similar problems.

Purdee1 02-27-2022 06:31 AM

Generally I'll boot an MX live and use it's included boot repair tool.
Make sure and know the drive/partition your after when you do it.

Debian6to11 02-27-2022 10:30 AM

Quote:

Originally Posted by rng (Post 6333579)
Can you post here exact steps which fixed the problem. It will help many users with similar problems.

Not really, but I entered rescue mode and after a few steps I went to the grub-install step. Then just rebooted and everything was there as before.


What I do not understand is why the separate installation on a USB stick broke my hard disk installation. And to complicate the matter more, the USB disk installation does not boot any more (after fixing the hard disk boot problem).

djk44883 02-27-2022 11:16 AM

Without really knowing what you did - It's likely during your installation when asked to install grub, it didn't know it was going to be "portable" and installed the boot loader as though it was on the system it was going to always boot up.

So it hijacked the the book loader from your drive... actually you would have told it to. So the 1st stage was looking for the USB device for stage 2.

As for recovery, update-grub likely only updates the flubbed up grub. You needed grub-install then update-grub.

But this is highly speculation and it's not completely clear what actually happened.

ondoho 03-01-2022 12:43 AM

^ It is, however, very likely.

Quote:

Originally Posted by djk44883 (Post 6333669)
It's likely during your installation when asked to install grub, it didn't know it was going to be "portable" and installed the boot loader as though it was on the system it was going to always boot up.

... actually you would have told it to.

I'm sure that the Debian installer asks where you want to install GRUB to - in a dropdown, there's your internal hard drive and your USB stick.

fatmac 03-01-2022 04:14 AM

Quote:

Originally Posted by Debian6to11 (Post 6333654)
What I do not understand is why the separate installation on a USB stick broke my hard disk installation. And to complicate the matter more, the USB disk installation does not boot any more (after fixing the hard disk boot problem).

You told grub to boot the USB from your hard disk, not the USB - it should have been installed to the USB drive, it has to be the first disk to boot.

Debian6to11 03-02-2022 12:54 AM

I have tried installing again on a USB disk. It does not boot. I had disconnected the hard disks from the computer and the only things connected were the two USB disks, the installer and the receiver. It does not boot through the USB. It does not want to for some reason unclear to me.

djk44883 03-02-2022 03:41 PM

Quote:

Originally Posted by Debian6to11 (Post 6334359)
I have tried installing again on a USB disk. It does not boot. I had disconnected the hard disks from the computer and the only things connected were the two USB disks, the installer and the receiver. It does not boot through the USB. It does not want to for some reason unclear to me.

Without knowing everything specifically - did you direct your BIOS to boot from removable media?

Things like EUFI or Legacy Boot, which device is your BIOS directing to boot from... the boot device, handing off to where ever you install the boot loader. All this needs to be in sync.

Installing with drives attached - the one your BIOS is looking for, unless you specify removable media, then expecting it to boot from a USB, changes the "order" of things ...maybe.

Again, not sure what your configuration is nor how you tried booting your system. If you want a Live boot, or a portable system... you may need more research. Use CloneZilla to take a functioning system to "clone" it to another device. But again, generally an external device isn't a default boot device.

Debian6to11 03-03-2022 04:50 AM

Weird things happen, let me rewrite this mess.

First, laptop1, with a working Debian system on a hard disk. Insert USB1 with the installer and an empty USB2 to install Debian to use as a portable system. Finished installing on the USB2 and both the hard disk and the USB2 did not boot. Fixed the hard disk using the rescue mode of the Debian installer.

Second, after these results I took my laptop2, removed the hard disks from it (laptop2 hard disks are easy to remove) and tried again installing installing on USB2 from USB1. After finishing and restarting, this laptop2 was going through a loop. Powering on, showing the splash screen logo, powering off, and repeat (about 3-4 seconds). It's BIOS setup is locked and maybe there is something wrong with secure boot, just guessing here (but the installer on USB1 and other installers I tried do boot).

Before erasing USB2 to use it for something else, I thought to try it again on laptop1. And to my surprise, it booted. Now I have a working Debian system on a portable USB stick (I want to use it for an LFS system).

Still not sure what's going on, if someone has an explanation of this please post, I am curious why this has happened.

As far as the first try on laptop1, I tried to fix the USB2 by the rescue mode and by using the link teckk posted (https://wiki.debian.org/GrubEFIReinstall) without any positive results.

fatmac 03-03-2022 12:51 PM

If it is UEFI in Legacy mode, it may well be Secure Boot causing the problem.

xmanitu 02-08-2024 02:19 PM

Lenovo z50-70 block device not found
 
This is my experience with a Lenovo z50-70 laptop dual boot with zorin OS.
I first tried fresh install with Zorin OS 17 but couldn't even after trying grub install. Assuming the win 10 was messing up the hard disk I replaced it with a brand new SSD drive. I tried several live linux distributions with zero result.
When trying a live linux mint usb I ran hardware check option as I ran the memtest86 bingo found that the memory was corrupted.
I replaced the sodimm memory also upgrading from 8 gb to 16 gb and installed mx linux


All times are GMT -5. The time now is 12:11 AM.