0

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

1
  • 1
    Do you mean that you want your initrd to NOT be compressed? Why?
    – psusi
    Mar 17, 2012 at 2:18

1 Answer 1

2

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 )

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .