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'm new to shell commands. Is it possible if you can directly write those command-lines in your answer? – defalt Oct 31 '16 at 7:30
  • I've added for you. – Lara Maia Oct 31 '16 at 9:29
  • So I've to replace my 2nd command-line with yours. Have a look at the 7th command-line in my question. Don't you think it also has to be edited? Then I need to unmount the partition. Will all other command-lines remain as it is? – defalt Oct 31 '16 at 10:00
  • 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

protected by Community May 25 '18 at 15:21

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

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