Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I accidentally deleted the initrd image on my system. How do I restore it?

share|improve this question

This is the answer to the original question, how to extract the initrd.lz from the live CD, typically used if you are making a custom live CD.

copy the initrd.lz to a working directory ( ~)

cp /media/cdrom/initrd.lz ~

Make a directory to extract the contents to, I will use initrd, cd into the directory

mkdir ~/initrd
cd ~/initrd


lzma -dc -S .lz ../initrd.lz | cpio -imvd --no-absolute-filenames

Make any changes you might need, re-package

cd ~/initrd
find . | cpio --quiet --dereference -o -H newc | lzma -7 > ../cusotm.initrd.lz

Your new initrd will be in your home directory and called cusotm.initrd.lz

share|improve this answer
But how do I make it initrd.img like initrd.img-3.2.0-15-generic-pae? – Binoy Babu Mar 16 '12 at 23:20
I'm trying to use initrd from a livecd on my ubuntu install. Deleted it accidently. – Binoy Babu Mar 16 '12 at 23:26
Well, that is the hard way ;) use mkinitramfs – bodhi.zazen Mar 16 '12 at 23:48
@bodhi.zazen but how to repack this : ? – EdiD May 25 at 10:45

The initrd image for each kernel is built at kernel installation time from the modules and applications on the machine. You can simply build a missing initrd using the command below:

update-initramfs -c -k <version>

(Do remember to subsitute in the appropriate version for your kernel.)

share|improve this answer
when there is no existing initrd, the verbose of this command is nothing to be done (13.10) – mchid Feb 14 '14 at 23:05

This is a better way to solve the OP problem posted in the comments

I'm trying to use initrd from a livecd on my ubuntu install. Deleted it accidently. – Binoy Babu

To make an initramfs , first boot an alternate kernel (older is fine)

Then run

sudo mkinitramfs 3.2.0-15-generic-pae -o /boot/initrd.img-3.2.0-15-generic-pae

I do not have the pae kernel installed, if "3.2.0-15-generic-pae" does not work, list the contents of /lib/modules to get the name

ls /lib/modules

If you do not have an older kernel, you can boot a live CD and use chroot, let me know and I can add instructions to do that (chroot).

share|improve this answer

Your Answer


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.