Sunday, January 9, 2005

How do I view my initrd file in Red Hat Enterprise Linux 4

The initrd file is a compressed cpio archive of a temporary root file system. To view the contents of the file copy it to a directory and name it with the .gz file extension:

# cp /boot/initrd-.img /tmp/initrd.gz

Then use the gunzip program to decompress the file. Renaming the file to have a .gz extension allows the file to to be decompressed with gzip.

# cd /tmp
# gunzip initrd-.gz

To view the file it must be extracted using the cpio command:

# mkdir initrd
# cd initrd
# cpio -cid -I ../initrd-

Use tree command to see directory structure and then do a cat on init script which has list of modules loaded into kernel.

No comments:

Post a Comment