1

I had the problem described, and followed the top two procedures, explained here: How to restore a system after accidentally removing all kernels?

I have a separate boot partition, and I used the above described procedure to mount it to /mnt/boot

I was able to complete everything successfully, but GRUB boot menu still does not contain a Linux distro. In other words, when I boot, I am left at GRUB boot menu and no option to boot into Ubuntu.

MOwens
  • 56
  • So you booted into a Live-Image, mounted your HDD, change rooted into it and installed the kernels again? Would be nice if you actually wrote what you did exactly not that you followed something. If nothing else try in the change rooted environment "update-grub2" – Ziazis May 16 '17 at 10:01
  • Thanks but honestly I followed the instructions verbatim, so to be fair, I dont know what the point is in writing them out again? I didn't try update grub2, I'll try that. – MOwens May 17 '17 at 08:00
  • @Ziazis thanks for responding. I tried update-grub2 but I get this error: root@ubuntu:/# update-grub2 /usr/sbin/grub-probe: error: failed to get canonical path of `aufs'. – MOwens May 23 '17 at 07:34

2 Answers2

3

Ok, so follow these steps:

  1. Boot up a Live Ubuntu.

  2. Open a terminal and switch to a root user.

  3. Create your chroot dir

mkdir /tmp/chroot

  1. Mount your HDD to the chroot dir

mount /dev/sda1 /tmp/chroot adjust the 1 to whichever partition your root folder was on.

  1. Mount the other necessaties.

mount -t proc proc /tmp/chroot/proc/

mount -t sysfs sys /tmp/chroot/sys/

mount -o bind /dev /tmp/chroot/dev/

  1. Chroot into that folder now.

chroot /tmp/chroot

  1. Install the generic kernel you need

apt install linux-generic

  1. If it didn't run the update grub run them yourself.

update-grub2

  1. Reboot the system and enjoy ubuntu again.
Ziazis
  • 2,174
1

If anyone else has this problem, this is what worked for me.

After trying the above procedure I linked to in my question, what you need to do to fix GRUB to load your kernel is after chrooting and installing your linux kernel (as described in that procedure) copy * from your /boot folder to your chroot/boot folder. In my case I ran: /boot$ cp * /tmp/chroot/boot, and then you need to run this command to remake the grub config file: grub-mkconfig --output=/boot/grub/grub.cfg

MOwens
  • 56
  • That was only necessary for you since you installed your /boot into a seperate partition. You should add that ;-) – Ziazis May 30 '17 at 09:36
  • Ok well to be fair that was the question I asked up front. In other words, it's true that your procedure appears to work without a separate boot partition, but the question I asked was when having a separate boot partition. Anyways I did upvote your answer because you did help me to fix this, and I needed the mkconfig command you gave me or else I wouldnt have gotten it working. – MOwens May 31 '17 at 06:54