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

By mistake the file initrd.img-3.11.0-20-generic has been deleted in directory /boot. Now the system doesn't boot anymore.

Is there a possibility to restore initrd.img-3.11.0-20-generic?

Output of blkid from live-cd:

ubuntu@ubuntu:~$ sudo blkid 
/dev/loop0: TYPE="squashfs" 
/dev/sda1: UUID="999feae4-d45b-4cbf-8015-ef5d62d952cd" TYPE="ext2" 
/dev/sda5: UUID="9k5hUW-e2Hq-IfIN-08zV-jjDd-0mHm-CHySv4" TYPE="LVM2_member" 
/dev/sr0: LABEL="Ubuntu 14.04 LTS amd64" TYPE="iso9660" 
/dev/mapper/ubuntu--vg-root: UUID="8cf4d204-bbf8-44e2-a3e4-0f8c618e67ef" TYPE="ext4" 
/dev/mapper/ubuntu--vg-swap_1: UUID="6a0999af-2cee-453f-9a01-7c878df6213e" TYPE="swap"

Update 29.05.2014:

Here's what I've entered (following the recommendations of mniess) with the system responses:

ubuntu@ubuntu:~$ sudo -i
root@ubuntu:~# mount /dev/mapper/ubuntu--vg-root /mnt
root@ubuntu:~# mount /dev/sda1 /mnt/boot
root@ubuntu:~# for i in dev dev/pts proc sys sys/firmware; do mount --bind /$i /mnt/$i; done
root@ubuntu:~# cp /etc/resolv.conf /mnt/etc/resolv.conf
root@ubuntu:~# chroot /mnt
root@ubuntu:/# apt-get update

System response after command apt-get update:

Ign trusty InRelease
Ign trusty-security InRelease     
Get:1 trusty-security Release.gpg [933 B]
Get:2 trusty Release.gpg [72 B]
Ign trusty InRelease                                       
Get:3 trusty-security Release [58.5 kB]
Hit trusty Release                                 
Ign trusty-updates InRelease                   
Ign trusty-backports InRelease                    
Ign trusty-proposed InRelease                     
Hit trusty Release.gpg                     
Hit trusty/main Sources
Get:4 trusty-security/main Sources [16.0 kB]
Get:5 trusty-updates Release.gpg [933 B]        
Hit trusty/main amd64 Packages
Hit trusty/main i386 Packages                                     
Get:6 trusty-backports Release.gpg [933 B]
Get:7 trusty-security/restricted Sources [14 B]
Get:8 trusty-security/universe Sources [4,212 B]                
Get:9 trusty-proposed Release.gpg [933 B]                     
Get:10 trusty-security/multiverse Sources [687 B]    
Hit trusty Release                                             
Get:11 trusty-security/main amd64 Packages [51.8 kB]             
Get:12 trusty-updates Release [58.5 kB]                                  
Get:13 trusty-security/restricted amd64 Packages [14 B]                     
Get:14 trusty-security/universe amd64 Packages [17.9 kB]                    
Get:15 trusty-security/multiverse amd64 Packages [1,154 B]                  
Get:16 trusty-backports Release [58.6 kB]                       
Get:17 trusty-security/main i386 Packages [49.4 kB]
Get:18 trusty-security/restricted i386 Packages [14 B]                       
Get:19 trusty-proposed Release [58.5 kB]       
Get:20 trusty-security/universe i386 Packages [17.9 kB]
Get:21 trusty-security/multiverse i386 Packages [1,404 B]                   
Hit trusty/main Sources                                         
Ign trusty/main Translation-en_US           
Hit trusty/restricted Sources
Hit trusty/universe Sources
Get:22 trusty-security/main Translation-en [24.4 kB]
Hit trusty/multiverse Sources                           
Ign trusty/main Translation-en                                            
Hit trusty/main amd64 Packages          
Ign trusty/main Translation-de
Hit trusty-security/multiverse Translation-en
Hit trusty/restricted amd64 Packages
Hit trusty-security/restricted Translation-en
Hit trusty/universe amd64 Packages
Hit trusty/multiverse amd64 Packages
Get:23 trusty-security/universe Translation-en [9,065 B]
Hit trusty/main i386 Packages                   
Hit trusty/restricted i386 Packages
Hit trusty/universe i386 Packages
Hit trusty/multiverse i386 Packages
Hit trusty/main Translation-en
Hit trusty/main Translation-de
Hit trusty/multiverse Translation-en
Hit trusty/multiverse Translation-de
Hit trusty/restricted Translation-en
Hit trusty/restricted Translation-de
Hit trusty/universe Translation-en
Hit trusty/universe Translation-de
Get:24 trusty-updates/main Sources [45.7 kB]
Get:25 trusty-updates/restricted Sources [14 B]
Get:26 trusty-updates/universe Sources [28.2 kB]
Ign trusty-security/main Translation-en_US 
Get:27 trusty-updates/multiverse Sources [2,234 B]
Ign trusty-security/main Translation-de    
Get:28 trusty-updates/main amd64 Packages [109 kB]
Ign trusty-security/multiverse Translation-en_US
Ign trusty-security/multiverse Translation-de
Get:29 trusty-updates/restricted amd64 Packages [14 B]
Ign trusty-security/restricted Translation-en_US   
Get:30 trusty-updates/universe amd64 Packages [74.9 kB]
Ign trusty-security/restricted Translation-de
Ign trusty-security/universe Translation-en_US
Get:31 trusty-updates/multiverse amd64 Packages [7,089 B]
Ign trusty-security/universe Translation-de 
Get:32 trusty-updates/main i386 Packages [107 kB]
Get:33 trusty-updates/restricted i386 Packages [14 B]
Get:34 trusty-updates/universe i386 Packages [75.3 kB]
Get:35 trusty-updates/multiverse i386 Packages [7,273 B]
Get:36 trusty-updates/main Translation-en [51.2 kB]
Hit trusty-updates/multiverse Translation-en
Hit trusty-updates/restricted Translation-en
Get:37 trusty-updates/universe Translation-en [33.8 kB]
Get:38 trusty-backports/main Sources [14 B]
Get:39 trusty-backports/restricted Sources [14 B]
Get:40 trusty-backports/universe Sources [4,123 B]
Get:41 trusty-backports/multiverse Sources [768 B]
Get:42 trusty-backports/main amd64 Packages [14 B]
Get:43 trusty-backports/restricted amd64 Packages [14 B]
Get:44 trusty-backports/universe amd64 Packages [4,099 B]
Get:45 trusty-backports/multiverse amd64 Packages [619 B]
Get:46 trusty-backports/main i386 Packages [14 B]
Get:47 trusty-backports/restricted i386 Packages [14 B]
Get:48 trusty-backports/universe i386 Packages [4,114 B]
Get:49 trusty-backports/multiverse i386 Packages [619 B]
Hit trusty-backports/main Translation-en
Get:50 trusty-backports/multiverse Translation-en [307 B]
Hit trusty-backports/restricted Translation-en
Get:51 trusty-backports/universe Translation-en [2,506 B]
Get:52 trusty-proposed/main amd64 Packages [88.4 kB]
Get:53 trusty-proposed/restricted amd64 Packages [14 B]
Get:54 trusty-proposed/multiverse amd64 Packages [14 B]
Get:55 trusty-proposed/universe amd64 Packages [16.6 kB]
Get:56 trusty-proposed/main i386 Packages [85.5 kB]
Get:57 trusty-proposed/restricted i386 Packages [14 B]
Get:58 trusty-proposed/multiverse i386 Packages [14 B]
Get:59 trusty-proposed/universe i386 Packages [16.7 kB]
Get:60 trusty-proposed/main Translation-en [40.7 kB]
Hit trusty-proposed/main Translation-de
Hit trusty-proposed/multiverse Translation-en
Hit trusty-proposed/multiverse Translation-de
Hit trusty-proposed/restricted Translation-en
Hit trusty-proposed/restricted Translation-de
Get:61 trusty-proposed/universe Translation-en [10.4 kB]
Hit trusty-proposed/universe Translation-de
Ign trusty/main Translation-en_US                                          
Ign trusty/multiverse Translation-en_US                                    
Ign trusty/restricted Translation-en_US                                    
Ign trusty/universe Translation-en_US                                      
Ign trusty-updates/main Translation-en_US                                  
Ign trusty-updates/main Translation-de                                     
Ign trusty-updates/multiverse Translation-en_US                            
Ign trusty-updates/multiverse Translation-de                               
Ign trusty-updates/restricted Translation-en_US                            
Ign trusty-updates/restricted Translation-de                               
Ign trusty-updates/universe Translation-en_US                              
Ign trusty-updates/universe Translation-de                                 
Ign trusty-backports/main Translation-en_US                                
Ign trusty-backports/main Translation-de                                   
Ign trusty-backports/multiverse Translation-en_US                          
Ign trusty-backports/multiverse Translation-de                             
Ign trusty-backports/restricted Translation-en_US                          
Ign trusty-backports/restricted Translation-de                             
Ign trusty-backports/universe Translation-en_US                            
Ign trusty-backports/universe Translation-de                               
Ign trusty-proposed/main Translation-en_US                                 
Ign trusty-proposed/multiverse Translation-en_US                           
Ign trusty-proposed/restricted Translation-en_US                           
Ign trusty-proposed/universe Translation-en_US                             
Fetched 1,250 kB in 8s (145 kB/s)                                                                       
Reading package lists... Done

Then I've entered:

   root@ubuntu:/# apt-get --reinstall install linux-image-3.11.0-20-generic

...and got the following reply:

Reading package lists... Done
Building dependency tree      
Reading state information... Done
Reinstallation of linux-image-3.11.0-20-generic is not possible, it cannot be downloaded.
The following package was automatically installed and is no longer required:
Use 'apt-get autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 1674 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue [Y/n]? Y
Setting up icaclient (12.1.0) ...
/var/lib/dpkg/info/icaclient.postinst: 696: /var/lib/dpkg/info/icaclient.postinst: nspluginwrapper: not found
dpkg: error processing icaclient (--configure):
 subprocess installed post-installation script returned error exit status 2
Errors were encountered while processing:
E: Sub-process /usr/bin/dpkg returned an error code (1)

Next I've entered:

root@ubuntu:/# update-grub

System replied:

Generating grub.cfg ...
Found linux image: /boot/vmlinuz-3.11.0-20-generic
Found linux image: /boot/vmlinuz-3.11.0-19-generic
Found linux image: /boot/vmlinuz-3.11.0-18-generic
Found linux image: /boot/vmlinuz-3.11.0-17-generic
Found linux image: /boot/vmlinuz-3.11.0-15-generic
Found linux image: /boot/vmlinuz-3.11.0-12-generic
Found memtest86+ image: /memtest86+.bin

Then I've entered:

root@ubuntu:/# grub-install

And got this:

Install device isn't specified.
Usage: grub-install [OPTION] [INSTALL_DEVICE]
Install GRUB on your drive.

  -h, --help              print this message and exit
  -v, --version           print the version information and exit
  --modules=MODULES       pre-load specified modules MODULES
  --boot-directory=DIR    install GRUB images under the directory DIR/grub
                          instead of the /boot/grub directory
  --target=TARGET         install GRUB for TARGET platform
  --directory=DIR         use GRUB images from DIR. Takes precedence
                          over target
  --grub-setup=FILE       use FILE as grub-setup
  --grub-mkimage=FILE     use FILE as grub-mkimage
  --grub-mkrelpath=FILE   use FILE as grub-mkrelpath
  --grub-probe=FILE       use FILE as grub-probe
  --allow-floppy          make the drive also bootable as floppy (default
                          for fdX devices). May break on some BIOSes.
  --recheck               delete device map if it already exists
  --force                 install even if problems are detected
  --force-file-id         use identifier file even if UUID is available
  --disk-module=MODULE    disk module to use (biosdisk or native). This
                          option is only available on BIOS target.
  --no-nvram              don't update the `boot-device' NVRAM
                          variable. This option is only available on
                          IEEE1275 targets.
  --removable             the installation device is removable. This option
                          is only available on EFI.
  --bootloader-id=ID      the ID of bootloader. This option is only
                      available on EFI.
  --efi-directory=DIR     use DIR as the EFI System Partition root.
  --uefi-secure-boot      install an image usable with UEFI Secure
                          Boot. This option is only available on EFI and if
                          the grub-efi-amd64-signed package is installed.
  --no-uefi-secure-boot   do not install an image usable with UEFI Secure
                          Boot, even if the system was currently started
                          using it. This option is only available on EFI.

INSTALL_DEVICE must be system device filename.

grub-install copies GRUB images into /boot/grub, and uses grub-setup
to install grub into the boot sector.

Report bugs to <>.

As you can see above the procedure has shown some errors. The result is that the system still doesn't boot. Does someone have an idea about how to resolve the errors?

share|improve this question
Can you boot into rescue mode? – eyoung100 May 14 '14 at 15:11
He can't, initrd is used for rescue mode too. – aastefanov May 14 '14 at 15:15

First of all, especially as a beginner, you should never edit files outside your user home directory. Don't manually mess with your system. Let Ubuntu take care of what files it needs when and where.

That said: It is a bit more involved but you can repair Ubuntu using a live-dvd or USB stick (USB is faster). I'll guide your through it:

Boot live-system and gather information

It is the same you did when installing Ubuntu. Just make sure to chose "Try Ubuntu". When you see the desktop, open a terminal (CTRL+ALT+T) and run the following:

sudo blkid

which will give you a result like this

/dev/sda1: LABEL="EFI" UUID="70D6-1701" TYPE="vfat" 
/dev/sda2: UUID="68ca53b3" LABEL="OSX" TYPE="hfsplus" 
/dev/sda3: UUID="49526001" LABEL="Recovery HD" TYPE="hfsplus" 
/dev/sda4: LABEL="BOOTCAMP" UUID="FCF67D7DF67D394A" TYPE="ntfs" 
/dev/sda6: UUID="c1c76922" TYPE="ext4" 
/dev/sda7: UUID="3b171268" TYPE="ext4" 
/dev/sda8: UUID="bf3dd1b7" TYPE="swap"

Please post the result of this command back here, so that we can help you further. I will continue with the above example.

Chroot into the installed system

With chroot you can use a live linux and switch to the Linux installed on your harddrive to repair it. It is important whether your system uses EFI or BIOS. If you have/had Windows 8 on the machine, it is a good indicator for EFI. In the example above there is a small vfat partition that is even called EFI so the above system uses EFI to boot. The two ext4 partitions are Linux partitions. You can just open them from the launcher to see which one contains to root filesystem (contains folders like etc, usr, var, ...). In the above case /dev/sda6 is the root partition and /dev/sda1 is the EFI partition.

In a terminal run the following commands to prepare and open the chroot.

sudo -i
mount /dev/sda6 /mnt
mount /dev/sda1 /mnt/boot/efi
for i in dev dev/pts proc sys sys/firmware; do mount --bind /$i /mnt/$i; done
chroot /mnt

The EFI partition only needs to be mounted if EFI is actually used, otherwise you can omit that line.

The list of partitions you posted indicates you use LVM, so we need to account for that. Replace the two mount commands above with these:

mount /dev/mapper/ubuntu--vg-root /mnt
mount /dev/sda1 /mnt/boot


To repair your system continue to run the following commands.

apt-get update
apt-get --reinstall install linux-image-3.11.0-20-generic

Now reboot the machine and you should be all set.

share|improve this answer
Hi mniess, thanks for the quick reply. I really appreciate! Here's what I'm getting after entering sudo blkid: ubuntu@ubuntu:~$ sudo blkid /dev/loop0: TYPE="squashfs" /dev/sda1: UUID="999feae4-d45b-4cbf-8015-ef5d62d952cd" TYPE="ext2" /dev/sda5: UUID="9k5hUW-e2Hq-IfIN-08zV-jjDd-0mHm-CHySv4" TYPE="LVM2_member" /dev/sr0: LABEL="Ubuntu 14.04 LTS amd64" TYPE="iso9660" /dev/mapper/ubuntu--vg-root: UUID="8cf4d204-bbf8-44e2-a3e4-0f8c618e67ef" TYPE="ext4" /dev/mapper/ubuntu--vg-swap_1: UUID="6a0999af-2cee-453f-9a01-7c878df6213e" TYPE="swap" – thomoh May 14 '14 at 16:00
As you can see I've used a ubuntu 14.04 live CD for booting the computer. Would your repair procedure work with a 14.04 system too? If not: do you know where I still can get a 13.10 version of Ubuntu? – thomoh May 14 '14 at 16:01
You can use the 14.04 DVD. Your setup is a bit more involved as you use LVM. I'm guessing /dev/sda1 contains you boot partition, so that needs to be mounted to /mnt/boot. I will update my answer. – mniess May 14 '14 at 16:21
Following your advise I've entered the following: ` ubuntu@ubuntu:~$ sudo -i root@ubuntu:~# mount /dev/mapper/ubuntu--vg-root /mnt root@ubuntu:~# mount /dev/sda1 /mnt/boot root@ubuntu:~# root@ubuntu:~# apt-get --reinstall install linux-image-3.11.0-20-generic Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package linux-image-3.11.0-20-generic E: Couldn't find any package by regex 'linux-image-3.11.0-20-generic' root@ubuntu:~# ` It looks like that the repair procedure cannot find the file. :-( – thomoh May 14 '14 at 17:02
@user281591 Can you please use a paste service to post things like this. These comments make it totally unreadable. The package should be there. You might need to update your sources first. I updated my answer to reflect that! – mniess May 14 '14 at 17:07

The files in this directory are vital to your installation so you should be very careful with them as you just found out :-)

But not everything is lost, I think. You should be able to reinstall the file. In order to do so you will probably have to use a Ubuntu live CD/USB stick to boot the machine. The steps would be

  1. Mount the local partitions of your machine in your live environment and chroot into the mounted root directory.
  2. Re-install the linux-image-3.11.0-20-generic which, IIRC, should generate the file for you.

I will not be able to further detail these two steps here. Googling for them should turn up some guides that will help you along the way.

Edit: See emniess' great post who was faster than me and nicely guides you through the process.

share|improve this answer
same answer as below but with less detail – eyoung100 May 14 '14 at 15:41
Yeah, it was bad timing on my part. – user281608 May 14 '14 at 15:46
Thank you nevertheless! – thomoh May 14 '14 at 16:07
  1. Open "Advanced options for Ubuntu" from GRUB (if it's only OS, use Shift after BIOS screen).
  2. Boot older kernel.
  3. Use

    sudo update-grub

    (I think it works in newer Ubuntu's)

  4. Reboot.

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.