Ubuntu – How to restore an accidentally deleted initrd image kernel I accidentally deleted the initrd image on my system. How do I restore it? Best Answer 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 Extract 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 Related SolutionsUbuntu – Switch to a targeted initrd after setup Edit /etc/initramfs-tools/initramfs.conf and change MODULES=most to MODULES=dep then run update-initramfs -u Ubuntu – Accidentally deleted “linux-image-generic” – how to recover There's a permission error when accessing /etc/default/grub which let's the update process fail. As your current system seems to be broken, use a live CD to access it via the chroot method. See points 1 - 5 in this answer on how to chroot into your system. Check with ls -al /etc/default/grub that the file has following permissions: -rw-r--r-- 1 root root 1310 2011-03-31 22:21 /etc/default/grub If it hasn't, run chmod 644 /etc/default/grub Now let the system continue the upgrade: dpkg --configure -a If you get warnings that tell you to run apt-get install -f just do so. Just to make sure: update-initramfs -c -k all If that creates something, then at least you got a kernel to boot. Make sure it's in your kernel list at boot: update-grub Follow the steps 7. and 8. in the above linked answer. Related QuestionUbuntu – Switch to a targeted initrd after setupUbuntu – Accidentally deleted “linux-image-generic” – how to recoverUbuntu – Accidentally deleted all kernel versions
Best Answer
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 (
~
)Make a directory to extract the contents to, I will use
initrd
, cd into the directoryExtract
Make any changes you might need, re-package
Your new initrd will be in your home directory and called
cusotm.initrd.lz