2006-11-11 08:52:24

by jurriaan

[permalink] [raw]
Subject: wanted: more informative message if root device can't be found/mounted

I'm experimenting with turning off the PATA drivers and use SATA only,
since all my devices are now found by the SATA drivers in
2.6.19-rc5-mm1.

There is one area in which the kernel could, I think, do better. When
booting, there's no way for me to know where /dev/hda is going to end
up.

When the kernel mentions it can't mount the root device, all information
about the 12 harddisks in this system has long scrolled off the screen.

It would be really nice to see something like this:

kernel panic - unable to mount root device 09:02
Possible devices:

scsi 0:0:0:0: Direct-Access ATA ST3250823AS 3.03 PQ: 0 ANSI: 5
SCSI device sda: 488397168 512-byte hdwr sectors (250059 MB)
sda: sda1
scsi 1:0:0:0: Direct-Access ATA ST3250823AS 3.03 PQ: 0 ANSI: 5
SCSI device sdb: 488397168 512-byte hdwr sectors (250059 MB)
sdb: sdb1
scsi 2:0:0:0: Direct-Access ATA ST3250823AS 3.03 PQ: 0 ANSI: 5
SCSI device sdc: 488397168 512-byte hdwr sectors (250059 MB)
sdc: sdc1
scsi 3:0:0:0: Direct-Access ATA ST3250823AS 3.02 PQ: 0 ANSI: 5
SCSI device sdd: 488397168 512-byte hdwr sectors (250059 MB)
sdd: sdd1
scsi 4:0:0:0: Direct-Access ATA ST3300622AS 3.AA PQ: 0 ANSI: 5
SCSI device sde: 586072368 512-byte hdwr sectors (300069 MB)
sde: sde1 sde2
scsi 5:0:0:0: Direct-Access ATA ST3250823AS 3.03 PQ: 0 ANSI: 5
SCSI device sdf: 488397168 512-byte hdwr sectors (250059 MB)
sdf: sdf1
scsi 6:0:0:0: Direct-Access ATA ST3300622AS 3.AA PQ: 0 ANSI: 5
SCSI device sdg: 586072368 512-byte hdwr sectors (300069 MB)
sdg: sdg1 sdg2
scsi 7:0:0:0: Direct-Access ATA ST3250823AS 3.03 PQ: 0 ANSI: 5
SCSI device sdh: 488397168 512-byte hdwr sectors (250059 MB)
sdh: sdh1
scsi 8:0:0:0: Direct-Access ATA WDC WD2000JB-32E 15.0 PQ: 0 ANSI: 5
SCSI device sdi: 390721968 512-byte hdwr sectors (200050 MB)
sdi: sdi1 sdi2 < sdi5 sdi6 sdi7 sdi8 sdi9 >
scsi 9:0:0:0: Direct-Access ATA WDC WD2000JB-00F 15.0 PQ: 0 ANSI: 5
SCSI device sdj: 390721968 512-byte hdwr sectors (200050 MB)
sdj: sdj1 sdj2 < sdj5 sdj6 sdj7 sdj8 sdj9 >
scsi 10:0:0:0: Direct-Access ATA WDC WD2500JB-00F 15.0 PQ: 0 ANSI: 5
SCSI device sdk: 488397168 512-byte hdwr sectors (250059 MB)
sdk: sdk1
scsi 12:0:0:0: Direct-Access ATA ST3300831A 3.01 PQ: 0 ANSI: 5
SCSI device sdl: 586072368 512-byte hdwr sectors (300069 MB)
sdl: sdl1

Or, even shorter:

kernel panic - unable to mount root device 09:02
Available devices/partitions:
scsi 0:0:0:0 ST3250823AS 3.03 (2500059 MB) sda: 1
scsi 1:0:0:0 ST3250823AS 3.03 (2500059 MB) sdb: 1
scsi 2:0:0:0 ST3250823AS 3.03 (2500059 MB) sdc: 1
scsi 3:0:0:0 ST3250823AS 3.02 (2500059 MB) sdd: 1
scsi 4:0:0:0 ST3300622AS 3.AA (3000069 MB) sde: 1 2
scsi 5:0:0:0 ST3250823AS 3.03 (2500059 MB) sdf: 1
scsi 6:0:0:0 ST3300622AS 3.AA (3000069 MB) sdg: 1 2
scsi 7:0:0:0 ST3250823AS 3.03 (2500059 MB) sdh: 1
scsi 8:0:0:0 WDC WD2000JB-32E 15.0 (200050 MB) sdi: 1 2 <5 6 7 8 9>
scsi 9:0:0:0 WDC WD2000JB-00F 15.0 (200050 MB) sdj: 1 2 <5 6 7 8 9>
scsi 10:0:0:0 WDC WD2500JB-00F 15.0 (250059 MB) sdk: 1
scsi 12:0:0:0 ST3300831A 3.01 (300069 MB) sdl: 1

which at least gives some information on what harddisk has gone where. I
know there's more possibilities, like udev, netconsole, etc., but this
seems rather straight-forward. Even on a 80x25 screen, I'd say most
peoples devices should fit.

I'd appreciate hints or pseudo-code on how to walk through the various
lists need to get this information on the screen!

Kind regards,
Jurriaan
--
Corrupt, corrupt from the bottom to the top
And you tell me it's the law
The Levellers
Debian (Unstable) GNU/Linux 2.6.18-mm3 2x4826 bogomips load 0.24


2006-11-11 11:49:38

by Olaf Hering

[permalink] [raw]
Subject: Re: wanted: more informative message if root device can't be found/mounted

On Sat, Nov 11, jurriaan wrote:

> kernel panic - unable to mount root device 09:02

These numbers are the root cause.
Use mount by filesystem UUID. On-disk content does unlikely change.
And if it does, you have to reconfigure the bootloader anyway.

All this luxury doesnt belong into the kernel.

2006-11-11 11:57:40

by Arjan van de Ven

[permalink] [raw]
Subject: Re: wanted: more informative message if root device can't be found/mounted

On Sat, 2006-11-11 at 12:44 +0100, Olaf Hering wrote:
> On Sat, Nov 11, jurriaan wrote:
>
> > kernel panic - unable to mount root device 09:02
>
> These numbers are the root cause.
> Use mount by filesystem UUID. On-disk content does unlikely change.
> And if it does, you have to reconfigure the bootloader anyway.
>
> All this luxury doesnt belong into the kernel.

one thing that we should consider is to not panic(). Panic() tends to
cause the backscroll capability to go away.. which is rather useful to
see what went wrong for this scenario...

--
if you want to mail me at work (you don't), use arjan (at) linux.intel.com
Test the interaction between Linux and your BIOS via http://www.linuxfirmwarekit.org

2006-11-11 14:11:24

by Matt Domsch

[permalink] [raw]
Subject: Re: wanted: more informative message if root device can't be found/mounted

On Sat, Nov 11, 2006 at 12:57:37PM +0100, Arjan van de Ven wrote:
> On Sat, 2006-11-11 at 12:44 +0100, Olaf Hering wrote:
> > On Sat, Nov 11, jurriaan wrote:
> >
> > > kernel panic - unable to mount root device 09:02
> >
> > These numbers are the root cause.
> > Use mount by filesystem UUID. On-disk content does unlikely change.
> > And if it does, you have to reconfigure the bootloader anyway.
> >
> > All this luxury doesnt belong into the kernel.
>
> one thing that we should consider is to not panic(). Panic() tends to
> cause the backscroll capability to go away.. which is rather useful to
> see what went wrong for this scenario...

+1. To the untrained eye, "kernel panic" gets filed as a Sev 1 issue
by end users and testers alike, when most often it's a system
configuration error rather than a kernel bug.

--
Matt Domsch
Software Architect
Dell Linux Solutions linux.dell.com & http://www.dell.com/linux
Linux on Dell mailing lists @ http://lists.us.dell.com

2006-11-11 14:41:23

by Dr. David Alan Gilbert

[permalink] [raw]
Subject: Re: wanted: more informative message if root device can't be found/mounted

* jurriaan ([email protected]) wrote:

> When the kernel mentions it can't mount the root device, all information
> about the 12 harddisks in this system has long scrolled off the screen.
>
> It would be really nice to see something like this:
>
> kernel panic - unable to mount root device 09:02
> Possible devices:

I posted a patch to do this about 18 months ago against 2.6.11rc5:

http://marc.theaimsgroup.com/?l=linux-kernel&m=110946077026065&w=2

As people have pointed out the other problem is the lack of scroll
back after panic; if you have a reasonable number of partitions
then it is a pain.

Dave
--
-----Open up your eyes, open up your mind, open up your code -------
/ Dr. David Alan Gilbert | Running GNU/Linux on Alpha,68K| Happy \
\ gro.gilbert @ treblig.org | MIPS,x86,ARM,SPARC,PPC & HPPA | In Hex /
\ _________________________|_____ http://www.treblig.org |_______/

2006-11-13 16:01:08

by Phillip Susi

[permalink] [raw]
Subject: Re: wanted: more informative message if root device can't be found/mounted

jurriaan wrote:
> I'm experimenting with turning off the PATA drivers and use SATA only,
> since all my devices are now found by the SATA drivers in
> 2.6.19-rc5-mm1.
>
> There is one area in which the kernel could, I think, do better. When
> booting, there's no way for me to know where /dev/hda is going to end
> up.
>


You might try using a distribution with an initramfs that performs
proper hardware detection, and can mount the root volume by ID rather
than device path.