1826498 Members
1842 Online
109692 Solutions
New Discussion

Re: initrd

 
SOLVED
Go to solution
Chakravarthi
Trusted Contributor

initrd

is there any way to check the contents of .initrd file??

8 REPLIES 8
Slawomir Gora
Honored Contributor

Re: initrd

Hi,

I am not sure you are asking about /boot/initrd.gz file ?


on my system I can:
cd /tmp
cp /boot/initrd_2.6.11-mm1.gz
gzip -d initrd_2.6.11-mm1.gz
mount -o loop /tmp/initrd_2.6.11-mm1 /mnt/

replace you initrd file name with my initrd_2.6.11-mm1.gz
Chakravarthi
Trusted Contributor

Re: initrd

file what i'm taking about is xx.initrd

it is not a bz or tgz file

file returns it is data file
Slawomir Gora
Honored Contributor

Re: initrd

Hi,
did you try this ?

mount -o loop xx.initrd /mnt/
Gopi Sekar
Honored Contributor

Re: initrd


if it shows as data file then it is more likely that it is not having any filesystem in it, there is no point in trying to mount it in -oloop method.

I think the name initrd is given just to confuse you. Which application is creating file by this extension?

FYI: If the initrd contains the filesystem then when you put 'file ' then it should give something like 'Linux rev 1.0 ext2 filesystem data'

Hope this helps,
Gopi
Never Never Never Giveup
Chakravarthi
Trusted Contributor

Re: initrd

when i try mounting using -o loop option it gives the following error message

mount: you must specify the filesystem type
Gopi Sekar
Honored Contributor

Re: initrd


So it clearly means that you are trying to mount a file which is not having any file system in it, the name initrd is given just to confuse you.

Which application is using this type of file?

Regards,
Gopi
Never Never Never Giveup
Stuart Browne
Honored Contributor
Solution

Re: initrd

Generally an 'initrd' image is compressed, even if it doesn't have a '.gz' extension.

To check, you can use the 'file' command:

file initrd-2.4.22-1.2199.5.legacy.nptl.img
initrd-2.4.22-1.2199.5.legacy.nptl.img: gzip compressed data, from Unix, max compression

(this is on my fedora-core-1 machine).

The instructions Slawomir were pretty close.

So, either rename it to .gz, then uncompress it, or do it in pipes:

gzip -cd < initrd.img > loop-mount.img
mount -oloop loop-mount /mnt

and away you go.
One long-haired git at your service...
Mark Kounalis
New Member

Re: initrd

The way initrd stores it's information has changed. It's stored in a cpio file now - so after you uncompress the file you need to do a cpio -t < <> to see the contents.