Ubuntu – /sbin/init : no such file or directory | Not able to boot ubuntu desktop

bootboot-repairinitinitrd

I have been using Ubuntu Desktop for a while now, but today for some reason I am not able to start it. Here is what I see.

enter image description here

Here is what I have already tried :

  1. Tried booting in recovery mode
  2. Executed fsck from bootable USB.

Here is what I did after booting from USB:

  1. Created a bootable USB
  2. Saw 4 options:
    • Try Ubuntu without installing
    • Install Ubuntu
    • OEM Install
    • Check disc for defects

I went to first option. Opened terminal –> sudo fdisk -l

This gave me my actual device name –> /dev/sda1

Then I executed –> sudo fsck /dev/sda1 as mentioned here – Target filesystem doesn't have requested /sbin/init

Here is the output:

$ sudo fsck /dev/sda1
fsck from util-linux 2.27.1
e2fsck 1.42.13 (17-May-2015)
/dev/sda1: clean, 682451/29483008 files, 26039796/117925888 blocks

Tried rebooting and booting from HDD but same issue

  1. Booted again from USB and selected try Ubuntu without installing. Executed – sudo fsck -f /dev/sda1

This is what the output looks like – https://pastebin.com/Yi4PqRU4

Also tried option 4 check disk defects. Result was No defects found

Help?

Best Answer

It could be that the initrd is corrupted or missing. In that case it would be unable to find the init process that the initrd needs and uses. Follow these steps to rebuild the initrd:

  1. Boot from the Media (USB/DVD) and start your terminal session as root. ("Rescue Mode")
  2. Mount the disk with the root filesystem to /mnt

mount /path/to/disk /mnt

  1. Mount and bind the virtual filesystems onto your disk

mount --rbind /proc /mnt/proc mount --rbind /sys /mnt/sys mount --rbind /dev /mnt/dev

  1. chroot into your disk

chroot /mnt

  1. Mount everything else, if any

mount -a

  1. move into the boot directory

cd /boot

  1. rebuild the initrd

In RedHat it's as simple as running this command:

mkinitrd

In Ubuntu it looks like they use a different tool. First, you'll need to see what kernel version you are using:

# ls /lib/modules/
3.11.0-12-generic

Then use the version it gives you to run the necessary command:

# update-initramfs -c -k 3.11.0-12-generic
update-initramfs: Generating /boot/initrd.img-3.11.0-12-generic


After that you can exit chroot and try booting normally again to see if the issue is resolved.