Results 1 to 29 of 29

Thread: How To Repair Kali Linux Grub With Kali Linux Live Cd: Dual Boot With Windows 7

  1. #1
    Join Date
    2013-Nov
    Posts
    20

    Wink How To Repair Kali Linux Grub With Kali Linux Live Cd: Dual Boot With Windows 7

    Hello. I am sure there are plenty of newbies around when it comes to linux, myself included. This is a guide of how to repair grub in the event your windows 7 removed the grub during the installation.
    First thing that you'll need to do is to boot from a kali linux live cd. After that, go to gparted so that you can get to see where kali was installed: usually it's in the file system that ends with ext4, depending with the file system you used during the installation. In my case, the kali linux system was in sda3, but it varies with different systems.
    From there, you'll have to use the terminal for the following commands:

    Code:
    mount /dev/sda3 /mnt
    mount --bind /dev /mnt/dev
    mount --bind /dev/pts /mnt/dev/pts
    mount --bind /proc /mnt/proc
    mount --bind /sys /mnt/sys
    chroot /mnt
    grub-install /dev/sda
    update-grub
    exit
    umount /mnt/dev/pts
    umount /mnt/dev
    umount /mnt/proc
    umount /mnt/sys
    umount /mnt
    This will restore the old kali linux boot loader, however, you will have to boot into kali once the live cd is out, so as to add windows into the boot loader. Once booted, go to the terminal and do the following:


    Code:
    os-prober
    update-grub
    ... and thats it. hope this helps. I think this will also work with windows xp,vista, and 8, but i haven't yet tested on those systems, so i can't confirm.

  2. #2
    Join Date
    2014-Jul
    Posts
    1
    Hey, just registered here to THANK YOU! you saved me alot of time <3

    Cheers

  3. #3
    Join Date
    2013-Nov
    Posts
    20
    Quote Originally Posted by kian1991 View Post
    Hey, just registered here to THANK YOU! you saved me alot of time <3
    no problem

  4. #4

    Red face

    Quote Originally Posted by kaboyish View Post
    no problem
    sigh up here to say thankss u saved my life

  5. #5
    Join Date
    2013-Nov
    Posts
    20
    you are welcome
    Quote Originally Posted by junaidkhan73 View Post
    sigh up here to say thankss u saved my life

  6. #6
    Join Date
    2013-Mar
    Posts
    7
    Tried this but there was no GRUB after the restart. Checked gparted again and saw that 'boot' is on /dev/sda2. Should I grub-install there, instead?

    Update:
    Boot-repair fixed the problem for me.
    Last edited by hdcase; 2014-10-29 at 02:56.

  7. #7
    Join Date
    2013-Nov
    Posts
    20
    Sorry for the delay. I was a bit held up. Glad boot-repair helped

    Quote Originally Posted by hdcase View Post
    Tried this but there was no GRUB after the restart. Checked gparted again and saw that 'boot' is on /dev/sda2. Should I grub-install there, instead?

    Update:
    Boot-repair fixed the problem for me.

  8. #8
    Join Date
    2015-Mar
    Location
    Istanbul, Turkey
    Posts
    1

    Repair Kali Boot after installing a new OS (ex: Windows)

    hello guys thanks for instructing through the boot-process repair, I wasn't unable to repair my boot for a long-time, and because I have a kali using my USB for boot, it doesn't come with grub, so to fix the boot process it should be like:
    apt-get install grub
    mount /dev/sda3 /mnt
    mount --bind /dev /mnt/dev
    mount --bind /dev/pts /mnt/dev/pts
    mount --bind /proc /mnt/proc
    mount --bind /sys /mnt/sys
    chroot /mnt
    grub-install /dev/sda
    update-grub

    and now reboot, that's it,
    Thanks again.
    P.S is there a way without using (apt-get install grub)?

  9. #9
    Join Date
    2014-Apr
    Posts
    2
    Quote Originally Posted by kaboyish View Post
    Hello. I am sure there are plenty of newbies around when it comes to linux, myself included. This is a guide of how to repair grub in the event your windows 7 removed the grub during the installation.
    First thing that you'll need to do is to boot from a kali linux live cd. After that, go to gparted so that you can get to see where kali was installed: usually it's in the file system that ends with ext4, depending with the file system you used during the installation. In my case, the kali linux system was in sda3, but it varies with different systems.
    From there, you'll have to use the terminal for the following commands:

    Code:
    mount /dev/sda3 /mnt
    mount --bind /dev /mnt/dev
    mount --bind /dev/pts /mnt/dev/pts
    mount --bind /proc /mnt/proc
    mount --bind /sys /mnt/sys
    chroot /mnt
    grub-install /dev/sda
    update-grub
    exit
    umount /mnt/dev/pts
    umount /mnt/dev
    umount /mnt/proc
    umount /mnt/sys
    umount /mnt
    This will restore the old kali linux boot loader, however, you will have to boot into kali once the live cd is out, so as to add windows into the boot loader. Once booted, go to the terminal and do the following:


    Code:
    os-prober
    update-grub
    ... and thats it. hope this helps. I think this will also work with windows xp,vista, and 8, but i haven't yet tested on those systems, so i can't confirm.
    hello , you should use http://sourceforge.net/projects/boot-repair-cd/ ...

  10. #10
    Join Date
    2015-May
    Posts
    1
    Good info so far. I dealt with this a while back --> not fun.

    I'm about to try to install Kali via usb. I have Windows 7 and Ubundu on 2 separate partitions. Then, I have a 3rd partition for recovery. Windows wants to make me create a Logical Partition since I'm capped at 3. I would MUCH rather install Kali over top of Ubuntu and just have Windows and Kali. Needless to say, I dont want to run into losing my grub again. If I install Kali over Ubuntu - will it install grub in the same place and keep everything tidy? I would assume it would never be that easy..

    You guys sound like you know what youre talking about when it comes to this... Just curious if you can tell me anything to keep an eye out for.

  11. #11
    Join Date
    2015-Jun
    Posts
    1
    /usr/sbin/grub-setup: warn: This GPT partition label has no BIOS Boot Partition; embedding won't be possible!.
    /usr/sbin/grub-setup: warn: Embedding is not possible. GRUB can only be installed in this setup by using blocklists. However, blocklists are UNRELIABLE and their use is discouraged..
    /usr/sbin/grub-setup: error: will not proceed with blocklists.
    ???????????????????????????

  12. #12
    Join Date
    2015-Jun
    Posts
    8
    After grub-install I get command not found and after apt-get install grub I get
    E: unable to lokate package grub.

    How to fix that ?

  13. #13
    Join Date
    2013-Aug
    Posts
    7
    Thank you for this kaboyish. After cloning the harddisk with 'mini partition wizard' to a larger hard drive, I had no grub menu. And your procedure worked just fine. In fact after "grub-install /dev/sda and update-grub" I didn't do anything else. These commands detected "Windows 8 (loader)" and added it automatically to the boot menu.

  14. #14
    Join Date
    2016-Mar
    Posts
    1
    Thank you so so soooo much i had this problem for so long and spent way to long trying to fix it, so i made an account just to thank you!

  15. #15
    Join Date
    2016-Apr
    Location
    Pennsylvania
    Posts
    1
    Thanks for the info! This worked w/o the need to add Windows in the boot loader, it automatically put Win 10 into the Kali boot choice:

    Code:
    mount /dev/sda3 /mnt
    mount --bind /dev /mnt/dev
    mount --bind /dev/pts /mnt/dev/pts
    mount --bind /proc /mnt/proc
    mount --bind /sys /mnt/sys
    chroot /mnt
    grub-install /dev/sda
    update-grub
    exit
    umount /mnt/dev/pts
    umount /mnt/dev
    umount /mnt/proc
    umount /mnt/sys
    umount /mnt


    My only problem is I have to boot twice on my Presario laptop. I get the "BootDevice Not Found" ... "Hard Disk - (3F0)" ... , then a Ctrl+Alt+Del will start a normal boot to Kali boot menu. I cannot update BIOS and legacy mode is not CMOS available. <<< Any help here, thanks.
    I'll post any update from my end if I can resolve this issue.

  16. #16
    Join Date
    2016-Sep
    Posts
    1
    I had the same problem. I'm using a laptop with a built-in HDD and added an mSATA SSD. On the SSD there was a Windows 10 with GPT installation. I had 3 primary partitions created by windows installer, and shrank the free space to leave some for the kali installation. At first grub was unable to install, and after reboot only win10 started. I deleted the kali partitions with diskmgmt.msc, changed the SSD from GPT to MBR format with AOMEI Partition Assistant Pro, rebooted into BIOS, set boot option to Legacy only, and then repeated the kali installation. At the end of the install it asked if it may install grub into the MBR, and let me choose the drive to which I intend to install it. I chose my SSD, and voila, it works!

  17. #17
    Join Date
    2014-Mar
    Posts
    158
    You can do all that or just burn a cd with this image :
    https://sourceforge.net/projects/boot-repair-cd/

    witch will fix the grub error .

  18. #18
    I recently installed a new SSD in my computer and started with a fresh install of Kali Linux. I then partitioned the drive with GParted in order to add Windows 10. After doing so, my computer would only boot to Windows 10 when I booted from the SSD.

    I found this solution tonight and tried it using the Live boot version of Kali Linux on a USB. Now on a default boot, my computer goes to the Grub menu so that I can choose Windows 10 or Kali. I registered tonight in order to update that it works for Windows 10. Thank you for the tutorial.

  19. #19
    Join Date
    2016-Oct
    Location
    /dev/sda
    Posts
    928
    What is the purpose of the first command sudo mount /dev/sda* /mnt? Is it where grub will be installed? Why do we need to mount kali-linux partition to repair grub?

  20. #20
    Join Date
    2016-Oct
    Location
    /dev/sda
    Posts
    928
    In UEFI, you have to mount EFI partition also as sudo mount /dev/sda1 /mnt/boot/efi. /dev/sda1 is your EFI partition where grub will be installed.
    Last edited by _defalt; 2017-06-04 at 10:37.

  21. #21
    PLEASE HELP!!!!!!

    When I got to the Grub-install /dev/sda, it said
    /bin/sh: 1: grub-install: not found

  22. #22
    Join Date
    2017-Apr
    Posts
    1
    thanks dude youre a freaking live saver.

  23. #23
    Join Date
    2013-Jul
    Location
    Karachi, Pakistan
    Posts
    4
    This will not work with encrypted disk.

  24. #24
    Join Date
    2017-Jun
    Posts
    1
    I REALLY THANKS FOR YOUR HELP
    BEST WISH FOR YOU

    I just registered here to say THANK YOU


  25. #25
    Join Date
    2016-Oct
    Location
    /dev/sda
    Posts
    928
    Quote Originally Posted by Gate Bill View Post
    I REALLY THANKS FOR YOUR HELP
    BEST WISH FOR YOU

    I just registered here to say THANK YOU

    What exactly was your problem?

  26. #26
    Join Date
    2017-Sep
    Posts
    1
    Quote Originally Posted by kaboyish View Post
    Hello. I am sure there are plenty of newbies around when it comes to linux, myself included. This is a guide of how to repair grub in the event your windows 7 removed the grub during the installation.
    First thing that you'll need to do is to boot from a kali linux live cd. After that, go to gparted so that you can get to see where kali was installed: usually it's in the file system that ends with ext4, depending with the file system you used during the installation. In my case, the kali linux system was in sda3, but it varies with different systems.
    [...................]
    [...................]
    [...................]
    [...................]
    This will restore the old kali linux boot loader, however, you will have to boot into kali once the live cd is out, so as to add windows into the boot loader. Once booted, go to the terminal and do the following:

    ... and thats it. hope this helps. I think this will also work with windows xp,vista, and 8, but i haven't yet tested on those systems, so i can't confirm.
    Thank you very much. I registered just so i can post this. You both helped and inspired to understand how the commands actually work

  27. #27
    This completely works....... just remember that in UEFI you need to mount the EFI before changing to chroot directory. i.e if you get an error like "grub-install:error: cannot find EFI directory."

    Add the below command before the chroot command

    sudo mount /dev/sda1 /mnt/boot/efi

    Provided that your EFI partition is /dev/sda1

  28. #28
    Join Date
    2018-Mar
    Posts
    1
    apt-get install grub
    mount /dev/sda3 /mnt
    mount --bind /dev /mnt/dev
    mount --bind /dev/pts /mnt/dev/pts
    mount --bind /proc /mnt/proc
    mount --bind /sys /mnt/sys
    chroot /mnt
    grub-install /dev/sda
    update-grub

    and now reboot, that's it,
    Thanks again.

  29. #29
    Thank you.. this thread helped me through my problem..
    But I stuck upon some other difficulties..
    First the apt-get command was kind of expired when I tried to excute it from the live usb kali..
    So to solve that i had to type in this command:

    wget -q -O - https://archive.kali.org/archive-key.asc | apt-key add

    And the I couldn't install the grub package..
    So I think for newer versions of kali you might need to install grub2 instead.
    Which means use the following command.

    apt-get install grub2 #instead of grub

    All steps from there shall be easy..
    Thanks again.

Similar Threads

  1. UEFI: How to repair kali-linux grub dual boot with Windows 10
    By _defalt in forum Community Generated How-Tos
    Replies: 69
    Last Post: 2 Days Ago, 01:00
  2. Kali Linux Grub repair using live CD option does not work
    By isurumadusanka in forum Installing Archive
    Replies: 1
    Last Post: 2017-12-12, 16:43
  3. Replies: 2
    Last Post: 2014-07-13, 08:01

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •