0

Hey I use to have kali and windows working together this way: Windows was booting in priority I could press F11 and choose to on sdb5 and Kali was running.

I had broke my Kali install and had to reinstall it at the same place. During the installation I choose not to install grub because I wanted the same behavior.

When I boot I've got Windows as default (as wanted) but when I press F11 and choose to boot on sdb5 I've got an error and end-up in grub-rescue.

I tried to do the following (in grub rescue mode) to fix it but it didn't work (same error):

set root=(hd1,sda5)
set prefix=(hd1,sda5)/boot/grub
insmod normal
normal

So I tried to boot on a Kali live CD and did:

$ sudo grub-install --recheck --root-directory=/media/root/fc3098f2-bc4e-490a-9503-4cb069ff3227 /dev/sdb5

It didn't work either I've got the error:

The file /media/root/fc3098f2-bc4e-490a-9503-4cb069ff3227/boot/grub/stage1 not read correctly.

The issue might comes from the fact that I didn't install grub at installation and that I still have my old grub (?)

I don't know what to do to be able to boot on kali as I was doing before, can you help me?

More infos:

Here is the state of my sdb disk, sdb5 is my kali partition, windows is on sda:Image

$ fsdik -l gives me:

Disk /dev/sdc: 1.8 TiB, 2000398934016 bytes, 3907029168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 7804DE5E-CFA4-40E9-BE9D-6A2FDA4FE8C6

Device      Start        End    Sectors  Size Type
/dev/sdc1      34     262177     262144  128M Microsoft reserved
/dev/sdc2  264192 3907028991 3906764800  1.8T Microsoft basic data

Partition 1 does not start on physical sector boundary.


Disk /dev/sdb: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 5BD63C37-E942-4B29-A8AE-B37A718A214D

Device          Start        End   Sectors   Size Type
/dev/sdb1        2048     264191    262144   128M Microsoft reserved
/dev/sdb2      264192  929523711 929259520 443.1G Microsoft basic data
/dev/sdb3   929523712 1748723711 819200000 390.6G Microsoft basic data
/dev/sdb4  1748723712 1748725759      2048     1M BIOS boot
/dev/sdb5  1748725760 1936895999 188170240  89.7G Linux filesystem
/dev/sdb6  1936896000 1953523711  16627712     8G Linux swap


Disk /dev/sda: 111.8 GiB, 120034123776 bytes, 234441648 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 1063C98C-6F88-4F38-B945-B0C59D49DCF0

Device         Start       End   Sectors   Size Type
/dev/sda1       2048    616447    614400   300M Windows recovery environment
/dev/sda2     616448    819199    202752    99M EFI System
/dev/sda3     819200   1081343    262144   128M Microsoft reserved
/dev/sda4    1081344 233519103 232437760 110.9G Microsoft basic data
/dev/sda5  233519104 234440703    921600   450M Windows recovery environment


Disk /dev/sdd: 7.2 GiB, 7747397632 bytes, 15131636 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x008e5725

Device     Boot   Start      End Sectors  Size Id Type
/dev/sdd1  *       2048  7342079 7340032  3.5G  c W95 FAT32 (LBA)
/dev/sdd2       7342080 15116287 7774208  3.7G 83 Linux


Disk /dev/loop0: 2.5 GiB, 2634285056 bytes, 5145088 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

(I'm struggling with grub stuff, tell me if you need more info on the state of my system)

  • The set root commands should have worked. What is the error when you boot kali? – defalt May 15 '17 at 13:16
2

I managed to repair my Grub following this answer in the end in case anyone have the same issue:

After booting from a kali linux live cd. I opened gparted to find that sdb5 was the partition where kali was installed. Then I typed the following commands:

$ mount /dev/sdb5 /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/sdb
$ update-grub
$ exit
$ umount /mnt/dev/pts
$ umount /mnt/dev
$ umount /mnt/proc
$ umount /mnt/sys
$ umount /mnt

This have restored the old kali linux boot loader on the partition so I can boot on it again by pressing f11 at boot (if you want a real grub follow link for more details)

https://forums.kali.org/showthread.php?20559-How-To-Repair-Kali-Linux-Grub-With-Kali-Linux-Live-Cd-Dual-Boot-With-Windows-7

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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