After Repairing Deleted Kernel, why would GRUB still not boot into Linux
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.
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 your HDD to the chroot dir
mount /dev/sda1 /tmp/chroot
adjust the 1 to whichever partition your root folder was on.
- 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/
- Chroot into that folder now.
chroot /tmp/chroot
- Install the generic kernel you need
apt install linux-generic
- If it didn't run the update grub run them yourself.
update-grub2
- Reboot the system and enjoy ubuntu again.
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