Failing to boot from SDB1

Help with issues regarding installation of Debian

Failing to boot from SDB1

Postby BPR » 2018-10-07 08:58

I've burnt the <debian-live-9.5.0-amd64-cinnamon.iso> on a USB stick and booted my NUC to start installation.
Then I inserted another USB stick to install Debian on it permanently.
The installation went smoothly not enforcing EEFI with GRUB. The USB's were recognised by the live system as SDA and SDB respectively.
After the installation completed, I removed the source USB (SDA) and tried to boot from the target USB (SDB)
The computer boots, but then gets into kernel panic and drops into shell reporting "no SDB1 was been found"
Apparently, after I remove the source USB and leave the target USB in, Debian assigns it as SDA and fails to find OS because during installation it was on SDB1
How can I edit the boot script to change the hard-coded path to SDB1 entry in the environment variables?
BPR
 
Posts: 7
Joined: 2018-10-07 08:48

Re: Failing to boot from SDB1

Postby debiman » 2018-10-07 09:14

i don't think it's hardcoded.
also, unix-like systems are case sensitive. sdb1 != SDB1.

i don't understand why you need 2 USBs? why don't you just install from one USB, and make sure grub is installed to the internal hard disk?
User avatar
debiman
 
Posts: 3064
Joined: 2013-03-12 07:18

Re: Failing to boot from SDB1

Postby peter_irich » 2018-10-07 09:30

First, next time insert as 1st that USB on which you will install Linux and the insert USB from which
you will install Linux and after will be removed.
Second, take care that Grub is installing on 1st USB.

Peter.
peter_irich
 
Posts: 1234
Joined: 2009-09-10 20:15
Location: Saint-Petersburg, Russian Federation

Re: Failing to boot from SDB1

Postby p.H » 2018-10-07 09:54

BPR wrote:The computer boots, but then gets into kernel panic and drops into shell reporting "no SDB1 was been found"

The computer cannot get into kernel panic and drop into shell at the same time. It is either one or the other, not both.
When there is no initrd/initramfs and the kernel is in charge of mounting the root filesystem but fails to do so, it gets into kernel panic. When there is an initrd/initramfs in charge of mounting the root filesystem but fails to do so, it drops into to a shell.

The root filesystem specification is recorded in the boot loader configuration and passed to the kernel command line in the root= parameter. Normally it uses the filesystem UUID instead of the device node name because the latter is not stable. But for a reason yet unknown to me, sometimes after the installation it happens that /boot/grub/grub.cfg contains the device name instead of the UUID. This is usually fixed by running update-grub from the installed system. In order to boot properly the first time, you can modify the root= parameter in the boot menu entry with GRUB's embedded editor (type "e" and follow instructions).
Last edited by p.H on 2018-10-11 11:07, edited 1 time in total.
p.H
 
Posts: 645
Joined: 2017-09-17 07:12

Re: Failing to boot from SDB1

Postby p.H » 2018-10-07 09:58

debiman wrote:i don't think it's hardcoded.

It is, in /boot/grub/grub.cfg. Otherwise where would it come from ?
Last edited by p.H on 2018-10-11 11:08, edited 1 time in total.
p.H
 
Posts: 645
Joined: 2017-09-17 07:12

Re: Failing to boot from SDB1

Postby p.H » 2018-10-07 10:15

peter_irich wrote:next time insert as 1st that USB on which you will install Linux and the insert USB from which
you will install Linux and after will be removed.

It is not that simple. The source device must obviously be inserted before booting, because you want to boot from it. So inserting the target device first just means that both devices are already inserted before booting the kernel. In this situation the device names only depend on the discovery order by the kernel. The kernel does not care which device was inserted first before it was booted.

If you want the target device to be sda, you can try to swap the USB devices and ports, in hope that the discovery order is tied to USB ports. Or you can do this :
- insert the source device and boot the installer
- while the installer asks the first question about language, remove the source device (not mounted yet)
- insert the destination device -> becomes sda
- insert the source device again -> becomes sdb
- resume the installation procedure
p.H
 
Posts: 645
Joined: 2017-09-17 07:12

Re: Failing to boot from SDB1

Postby BPR » 2018-10-07 11:41

debiman wrote:i don't understand why you need 2 USBs? why don't you just install from one USB, and make sure grub is installed to the internal hard disk?

B/c I don't have a hard disk and like to boot from different USB's ? or, should I say usb's ...
BPR
 
Posts: 7
Joined: 2018-10-07 08:48

Re: Failing to boot from SDB1

Postby BPR » 2018-10-07 11:59

p.H wrote:The root filesystem specification is recorded in the boot loader configuration and passed to the kernel command line in the root= parameter. Normally it uses the filesystem UUID instead of the device node name because the latter is not stable. But for a reason yet unknown to me, sometimes after the installation it happens that /boot/grub/grub.cfg contains the device name instead of the UUID. This is usually fixed by running update-grub from the installed system. In order to boot properly the first time, you can modify the root= parameter in the boot menu entry with GRUB's embedded editor (type "e" and follow instructions).

Yes, it's clearly a bug - this should use the UUID of the USB stick.
I would like to fix the boot sector on the target USB, as you say "fixed by running update-grub from the installed system." How do I do that?
When it bombs out at boot, it goes to some shell CLI prompt, shall I hit "e" ? What's the path to the grub's config file where it has this entry, root=

And thank you for NOT being an incompetent prick lecturing me about case-sensitive acronyms ;)
BPR
 
Posts: 7
Joined: 2018-10-07 08:48

Re: Failing to boot from SDB1

Postby p.H » 2018-10-07 12:26

BPR wrote:I would like to fix the boot sector on the target USB

Please read me carefully. The boot sector does not need to be fixed. /boot/grub/grub.cfg does.

BPR wrote:How do I do that?
When it bombs out at boot, it goes to some shell CLI prompt, shall I hit "e" ?

Please read me carefully. Press "e" at the GRUB boot menu.
When the initramfs shell is started, it is already too late.
You might create a (volatile) symlink /dev/sdb1 pointing to /dev/sda1 as a temporary workaround and press Ctrl+d to resume boot, but this is really ugly.
Code: Select all
ln -s /dev/sda1 /dev/sdb1


BPR wrote: What's the path to the grub's config file

Please read me carefully. I mentioned the full path.
Last edited by p.H on 2018-10-07 12:28, edited 1 time in total.
p.H
 
Posts: 645
Joined: 2017-09-17 07:12

Re: Failing to boot from SDB1

Postby GarryRicketson » 2018-10-07 12:27

Did the OP even try ?

How to run update-grub on a installed Debian system
===========
On Debian What's the path to the grub config file where it has this entry, root=

The very first hit:
Grub - Debian Wiki
https://wiki.debian.org/GrubProxy Highlight
18 Oct 2015 ... GRUB is the GRand Unified Bootloader, a very powerful newish ...
The configuration file is /boot/grub/grub.cfg, but you shouldn't edit it directly. ... insta


Please make at least some effort to find answers yourself, and before calling me a incompetent prick, as well, read this:
Please Read.. What we expect you have already Done.

Also it would be nice if the OP reads this :
Forum guidelines. Please read before first post!
User avatar
GarryRicketson
 
Posts: 5192
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: Failing to boot from SDB1

Postby peter_irich » 2018-10-07 16:57

p.H wrote:
peter_irich wrote:next time insert as 1st that USB on which you will install Linux and the insert USB from which
you will install Linux and after will be removed.

It is not that simple. The source device must obviously be inserted before booting, because you want to boot from it. So inserting the target device first just means that both devices are already inserted before booting the kernel. In this situation the device names only depend on the discovery order by the kernel. The kernel does not care which device was inserted first before it was booted.

But when you are installing system from usb-stick or from DVD on HDD or SSD in your computer,
target device already is in computer. You can choice boot order in BIOS SETUP.

Peter.
peter_irich
 
Posts: 1234
Joined: 2009-09-10 20:15
Location: Saint-Petersburg, Russian Federation

Re: Failing to boot from SDB1

Postby p.H » 2018-10-07 18:23

The BIOS/UEFI boot order has no effect on the discovery order by the Linux system.
Even when booting from USB, sda is almost always the internal ATA disk because the USB mass storage driver adds a 1-second delay when detecting a device.
p.H
 
Posts: 645
Joined: 2017-09-17 07:12

Re: Failing to boot from SDB1

Postby debiman » 2018-10-09 17:47

p.H wrote:
debiman wrote:i don't think it's hardcoded.

It is, in /boot/grub/grub/cfg. Otherwise where would it come from ?

if that's your definition of hardcoded i rest my case.
anyhow, i meant it's not hardcoded in the installer, in other words one gets a choice.

the problem is simple; if there's no hard drive in the machine, debian must install the bootloader to one of the two USBs.
apparently the wrong one was chosen.
even so, garyricketson pointed out a possible fix.
User avatar
debiman
 
Posts: 3064
Joined: 2013-03-12 07:18

Re: Failing to boot from SDB1

Postby BPR » 2018-10-11 07:48

debiman wrote:
p.H wrote:
debiman wrote:i don't think it's hardcoded.

It is, in /boot/grub/grub/cfg. Otherwise where would it come from ?

if that's your definition of hardcoded i rest my case.
anyhow, i meant it's not hardcoded in the installer, in other words one gets a choice.

the problem is simple; if there's no hard drive in the machine, debian must install the bootloader to one of the two USBs.
apparently the wrong one was chosen.
even so, garyricketson pointed out a possible fix.


1) It IS hard-coded. When I installed OS from USB, it recognised itself as sda and the target USB - as sdb
at the end of install it asked me where to install GRUB - onto sda or to sdb, and i chose sdb (my new boot drive
so it HARD coded onto the target boot USB that it's assigned as sdb1 assuming that source USB with ISO will be always stuck into my USB port. But it's not, and as soon as I boot from target USB it's assigned sdA. This should be dynamic and OS should boot from where it boots from, and not from where Grub config has been written (i.e. sdB)
2) Okay, I get to the grub> prompt booting from the boot disk (now sdA)
what do I need to type exactly, to edit the Grub config on it and overwrite sdb1 to sda1 (or dev/sda ?)

Thank you
BPR
 
Posts: 7
Joined: 2018-10-07 08:48

Re: Failing to boot from SDB1

Postby BPR » 2018-10-11 08:01

Update
at grub> I typed
grub> root=/dev/sda1
grub> exit
pressed [escape]
screen turned black, then back to boot splash. Now it says "Loading initial ramdisk" ... and it's hung :oops:

What is the use case for hard-coding the boot device into grub config, anyway??
Like, "I boot from a USB, but my OS is on my hard drive"?
BPR
 
Posts: 7
Joined: 2018-10-07 08:48

Next

Return to Installation

Who is online

Users browsing this forum: No registered users and 7 guests

fashionable