1

I accidentally removed my current linux kernel from my Ubuntu 14.04.4 LTS by using this command: sudo apt-get purge linux-image-3.13.0-{77,79}-generic

Unable to boot into the system, now I found this good post on how to re-install kernel.

But, problem is sudo parted -l is showing boot flag is set for sda1 but ext4 partition is in disk /dev/mapper/ubuntu--vg-root as opposed to usual sdaX. Output of sudo parted -l.

Now, I'm unable to decide which filesystem to mount for re-installing kernel:

sudo mount /dev/sda1 /mnt

Or

sudo mount /dev/mapper/ubuntu--vg-root /mnt/boot

Here is Pastebin of Boot-Repair

curious
  • 13

2 Answers2

1

If I were to guess, you have a separate partition for /boot. That's not unusual, the installer does that when using LVM.

First mount /dev/mapper/ubuntu--vg-root at /mnt, and then mount /dev/sda2 at /mnt/boot.

muru
  • 207,228
0

I was able to restore my linux kernel using commands provided in this post. Special thanks to @muru for extending help.

For reference, here are commands I executed:

ubuntu@ubuntu:~$ sudo mount /dev/mapper/ubuntu--vg-root /mnt
ubuntu@ubuntu:~$ sudo mount --bind /dev /mnt/dev
ubuntu@ubuntu:~$ ls /mnt/boot
efi
ubuntu@ubuntu:~$ sudo mount /dev/sda2 /mnt/boot
ubuntu@ubuntu:~$ sudo chroot /mnt

root@ubuntu:/# mount -t proc none /proc
root@ubuntu:/# mount -t sysfs none /sys
root@ubuntu:/# mount -t devpts none /dev/pts
root@ubuntu:/# export HOME=/root
root@ubuntu:/# export LC_ALL=C

root@ubuntu:/# apt-get update
root@ubuntu:/# apt-get -y install linux-image-generic

root@ubuntu:/# umount /proc || umount -lf /proc
root@ubuntu:/# umount /sys /dev/pts
root@ubuntu:/# exit
exit
ubuntu@ubuntu:~$ sudo umount /mnt/dev /mnt
curious
  • 13