Re: initrd and root= option



Joseph Harvell wrote:

> I have been using an initrd booting Linux for a long time now. But I
> have never understood the meaning of root= with an initrd and now that I
> am switching from devfs to udev, I can't seem to get the system to boot
> at all no matter what I pass in for root=. I used to pass in
> /dev/ram/0, and then pivot_root to the real root filesystem. But now I
> get a panic complaining about an invalid root device even before the
> initrd is mounted. I have tried /dev/ram/0 and /dev/ram0. My actual
> root filesystem is ext3 and resides on an LVM logical volume. In
> devfs, the block device would be /dev/london/root. Based on how I have
> udev setup, it would be /dev/london-root.
>
> So what is supposed to be passed in to root= when using an initrd? Is
> it the ramdisk or is it what the root filesystem will eventually be?
> And how does /proc/sys/kernel/real-root-dev play into this?

It is completely up to your initrd (meaning most likely your distribution).
If you use RH derivative mkinitrd, then root= is supposed to be real root
device. Kernel computes (attempts to) device number for it and stores as
real-root-dev; later on initrd script extracts it and creates /dev/root to
mount root on. It avoids hardcoding root path in initrd.

But you are free to hardcode root path in initrd ...

> Also, am I
> still supposed to be using pivot_root in Linux 2.6?
>

I can only say that it is still used by at least one major distro out
there ... do not break things that just work :)

To your original problem - if otherwise your initrd works, try passing
"root=/dev/ram". But I am rather confused that /dev/ram0 did not work. Do
you have CONFIG_BLK_DEV_RAM=y? Otherwise it is not going to work at all.

=arvi=

.



Relevant Pages

  • [PATCH] documentation: Documentation/initrd.txt
    ... the boot loader loads the kernel and the initial RAM disk ... frees the memory used by initrd ... initrd is mounted read-write as root ... linuxrc places the root file system at the root directory using the ...
    (Linux-Kernel)
  • Multibooting utilizing Kickstart & Grub (RHEL 3u6,3u8,3u9,4u6,...)
    ... # all kernel and initrd paths are relative to /boot/, ... # root ... title Red Hat Enterprise Linux WS ...
    (RedHat)
  • Re: Beige PowerMac G3/266 trouble
    ... that you still have to mount /dev/ram as root fs to make use of the ... initrd is mounted read-write as root ... you have to boot the kernel and load initrd. ... fs mounted under some other mount point, ...
    (comp.os.linux.powerpc)
  • Re: kernel panic
    ... echo Mounting /proc filesystem ... echo Mounting root filesystem ... Grub may have told the kernel to look in the wrong place for the root file system, the file system might be unreadable, or you may have moved the system onto a machine with a different type of disk controller that needs a different driver module included on the initrd. ... If your rescue boot mounts the system drives and suggests a chroot command, do that, then add the right alias command to /etc/modprobe.conf and then run mkinitrd. ...
    (Fedora)
  • Re: kernel panic
    ... echo Mounting /proc filesystem ... echo Mounting root filesystem ... Grub may have told the kernel to look in the wrong place for the root file system, the file system might be unreadable, or you may have moved the system onto a machine with a different type of disk controller that needs a different driver module included on the initrd. ... If your rescue boot mounts the system drives and suggests a chroot command, do that, then add the right alias command to /etc/modprobe.conf and then run mkinitrd. ...
    (Fedora)