Skip to contentSkip to conversation

root= needs hex in 2.6.0-test1-mm2

DISCUSSION Tom Felker 8 participants 10 messages Jul 23, 2003 VFS

lore
Share & tools
lore

Tom Felker

author
#0 lore raw

I finally booted 2.6.0-test1-mm2, after reading somebody else who needed to use hex in the root= argument. root=/dev/hdb1 and root=hdb2 would panic ("VFS: Cannot open root device hdb1 or unknown-block(0,0)"), but root=0341 worked. Devfs is compiled in, devfs=nomount and devfs=mount make no difference. Is this intentional?

Signature · 4 lines
Tom Felker

Try not!  Do! or do not.  There is no try.
 -- Yoda
#1 lore raw
Quoted 5 lines · Tom Felker

I finally booted 2.6.0-test1-mm2, after reading somebody else who needed to use hex in the root= argument. root=/dev/hdb1 and root=hdb2 would panic ("VFS: Cannot open root device hdb1 or unknown-block(0,0)"), but root=0341 worked. Devfs is compiled in, devfs=nomount and devfs=mount make no difference. Is this intentional?

I would say it's a bug :-)

#2 lore raw
Quoted 1 line · On 23 Jul 2003 14:20:21 +0200 Felipe Alfaro Solana…

I would say it's a bug :-)

"It's not a bug, it's an undocumented feature" ;)

On the one hand it sounds reasonable tom me that I cannot use the device "path", because devfs sets it, but why has it changed? It seemed to work well with older kernel versions. And what do the hex numbers stand for?

TIA
Florian Huber

#3 lore raw
Quoted 11 lines · Florian Huber
Quoted 1 line · On 23 Jul 2003 14:20:21 +0200 Felipe Alfaro Solana…

I would say it's a bug :-)

"It's not a bug, it's an undocumented feature" ;)

On the one hand it sounds reasonable tom me that I cannot use the device "path", because devfs sets it, but why has it changed? It seemed to work well with older kernel versions. And what do the hex numbers stand for?

First two are the device major, second two are the minor.

$ ls -l /dev/hdb1
brw-rw----    1 root     disk       3,  65 Jan 30 05:24 /dev/hdb1

-> root=0341

Signature · 2 lines
Charles Lepple <ghz.cc!clepple>
http://www.ghz.cc/charles/
#4 lore raw
In reply to Tom Felker
Quoted 5 lines · Tom Felker

I finally booted 2.6.0-test1-mm2, after reading somebody else who needed to use hex in the root= argument. root=/dev/hdb1 and root=hdb2 would panic ("VFS: Cannot open root device hdb1 or unknown-block(0,0)"), but root=0341 worked. Devfs is compiled in, devfs=nomount and devfs=mount make no difference. Is this intentional?

Yes. If you use devfs you have to use devfs names for root=. It's pretty simple. Best option of course is to avoid devfs.

#5 lore raw
Quoted 9 lines · Christoph Hellwig
Quoted 5 lines · Tom Felker

I finally booted 2.6.0-test1-mm2, after reading somebody else who needed to use hex in the root= argument. root=/dev/hdb1 and root=hdb2 would panic ("VFS: Cannot open root device hdb1 or unknown-block(0,0)"), but root=0341 worked. Devfs is compiled in, devfs=nomount and devfs=mount make no difference. Is this intentional?

Yes. If you use devfs you have to use devfs names for root=. It's pretty simple. Best option of course is to avoid devfs.

I didn't compile devfs in... However, root=/dev/xxx caused a panic during bootup. So, I guess those panics aren't related exclusively to devfs.

What's really strange on this issue is that I haven't still heard any response from the kernel gurus :-?

#6 lore raw
Quoted 3 lines · El 23 Jul 2003 17:08:31 +0200 Felipe Alfaro Solana…

I didn't compile devfs in... However, root=/dev/xxx caused a panic during bootup. So, I guess those panics aren't related exclusively to devfs.

I can confirm this. It happens without devfsd.
The hex trick worked ;)

#7 lore raw
Quoted 8 lines · Diego Calleja García
Quoted 3 lines · El 23 Jul 2003 17:08:31 +0200 Felipe Alfaro Solana…

I didn't compile devfs in... However, root=/dev/xxx caused a panic during bootup. So, I guess those panics aren't related exclusively to devfs.

I can confirm this. It happens without devfsd.
The hex trick worked ;)

In case you missed it, Daniel McNeil posted this patch here:
http://marc.theaimsgroup.com/?l=linux-kernel&m=105898580610066&w=2
For some odd reason, that mail didn't show up in my lkml box, but I grabbed his patch from the above, and it had some weird mailer mangling in the archive, but nothing difficult to fix.

The patch works for me. Now I can boot 2.6.0-test1-mm2 with root=/dev/hda1 and no hex tricks.

Here is Daniel's patch.

Steven

init/do_mounts.c renamed from init/do_mounts.c.orig +7 -2
@@ -58,6 +58,7 @@
 	char *s;
 	int len;
 	int fd;
+	unsigned int maj, min;
 
 	/* read device number from .../dev */
 
@@ -70,8 +71,12 @@
 	if (len <= 0 || len == 32 || buf[len - 1] != '\n')
 		goto fail;
 	buf[len - 1] = '\0';
-	res = (dev_t) simple_strtoul(buf, &s, 16);
-	if (*s)
+	/*
+	 * The format of dev is now %u:%u -- see print_dev_t()
+	 */
+	if (sscanf(buf, "%u:%u", &maj, &min) == 2)
+		res = MKDEV(maj, min);
+	else
 		goto fail;
 
 	/* if it's there and we are not looking for a partition - that's it */
#8 lore raw
In reply to Christoph Hellwig
Quoted 9 lines · Christoph Hellwig
Quoted 5 lines · Tom Felker

I finally booted 2.6.0-test1-mm2, after reading somebody else who needed to use hex in the root= argument. root=/dev/hdb1 and root=hdb2 would panic ("VFS: Cannot open root device hdb1 or unknown-block(0,0)"), but root=0341 worked. Devfs is compiled in, devfs=nomount and devfs=mount make no difference. Is this intentional?

Yes. If you use devfs you have to use devfs names for root=. It's pretty simple. Best option of course is to avoid devfs.

ie use

root=/dev/ide/host0/bus0/target1/lun0/part1

or equivalent

author
#9 lore raw
Quoted 11 lines · Con Kolivas
Quoted 9 lines · Christoph Hellwig
Quoted 5 lines · Tom Felker

I finally booted 2.6.0-test1-mm2, after reading somebody else who needed to use hex in the root= argument. root=/dev/hdb1 and root=hdb2 would panic ("VFS: Cannot open root device hdb1 or unknown-block(0,0)"), but root=0341 worked. Devfs is compiled in, devfs=nomount and devfs=mount make no difference. Is this intentional?

Yes. If you use devfs you have to use devfs names for root=. It's pretty simple. Best option of course is to avoid devfs.

Quoted 7 lines

From the perspective of an ignorant user, I kinda like the idea of devfs.

ie use

root=/dev/ide/host0/bus0/target1/lun0/part1

or equivalent

Yes, this worked. I guess now my question is, why does /dev/hdb1 work for 2.6.0-test1, but not 2.6.0-test1-mm2?

Also, I just started getting oopses during startup and shutdown with test1-mm2, EIP at ext3_journaling_dirty_data or something similar, followed by a bunch of file not found errors. I'm getting scared, I have valuable data on ext3. I'll be looking into some way to capture this.

Signature · 4 lines
Tom Felker

Hack user friendliness onto a pure and simple system, because
you can't hack purity and simplicity onto a user friendly system.