Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

From here: http://fedoraproject.org/wiki/Common_kernel_problems#Can.27t_find_root_filesystem_.2F_error_mounting_.2Fdev.2Froot

A lot of these bugs end up being a broken initrd due to bugs in mkinitrd.

Get the user to attach their initrd for their kernel to the bz, and also their /etc/modprobe.conf, or have them examine the contents themselves if they are capable of that.

Picking apart the initrd of a working and failing kernel and doing a diff of the init script can reveal clues. To take apart an initrd, do the following ..

mkdir initrd   
 cd initrd/   
 gzip -dc /boot/initrd-2.6.23-0.104.rc3.fc8.img | cpio -id 

I wish to understand what exactly is being done here.
What has initrd to do with anything?
Where are we supposed to create the directory initrd?

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

An initrd (short for “initial RAM drive”) is a filesystem that's mounted when the Linux kernel boots, before the “real” root filesystem. This filesystem is loaded into memory by the bootloader, and remains in memory until the real boot. The kernel executes the program /linuxrc on the initrd; its job is to mount the real root, and when /linuxrc terminates the kernel runs /sbin/init.

A bug somewhere in the initrd can explain why the system doesn't boot. So the document you link to recommends that you compare your initrd with an official one if you have trouble booting.

In the provided instructions, initrd is just some temporary directory, you can call it anisha_initrd or fred if you like. The initrd is stored in the file /boot/initrd-SOMETHING.img as a gzipped cpio archive; the instructions unpack that archive in the temporary directory you created. After unpacking, you can compare it with an official initrd (unpack the official initrd and run a command like diff -ru /path/to/official_initrd /path/to/anisha_initrd).

share|improve this answer
    
Thanks for the detailed explanation of the initrd. –  TheIndependentAquarius Feb 7 '12 at 7:43
add comment

The steps you referred to describe how to examine an initrd image, i.e., how to unpack (via gzip and cpio) the initrd-2.6.23-0.104.rc3.fc8.img file into a directory (initrd/ here, created anywhere, with mkdir). It's just a step towards finding the problem, no solution in itself.

share|improve this answer
    
Thanks, What is an initrd image? in brief, if you can. :) –  TheIndependentAquarius Jan 19 '12 at 10:28
    
"initrd" is short for "initial ram disk", it's an image the Linux kernel loads into memory as one step of the boot process, for example to load modules that might be needed (e.g. "LVM") -- AFAIK; better look at Wikipedia :) –  sr_ Jan 19 '12 at 10:32
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.