Initrd entry in grub.conf and loading initrd in the kernel code

From: Dan Kaspi
Date: Thu Dec 16 2004 - 06:49:24 EST


I tried to understand the correlarion between initrd in grub.conf and the
call to initrd_load() in the kernel (under init subtree).
My question is : when we do not use initrd in grub (meaning there is no
entry for initrd in grub.conf), does the kernel still calls load_initrd()?
Or does it sets somehow the mount_initrd variable to false ? if so - how ?

Grepping the kernel for no_initrd() shows that do_mounts_initrd.c is the
"C" file where this method definition appears.
Does it have to do with the _setup call in this file : __setup("noinitrd",
no_initrd) ?

I did not see initrd it in the kernel command line:
When I run cat /proc/cmdline to see the kernel command line,
I do not see any mention of initrd (thoughin my grub.conf I DO USE initrd ).
What I see is:
ro root=/dev/hda3 hdb=none hdc=none hdd=none

Trying to understand the code raise some confusion (as is depicted below)
So I hope maybe one of the Mulixes knows something about it.

I had looked at 2.6.7 kernel.
what I see (under init subtree):

There is a variable named "mount_initrd" which is initialized to true (1)
in do_mounts_initrd.c

The initrd_load() method (also in do_mounts_initrd.c) checks this variable
if it is true it performs the load initrd process (creates /dev/ram0 and
the initrd data into it by calling rd_load_image() ).

There is a method named no_initrd() in this file which sets mount_initrd to
there is also a call to __setup("noinitrd", no_initrd);
(This macro calls __setup_param() in init.h ; it says there that it is
and send us to moduleparam.h.)


Express yourself instantly with MSN Messenger! Download today it's FREE!

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at