initrd, real-root-dev and device numbers

initrd, real-root-dev and device numbers

Post by root » Sat, 12 Dec 1998 04:00:00



   This is guaranteed to be one of those questions with an extremely
simple answer, but...
   I've got my boot disk running the way that I want it using initrd,
but I can't figure out how to get it to boot my main linux partition.
I've checked Documentation/initrd.txt as well as everything I could find
on the net, and while I know I need to stick the device number of the
root parition in /proc/sys/kernel/real-root-dev what I haven't been able
to find is any way to determine the device number I should insert.
   Documentation/initrd.txt uses /dev/hda1 as it's example, in which
case real-root-dev should contain 0x301.  Taking this concept I can get
/dev/hda1 and /dev/hdb working, but no dice with /devhdc1 - 0x2201
doesn't work (understandably).  I discovered by booting my system
normally and checking the value in real-root-dev that 5633 seems to be
the device number for /dev/hdc1, but how the hell you get that I
dunno.   I'd like to know how to calculate the necessar number so I'm
not stick with just the three devices I've got numbers for so far.

   Thanks
   -Tom

 
 
 

initrd, real-root-dev and device numbers

Post by Bjorn Wese » Sun, 13 Dec 1998 04:00:00



>   Documentation/initrd.txt uses /dev/hda1 as it's example, in which
>case real-root-dev should contain 0x301.  Taking this concept I can get
>/dev/hda1 and /dev/hdb working, but no dice with /devhdc1 - 0x2201
>doesn't work (understandably).

The numbers in /dev/hdc1 are in decimal, not hex. First one is the major
number, second is the minor. A complete device number is MAJOR << 8 | MINOR.

$ ls -l /dev/hdc1
brw-rw----   1 root     disk      22,   1 Feb  4  1995 /dev/hdc1

So the right device in hex is 0x1601, or 22*256+1=5633 in decimal.

Quote:> I discovered by booting my system
>normally and checking the value in real-root-dev that 5633 seems to be
>the device number for /dev/hdc1, but how the hell you get that I
>dunno.   I'd like to know how to calculate the necessar number so I'm
>not stick with just the three devices I've got numbers for so far.

real-root-dev apparently returns the decimal value. But it can swallow both
decimal and hexadecimal, so you could give it either 5633 or 0x1601.

/Bjorn

 
 
 

initrd, real-root-dev and device numbers

Post by H. Peter Anv » Sun, 13 Dec 1998 04:00:00




In newsgroup: comp.os.linux.development.system


> >   Documentation/initrd.txt uses /dev/hda1 as it's example, in which
> >case real-root-dev should contain 0x301.  Taking this concept I can get
> >/dev/hda1 and /dev/hdb working, but no dice with /devhdc1 - 0x2201
> >doesn't work (understandably).

> The numbers in /dev/hdc1 are in decimal, not hex. First one is the major
> number, second is the minor. A complete device number is MAJOR << 8 | MINOR.

> $ ls -l /dev/hdc1
> brw-rw----   1 root     disk      22,   1 Feb  4  1995 /dev/hdc1

> So the right device in hex is 0x1601, or 22*256+1=5633 in decimal.

> > I discovered by booting my system
> >normally and checking the value in real-root-dev that 5633 seems to be
> >the device number for /dev/hdc1, but how the hell you get that I
> >dunno.   I'd like to know how to calculate the necessar number so I'm
> >not stick with just the three devices I've got numbers for so far.

> real-root-dev apparently returns the decimal value. But it can swallow both
> decimal and hexadecimal, so you could give it either 5633 or 0x1601.

> /Bjorn

I would once again propose that the initrd system is changed in such a
way that the initrd does an explicit mount, and pass the path, rather
than the device number to be mounted; at the very least as an option.

        -hpa
--
    PGP: 2047/2A960705 BA 03 D3 2C 14 A8 A8 BD  1E DF FE 69 EE 35 BD 74
    See http://www.zytor.com/~hpa/ for web page and full PGP public key
        I am Bah' -- ask me about it or see http://www.bahai.org/
   "To love another person is to see the face of God." -- Les Misrables

 
 
 

1. initrd, kernel modules and root=/dev/cdrom

Hi,

I want to make a bootfloppy (or something equivalent) that will allow an unattended full-reboot on a hard-diskless machine (whose
root is on an NFS server).  Boot-Root disk sets require manual intervention to successfully boot.  Was wondering about using both
the floppy AND cdrom.

My initrd works just fine and gets me 'that' far.
I put the rootfs on a CDROM (using the now ubiquitous CD-writers) -- lets not get to how could I possible put the /dev contents
correctly on it :-) using the iso format.

Tried booting with the lilo-option 'root=/dev/hdd'
The kernel panics with 'Unable to mount root fs on 16:40'.   The initrd has the /dev/hd* in it.

Before that I see that it successfully loads the two modules for ISO CDROMs and ethernet card (  nls_iso8859-1  and e100
respectively).  No other module is loaded.  After e100 module is loaded, the ethernet card is detected good!

initrd_helper version 1.1

# ls -l /dev/hdd
brw-rw----    1 root     cdrom     22,  64 Apr 14  2001 /dev/hdd

Can someone help me with some tips on why it failed (and if you know more, how I can succeed  --or-- how I am on a fruitless quest).

Thanks in advance

Sarma

P.S : If I added 'nfs' as the third kernel module, I get too many kernel errors.
        what kernel-module does the nfs kernel-module need (or depend on)?

2. chmod for /tmp

3. Root Aliases & Lock-ups on Mount w/ Initrd (was Re: initrd: couldn'tumount)

4. How to "untar" sth?

5. How to decide the number of /dev/cWtXdYsZ under /dev/dsk and /dev/rdsk?

6. soundblaster 16ASP configure ?

7. tape device bulebud01 / 57 <> mt status /dev/rmt/3n /dev/rmt/0n: Device busysy?

8. Radeon 9000 question

9. Getting the real tty device name (/dev/tty not good enough)

10. Real life TCO based on real life numbers.

11. major, minor device numbers in /dev ?

12. Device numbers for /dev/kbd?

13. Root-on-NFS /dev has incorrect major/minor numbers