4

I recently dual-boot kali-linux-2016.2-amd64 with windows 10. After sometime I updated my windows 10 and due to this windows might have removed grub from the boot menu. Now I can't boot kali-linux from the boot menu because it doesn't appear there anymore.

So I decided to re-install grub by booting into Live-kali(Persistent) from USB. I entered the following command in the terminal:

fdisk -l
sudo mount /dev/sda* /mnt
sudo mount --bind /dev /mnt/dev
sudo mount --bind /proc /mnt/proc
sudo mount --bind /sys /mnt/sys
sudo chroot /mnt
grub-install /dev/sda

CTRL + D

sudo umount /mnt/dev
sudo umount /mnt/proc
sudo umount /mnt/sys
sudo umount /mnt

After the 7th command-line I got this error: enter image description here

4

It's very hard to help you because you don't know basic commands... but I'll try okay?

  • With fdisk -l you list your current partition, like your image.
  • With your image I can see that you have /dev/sda1 as EFI System, /dev/sda10 as Linux filesystem and /dev/sda11 as Linux swap. Keep this information.
  • When you boot with a live cd you must do a chroot for access your system, in other words, an operation that changes the apparent root directory for the current running process and its children. Lets go:

  • mount your system at /mnt. Remember? Linux filesystem? Yes. It's /dev/sda10. So do command:

             sudo mount /dev/sda10 /mnt.

    You are using sudo because you must have administrator permissions to do it.

  • So, mount the temporary filesystems needed for programs work, with the commands:

             sudo mount --bind /dev /mnt/dev
             sudo mount --bind /dev/pts /mnt/dev/pts
             sudo mount --bind /proc /mnt/proc
             sudo mount --bind /sys /mnt/sys

  • You are modifying your boot, so you need your /boot partition too. Some systems uses the same partition for the /boot directory and system root (/). If you don't know what is your case, so at this point check if you have files in the folder /mnt/boot/ (you will find your kernel images, configurations , etc).

       - If the /mnt/boot folder is empty, so you need mount the /boot partition. The only other possibly usable partition on your case is /dev/sda1, so will be it. Mount at /mnt/boot.

       - If you found the files, so the another partition at /dev/sda1 should be really the EFI Filesystem, and it must be mounted at /mnt/boot/EFI.

  • With all mounted,change root directory using:

             sudo chroot /mnt /bin/bash

  • Now, inside chroot, you can install grub:

    sudo grub-install /dev/sda

  • I've added for you. – Lara Maia Oct 31 '16 at 9:29
  • I've add some info... You got now? – Lara Maia Nov 1 '16 at 11:36
  • 1
    Finally I'm able to install grub and now I can run kali. Using your excellent answer I did a work around. Remember your earlier answer ` $ sudo mount /dev/sda1 /mnt/boot/efi`. I inserted this command-line between the 5th & the 6th command. If I had carefully examined your previous edit I would've solved my problem earlier. – defalt Nov 2 '16 at 17:39
  • Thank you a lot @LaraMaia and defalt ! I've basically fixed grub by combining this answer with grub-install --recheck /dev/sdX and grub-update commands. All working now :) (commands copied from this post howtoubuntu.org/…) – petobens May 8 '19 at 0:19

Not the answer you're looking for? Browse other questions tagged or ask your own question.