LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Kernel (https://www.linuxquestions.org/questions/linux-kernel-70/)
-   -   Question on initial RAM disk? (https://www.linuxquestions.org/questions/linux-kernel-70/question-on-initial-ram-disk-568940/)

KiraII 07-12-2007 11:52 PM

Question on initial RAM disk?
 
I am working on put a mini linux system into my U key, I use grub as my bootloader, when booting, grub should load kernel and initrd image into memory.
In my view, initrd is the first root filesystem, but how can the kernel aware of the initrd and mount it as a root filesytem?

reddazz 07-13-2007 12:24 AM

Hi and welcome to LQ.

This article may help you out.

blackhole54 07-13-2007 12:27 AM

If I understand your question correctly, the bootloader takes care of this.

In the case of GRUB, this is done with the initrd statement as shown in the sample entry below:

Code:

title          Ubuntu, kernel 2.6.17-11-generic
root            (hd0,0)
kernel          /boot/vmlinuz-2.6.17-11-generic root=/dev/sda1 ro noisy
initrd          /boot/initrd.img-2.6.17-11-generic
quiet
savedefault
boot


KiraII 07-13-2007 12:55 AM

I think, Grub only load kernel and initrd into memory, but it can't mount ramfs for the kernel, is it?
maybe the bootloader pass information of where is the initrd settled to the kernel, is there a mechenism in kernel to get the information?

blackhole54 07-13-2007 01:52 AM

Quote:

Originally Posted by KiraII
I think, Grub only load kernel and initrd into memory, but it can't mount ramfs for the kernel, is it?
maybe the bootloader pass information of where is the initrd settled to the kernel, is there a mechenism in kernel to get the information?

I am not sure of the details of the magic that happens, but after the kernel boots, the initrd will be mounted and the kernel will be able to pass control to /etc/init, (contained in the initrd) or whatever file was specified on the boot line. My understanding of ramfs is that it is different from initrd, and I don't have much knowledge of it. I believe ramfs is contained in the compressed kernel image itself.


All times are GMT -5. The time now is 09:09 AM.