5

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?

Zanna
  • 70,465

1 Answers1

2

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.

TopHat
  • 3,971
  • Hey @TopHat, what do you mean by rescue mode? – Faisal Memon Apr 30 '17 at 16:49
  • @FaisalMemon Sorry for the confusion, I come from a RedHat/SUSE background where they use the terminology of "rescue mode". Basically, it just means to live boot from the USB or DVD media. – TopHat Apr 30 '17 at 17:16
  • Hey @TopHat, I tried this, but same issue persist. Here what I exectued after I selected "Try Ubuntu without installing" - https://pastebin.com/mRQKQUqg – Faisal Memon May 01 '17 at 10:06
  • @FaisalMemon you may wanna try the same steps with kernel "4.4.0-59-generic" instead since it is the later kernel. Other than that the only other idea I have right now is to try all the same steps I recommend as before except for step 7 try re-installing grub instead of rebuilding the initrd with the grub-install command in the /boot directory. – TopHat May 01 '17 at 21:42
  • I tried same on 4.4.0-59-generic also, but same issue persist. – Faisal Memon May 03 '17 at 16:12
  • @FaisalMemon ah, that's unfortunate. Well, the only other idea I had/have is for you to try that grub-install I mentioned in my previous comment. Hopefully that does the trick. – TopHat May 03 '17 at 16:13
  • sure. let me try and get back to you. – Faisal Memon May 03 '17 at 16:14
  • Tried running grub-install. Message I get is Installing for i386-pc platform. grub-install: error: install device isnt specified – Faisal Memon May 03 '17 at 18:14
  • Do I need to run it like grub-install /dev/sda1 where /dev/sda1 is the device? – Faisal Memon May 03 '17 at 18:16
  • @FaisalMemon sorry for the confusion. I was thinking it would assume the disk/partition of the directory you are in. If you have a separate /boot/ partition then choose that partition, otherwise, the root partition. Your example should be right syntax-wise. – TopHat May 03 '17 at 18:21
  • Check this - https://pastebin.com/ig1X0wV1 Seeing this now :( – Faisal Memon May 03 '17 at 18:25
  • @FaisalMemon Dang. :( For kicks and giggles, try running the command on the device as a whole instead of the specific partition: grub-install /dev/sda After that though, I'm out of ideas. Sorry. :( – TopHat May 03 '17 at 18:26
  • Haha. Finished. No error reported :) Rebooting now to see if issue is solved :) – Faisal Memon May 03 '17 at 18:28
  • And the issue persist :P – Faisal Memon May 03 '17 at 18:30
  • @FaisalMemon facepalm well hopefully someone else responds with more wisdom than me. If you're able to increase your reputation enough you can put a bounty on the question. Let me know if you ever figure it out! – TopHat May 03 '17 at 18:54
  • Sure. since this thing is taking too long. I think I should go ahead and reinstall ubuntu. Can try this - https://askubuntu.com/questions/269880/re-install-ubuntu-without-losing-data-in-home-folder

    What do you think?

    – Faisal Memon May 04 '17 at 11:14
  • @FaisalMemon I'd say make sure you have a backup of important data, then give it a go! – TopHat May 04 '17 at 13:35