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.

I need to create initrd.img file from initrd.lz file. How may I do this?

share|improve this question
1  
Do you mean that you want your initrd to NOT be compressed? Why? –  psusi Mar 17 '12 at 2:18
add comment

1 Answer 1

Sadly, my blog is down, but from my internal copy, HTH:

How to edit RAM disk images

I really want to read more about how this nash/lvm stuff works on my server...

Editing Ramdisks (initrds)

Following are the steps that enable one to edit a ramdisk for any changes:

gunzip -c /boot/initrd-.img >initrd.img
mkdir tmpDir
mount -o loop initrd.img tmpDir/
cd tmpDir
# Make all necessary changes (copy over modules, edit linuxrc etc)
umount tmpDir
gzip -9c initrd.img >/boot/initrd-.img 

(stolen from http://openssi.org/cgi-bin/view?page=docs2/1.2/README.edit-ramdisk )

Follow-up

At some point, they stopped making them loopback ISOs and now they are just a compressed cpio archive:

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

The cpio is in the "new" format, so when recompressing, you need to use --format='newc'.

(stolen from http://fedoraproject.org/wiki/KernelCommonProblems )

share|improve this answer
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.