Try to use Boot-Repair Tool.
Many cases of problems relating to the boot are a mal-function or bad-installation of Grub or something related to the MBR and partition table, noticing that Boot Repair Tool was created aiming to give an easy way to fix this common problem, recommended by Ubuntu team.
Obs.: If you don't get access to the internet during use of Boot-Repair you won't get the URL mentioned below that can give us important details about your problem in case the recommended repair doesn't work.
Install Boot-Repair in Ubuntu
In your case, as you are able to boot to Ubuntu, you can install boot repair with these commands:
This step can be followed through Live-CD/DVD/USB's "Try Ubuntu" section too
sudo add-apt-repository ppa:yannubuntu/boot-repair && sudo apt-get update
sudo apt-get install -y boot-repair && (boot-repair &)
Then, start Boot-Repair and just click the "Recommended repair" button. When repair is finished, note the URL (paste.ubuntu.com/XXXXX) that appeared on a paper, then reboot and check if you recovered access to your OSs.
If the repair did not succeed, indicate the URL to us as it will give us more information about the error.
Get a CD including Boot-Repair
This way is for who isn't able to start any installed OS in the computer, there are two options:
- Use this ISO to create a bootable Live-CD/USB of Boot-Repair Tool
- Boot your pc from Linux Security Remix where Boot-Repair Tool will be included by default
Choose one of the optionsm start Boot-Repair and click the "Recommended repair" button. When repair is finished, note the URL (paste.ubuntu.com/XXXXX) that appeared on a paper, then reboot and check if you recovered access to your OSs.
If the repair did not succeed, indicate the URL to us as it will give us more information about the error.
For more details and info about advanced options please read this Ubuntu help page.
Never lose your hopes!
I've also faced a crash after apt-get install has installed some new packages... and at next reboot BANG! /sbin/init: No such file or directory
. Also said /etc/init: Permission denied
. Also said /bin/sh: 0: can't access tty; job control turned off
.
Filesystem remained untouched at /dev/vda1
and fsck.ext4
returned: clean!
After a loooong research session, this worked for me: +1 to hill - a user from launchpad.
- boot your droplet with a Recovery ISO - TigerShark
- Network must be configured, either manually or via TigerShark script.
mount -rw -o remount /dev/vda1 /mnt
chroot /mnt
unlink /etc/resolv.conf && echo "nameserver 8.8.8.8" > /etc/resolv.conf
apt-get install init
update-initramfs -u
After reboot your system. It will work fine. Enjoy!
References:
https://bugs.launchpad.net/ubuntu/+source/ubuntu-release-upgrader/+bug/1652462
https://wiki.ubuntu.com/SystemdForUpstartUsers
Best Answer
Ok, so follow these steps:
Boot up a Live Ubuntu.
Open a terminal and switch to a root user.
Create your chroot dir
mkdir /tmp/chroot
mount /dev/sda1 /tmp/chroot
adjust the 1 to whichever partition your root folder was on.mount -t proc proc /tmp/chroot/proc/
mount -t sysfs sys /tmp/chroot/sys/
mount -o bind /dev /tmp/chroot/dev/
chroot /tmp/chroot
apt install linux-generic
update-grub2