• We should now be fully online following an overnight outage. Apologies for any inconvenience, we do not expect there to be any further issues.

How to force USB boot to /dev/sda?

Goi

Diamond Member
Oct 10, 1999
6,771
7
91
Hi,

I have a custom linux environment with a 2.6 kernel downloaded from kernel.org with a simple busybox shell as init. The system boots off a USB flash drive with root=/dev/sda with lilo, and it works perfectly when it's alone with no other SATA drives.

However, once I connect a SATA drive to the PC, from the bootup logs, it seems that the SATA drive is detected as sda, and the USB flash drive is detected as sdb, so I get a kernel panic with the following message

Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(8,1)
Pid: 1, comm: swapper Not tainted 2.6.37 #37

This is despite setting the boot order to boot from USB drives before SATA drives.

If I try to append the root=/dev/sdb boot option in LILO, I get a different kernel panic:

Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(8,16)
Pid: 1, comm: swapper Not tainted 2.6.37 #37

How do I get force the USB drive to be /dev/sda so that it boots up correctly?
 

lxskllr

No Lifer
Nov 30, 2004
60,100
10,567
126
Look into using UUID. It's the preferred method when addressing drives since it's unique to the drive. Dunno the specifics. I could search it out, but so could you :^D