PDA

View Full Version : UEFI: How to repair kali-linux grub dual boot with Windows 10



_defalt
2017-06-04, 20:33
If you have dual booted kali with Windows 10 then most probably you are running PC with UEFI firmware. The booting process of UEFI is completely different from that of BIOS. Right after installation or after updating your UEFI, do you find that kali is missing from boot menu options? You can see the entry of Windows boot manager but there is no entry of kali in boot menu.

The reason can be failed grub installation or Windows major updates.
If you update UEFI it deletes the entry of kali from NVRAM.

If you update UEFI from 1.x to 2.x then entry of Grub is removed from the boot-menu. Follow next post (https://forums.kali.org/showthread.php?36601-UEFI-How-to-repair-kali-linux-grub-dual-boot-with-Windows-10&p=72634&viewfull=1#post72634) if you did this
If you update UEFI from 1.x to 1.y then it remains there.

Boot into kali live USB and follow the instructions:

mount /dev/sda* /mnt
mkdir mnt/dev
mkdir mnt/proc
mkdir -p /mnt/sys/firmware/efi/efivars
mount --bind /dev /mnt/dev
mount --bind /proc /mnt/proc
mount --bind /sys /mnt/sys
mount --bind /sys/firmware/efi/efivars /mnt/sys/firmware/efi/efivars
mkdir -p /mnt/boot/efi
mount /dev/sda+ /mnt/boot/efi
mount -o remount,rw /dev/sda+ /mnt/boot/efi
mkdir /mnt/hostrun
mount --bind /run /mnt/hostrun
chroot /mnt
mkdir /run/lvm
mount --bind /hostrun/lvm /run/lvm
grub-install /dev/sda
update-grub
exit
umount /mnt/dev
umount /mnt/proc
umount /mnt/sys/firmware/efi/efivars
umount /mnt/sys
umount /mnt/boot/efi
umount /mnt/hostrun
umount /mnt/run/lvm
umount /mnt
REBOOT

/dev/sda* is your linux filesystem. Like mine is /dev/sda6
/dev/sda+ is your EFI partition which is most likely /dev/sda1.
Use fdisk -l to list all partitions.
/dev/sda in grub-install /dev/sda is the name of your storage device, not the name of partition. Use fdisk -l to see the name of your stoage device.

If you are in grub rescue mode, then run these commands to reconfigure grub:

ls
set root=(hd0,gptx)
set prefix=(hd0,gptx)/boot/grub
insmod normal
normal

ls(LS) lists all the partitions of your hard drive like this (hd0) (hd0,gpt1) (hd0,gpt2). You can make some guesses which one is your kali filesystem to replace the variable x in gptx.

Once you boot into kali open terminal and type:

grub-install /dev/sda
update-initramfs -u
update-grub

_defalt
2017-07-05, 21:47
Sometimes when you reinstall Kali, the installer shows this error executing grub install dummy failed while installing grub and you have to skip this most important step to continue. The above commands are required if grub was not installed during the installation.

However if grub is present in EFI system partition but entry of kali is missing from boot menu options then you don't have to go through those commands. In hp PCs boot menu options, select

Boot from EFI just below the Windows Boot Manager.

Go to System>EFI>kali>grubx64.efi

Once kali boots open terminal and enter these commands

sudo grub-install /dev/sda
sudo update-grub

For DELL users, there is no Boot from EFI option in your boot menu options but if you go to your UEFI settings you can add entry of bootloader from there.

joed1960
2017-07-11, 15:58
I do not have Windows installed on my HP laptop, only Kali. The only EFI Boot I have is when I hit F9 when it starts up. There is no grub.cfg file, only grubx64.efi. What do I need to do to boot into Kali?

_defalt
2017-07-11, 17:52
That was my mistake. Instead of grub.cfg I was supposed to write grubx64.efi. You should click on this one. Kali will boot. Let me edit my mistake there.

joed1960
2017-07-11, 18:52
I'm currently at a grub prompt. I cannot boot into Kali. Tab lists possible command completions...

_defalt
2017-07-12, 06:10
You are in grub rescue mode. I think grub no longer remembers that partition in which kali filesystem is. For that run these commands:
ls
set root=(hd0,gptx)
set prefix=(hd0,gptx)/boot/grub
insmod normal
normal

ls(LS) lists all the partitions of your hard drive like this (hd0) (hd0,gpt1) (hd0,gpt2). I think you can make some guesses which one is your kali filesystem to replace the variable gptx. Most likely it is (hd0,gpt2).

Once you boot into kali open terminal and type:
update-grub
grub-install /dev/sda

joed1960
2017-07-12, 19:24
I ran the first set of commands. I found gpt2 was correct. After rebooting I'm still left at a grub prompt. I only have Kali installed, if that makes a difference.

_defalt
2017-07-13, 01:29
You were not supposed to reboot. You have to proceed to 2nd set once you boot into kali else the change will not be permanent. Try it again.

joed1960
2017-07-13, 14:54
I've run several versions of Linux before, but never encountered this issue. What is the command to boot into Kali?

_defalt
2017-07-14, 06:06
There is no command to boot into kali. Grub boots kali. Show the screenshot of where you are getting stuck.

joed1960
2017-07-14, 14:04
Once I get done typing "normal" I'm still at a grub prompt.

_defalt
2017-07-14, 16:56
I still don't know which grub prompt you are mentioning. Either it is grub rescue mode command-line screen or actual grub menu to boot OS. Show the screenshot of grub prompt. If nothing is working for you the very first post is the right solution.

joed1960
2017-07-14, 21:37
I'm attaching two screenshots: one from the grub prompt, the other when trying to run the commands on page one from the Kali Live prompt. I got an error when running chroot. I boot my laptop, hit F9, hit EFI, and drill down to the file that brings me to the prompt. Please tell me what I'm doing wrong.

2603

2602

_defalt
2017-07-15, 04:18
If rescue commands are not working then the only solution is to use the first post. But doing that is also giving you lot of errors. Show the output of fdisk -l from kali live.

That's an unexpected behavior. After entering normal it should have taken you to grub boot screen.

joed1960
2017-07-19, 01:18
Here it is. 2607

_defalt
2017-07-19, 12:05
Your image links are not working. Anyway If you are unfamiliar with commands then do one thing.

Boot into kali-live. Mount your EFI partiton. Go to /mnt/EFI/kali and replace the grubx64.efi with the one present in this zip file (http://s000.tinyupload.com/index.php?file_id=67567493033474139891). Do not touch any other thing.

http://s000.tinyupload.com/index.php?file_id=67567493033474139891

joed1960
2017-07-21, 15:57
I appreciate the time you've taken to try and help me with this. I replaced the file with the one in your post. This time I got a grub rescue prompt. Typing the settings in here brought me back to the grub prompt I've mentioned in my earlier posts. I have Kali installed on a VM on my Windows computer, so I'm ok. I'll put a different Linux OS on this laptop. Thanks again.

_defalt
2017-07-21, 16:25
You did it all wrong from the start. Here you are telling that you found gpt2 as correct

I ran the first set of commands. I found gpt2 was correct. After rebooting I'm still left at a grub prompt. I only have Kali installed, if that makes a difference.

Now i can see your output of fdisk -l. The link is working again. hd0,gpt3 is the right one. gpt2 is your swap partition. How would you expect it to boot? The right commands are:
set root=(hd0,gpt3)
set prefix=(hd0,gpt3)/boot/grub
insmod normal
normal

It wasn't tough to guess that it might be gpt3.

Taconvino
2017-07-29, 23:01
This happened to me as well, and found your post. However, this line is confusing me:

grub-install /dev/sda

Is that correct? That's the first mention to "/dev/sda" in the instructions. Thought I'd check first, before causing any problems.

_defalt
2017-07-30, 08:29
This happened to me as well, and found your post. However, this line is confusing me:

grub-install /dev/sda

Is that correct? That's the first mention to "/dev/sda" in the instructions. Thought I'd check first, before causing any problems.
/dev/sda is the name of your hard disk. It can be different for different storage units. Always use fdisk -l to see the name of your device.

Taconvino
2017-07-30, 15:44
/dev/sda is the name of your hard disk. It can be different for different storage units. Always use fdisk -l to see the name of your device.

I have different disks for Windows and for the Linux I'm trying to install. In my case, Linux partitions are /dev/sdi1, 2 and 3. So I my case, this command should be

grub-install /dev/sdi

Right?

Thanks for this guide and for the reply, and sorry if this question is kind of dumb.

_defalt
2017-07-30, 17:24
The name of disk should be that where you want to install grub. In your case /dev/sdi is the appropriate name. Your situation is similar to this: https://forums.kali.org/showthread.php?37091-GRUB-Boot-Loader-Not-installing-on-Hard-Drive

Taconvino
2017-07-31, 02:55
Ok! Kept getting stuck on the "grub install" command with different errors (even an "input/output" one that looked dreadful). It turned out to be something completely different. Although my BIOS was reporting "secure boot" as disabled, Windows reported it as "Enabled". I had to update my BIOS to get the correct reading and disable it. After that, setup finished without any errors, and GRUB even shows my Windows disk as a bootable option, which I still haven't tried. Thanks again for taking the time to help me out!

_defalt
2017-07-31, 14:54
So did you get it solved or need more asistance with grub installation?

Taconvino
2017-08-01, 15:02
So did you get it solved or need more asistance with grub installation?

Everything is running fine. Again, thanks for your help!

G0dlyLuck
2017-09-09, 15:36
root@kali:~# fdisk -l
Disk /dev/nvme0n1: 238.5 GiB, 256060514304 bytes, 500118192 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: gpt
Disk identifier: CD914108-4C59-49AC-89E2-56C495FD3BC5

Device Start End Sectors Size Type
/dev/nvme0n1p1 2048 616447 614400 300M EFI System
/dev/nvme0n1p2 616448 878591 262144 128M Microsoft reserved
/dev/nvme0n1p3 878592 498274303 497395712 237.2G Microsoft basic data
/dev/nvme0n1p4 498274304 500117503 1843200 900M Windows recovery environment


Disk /dev/sda: 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: 7B37B810-43B9-458C-A01B-9CED3B9BF283

Device Start End Sectors Size Type
/dev/sda1 2048 865132543 865130496 412.5G Microsoft basic data
/dev/sda2 865132544 866183167 1050624 513M EFI System
/dev/sda3 1914009600 1953523711 39514112 18.9G Windows recovery environment
/dev/sda4 866183168 939511807 73328640 35G Linux filesystem
/dev/sda5 939511808 959565823 20054016 9.6G Linux filesystem
/dev/sda6 959565824 967907327 8341504 4G Linux swap
/dev/sda7 967907328 971812863 3905536 1.9G Linux filesystem
/dev/sda8 971812864 1914009599 942196736 449.3G Linux filesystem

Partition table entries are not in disk order.


Disk /dev/sdb: 14.5 GiB, 15597568000 bytes, 30464000 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: 0xbad74d2f

Device Boot Start End Sectors Size Id Type
/dev/sdb1 * 64 5456223 5456160 2.6G 17 Hidden HPFS/NTFS
/dev/sdb2 5456224 5457631 1408 704K 1 FAT12
/dev/sdb3 5457920 30463999 25006080 11.9G b W95 FAT32


Disk /dev/loop0: 2.4 GiB, 2558234624 bytes, 4996552 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

G0dlyLuck
2017-09-09, 15:40
I posted my fdisk -l output. Which partitions do you want me to mount and where do you want me to mount them to? Also the mount --bind /dev /mnt/dev says it cant find mount point /dev when I mount all partitions to /mnt.

joed1960
2017-11-09, 16:56
Through a bunch of research I found it makes a difference how you setup your USB disk to install Kali. I had previously been using unetbootin to create the image for the install. I found Rosa Image Writer, and I was able to install Kali without any issues. Grub installed automatically during setup.

_defalt
2017-11-09, 19:06
Through a bunch of research I found it makes a difference how you setup your USB disk to install Kali. I had previously been using unetbootin to create the image for the install. I found Rosa Image Writer, and I was able to install Kali without any issues. Grub installed automatically during setup.

You were choosing the wrong partition when you were encountered with grub rescue mode.

joed1960
2017-11-09, 21:44
You were choosing the wrong partition when you were encountered with grub rescue mode.

Case closed.

Arcaici
2017-11-16, 14:07
I have a laptop were i installed windows 10(it came with windows 8), and I am trying to install Kali 2017.2. Here is what I did:

1. Create a bootable (Kali 2017.2) USB using uNetbootin, this worked and I get the live, live persist etc. options
2. Partition my harddrive in Windows so that I have 100 GB unallocated space.
3. Select the install option from the bootable USB
4. Go through the options till the partitioning part.
5. Allocated 55 GB for root, or / (ext4), 44gb for /home (also ext4) and 3 GB for swap (all new partitions created on my only drive from the unalllocated space)
6. The installation goes through successfully, it installs Grub (or says it does) and tells me to unplug my USB and reboot, so I do so.
7. now it go to rescue mode
8. i followed this tutorial but it didn't work

Is there something I missed?

The Laptop is an asus a56c

Thanks in advance




That's my fdisk -l:


root@kali:~# fdisk -l
Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 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: dos
Disk identifier: 0x13241969

Device Boot Start End Sectors Size Id Type
/dev/sda1 2048 1026047 1024000 500M 7 HPFS/NTFS/exFAT
/dev/sda2 1026048 767053823 766027776 365.3G 7 HPFS/NTFS/exFAT
/dev/sda3 767055870 974864383 207808514 99.1G 5 Extended
/dev/sda5 767055872 772913151 5857280 2.8G 82 Linux swap / Solaris
/dev/sda6 772915200 890099711 117184512 55.9G 83 Linux
/dev/sda7 890101760 974084095 83982336 40G 83 Linux
/dev/sda8 * 974086144 974864383 778240 380M ef EFI (FAT-12/16/32)

Partition 3 does not start on physical sector boundary.




Disk /dev/sdb: 7.7 GiB, 8242855936 bytes, 16099328 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: 0x17fcad22

Device Boot Start End Sectors Size Id Type
/dev/sdb1 * 64 5898239 5898176 2.8G 17 Hidden HPFS/NTFS
/dev/sdb2 5898240 5899647 1408 704K 1 FAT12


Disk /dev/loop0: 2.6 GiB, 2779897856 bytes, 5429488 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

_defalt
2017-11-16, 17:22
@Arcaici
set root=(hd0,gpt6)
set prefix=(hd0,gpt6)/boot/grub
insmod normal
normal

Once you boot kali run:
sudo update-grub
sudo grub-install /dev/sda

Arcaici
2017-11-16, 23:07
i tried but, it say "error: no such partition" when i type "insmod normal"

_defalt
2017-11-17, 02:36
@Arcaici Instead of writing (hd0,gpt6) there, write the actual name of your partition. Run ls to list the name of all partitions and show the output here.

The partition #6 is your kali filesystem. Eg- It can be (hd1,gpt6), see ls.

stellarix
2017-12-12, 02:06
I have a problem

I got stuck in umount /mnt/sys
It says umount : /mnt/sys: target is busy

So, i started to skip umount /mnt/sys

But when in the last command umount /mnt it says target is busy too

In step mkdir /mnt/boot/efi says
Cannot create directory *** file exists, when i started reboot, still no grub kali show, directly to the windows

_defalt
2017-12-12, 16:41
@stellarix Have you checked in Boot menu options if an entry of grub is present there?

stellarix
2017-12-13, 05:57
I checked, there is nothing

_defalt
2017-12-13, 09:33
@stellarix I've again run those commands and the entry of grub has been successfully added in my boot menu options. Yeah, the entry was removed when i did a firmware update so i again added it.

I've slightly changed the order of commands so run them again.

There are other 2 users reporting the same. They say that commands are executed successfully but the entry is not generated in the boot menu options. It can be the issue with their firmware.

tushr
2018-01-01, 15:44
@_defalt I followed your steps but at the grub-install step I got an error saying:
bash: grub: command not found

Also in the steps mkdir /mnt/boot/efi and /mnt/hostrun it said cannot create directory... File exists
But I still continued and then got stuck at the grub-install step.

I read all the replies here and my laptop specs are a lot similar. I have an hp laptop with windows 10 preinstalled in uefi... I was trying to install kali as dual boot and encountered the problem of grub install dummy failed. My secure boot is off and I have a bootable dvd for kali which I run in efi mode.

_defalt
2018-01-02, 16:12
@tushr In kali-live enter mount /dev/sda* /mnt and then show the output of ls /mnt/usr/sbin | grep grub. /dev/sda* is your kali filesytem partition.

tushr
2018-01-04, 14:36
@_defalt Sorry for the late reply but I was trying other methods. Actually, my laptop is fairly new so I thought maybe if I try a newer release of kali would it work?... and it did. I downloaded kali-linux-2017.3-amd64 and booted from that. The setup did not stop at grub and it installed successfully past all the grub-install dummy step.

But now another problem rose. My wifi adapter is not being read. In the settings in the wifi tab it says wifi not supported. A key note:
*During installation an error came about some missing firmware files. It said: Some of your hardware needs non-free firmware files to operate. The firmware can be loaded from removable media, such as a USB stick or floppy.
The missing firmware files are: rtl_nic/rtl8168h-2.fw
If you have such media available now, insert it, and continue.
Load missing firmware from removable media? (yes/no)
Also at the network configuration step, the setup is supposed to first scan for lan0 and then wlan0. But during my setup, it scanned lan0 and skipped wlan0. Since I dont have means for LAN connection I had no choice but to choose for configure network later.

After the installation, I connected my phone through tethering and did a apt-get update and apt-get dist-upgrade. It fetched around 1.1GB of data but still no luck. I searched online and heard about backports. But during installation, there was a step which used "make unload" command which gave an error about the linux headers are not installed or missing.
To overcome this, i did a apt-cache search linux-headers and installed the ones corresponding to my version(using uname -r). They got installed but still no luck with the make command.

Sorry for such a long error post but I just think maybe you could connect all these problems. Also I dont think the kali image is corrupted as I installed kali in another laptop using the same image and it worked like a charm.

hammondo
2018-02-28, 05:49
my 2018.1 install was successful but I have no grub boot loader despite agreeing to all grub/MBR items during the install. I only see Windows Boot Management in CMOS and on boot it just boots to Windows. I can run Live Kali from my install DVD

my fdisk -l
root@kali:~# fdisk -l
Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 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: D249AB9A-2FAE-4930-B982-8AE340DAB7E1

Device Start End Sectors Size Type
/dev/sda1 2048 206847 204800 100M EFI System
/dev/sda2 206848 2050047 1843200 900M Windows recovery environment
/dev/sda3 2050048 2312191 262144 128M Microsoft reserved
/dev/sda4 2312192 722997247 720685056 343.7G Microsoft basic data
/dev/sda5 934809600 976773119 41963520 20G Windows recovery environment
/dev/sda6 722997248 722999295 2048 1M BIOS boot
/dev/sda7 722999296 926652415 203653120 97.1G Linux filesystem
/dev/sda8 926652416 934809599 8157184 3.9G Linux swap

Partition table entries are not in disk order.
Disk /dev/loop0: 2.6 GiB, 2775728128 bytes, 5421344 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

Manual config of grub following instructions above, fails with multiple "no mount point" errors and "command not found" when running update-grub

root@kali:~# mount /dev/sda7 /mnt
root@kali:~# mount -bind /dev /mnt/dev
mount: invalid option -- 'b'
Try 'mount --help' for more information.
root@kali:~# mount --bind /dev /mnt/dev
root@kali:~# mount --bind /proc /mnt/proc
root@kali:~# mount --bind /sys /mnt/sys
root@kali:~# mount --bind /sys/firmware/efi/efivars /mnt/sys/firmware/efi/efivars
mount: /mnt/sys/firmware/efi/efivars: mount point does not exist.
root@kali:~# mount /dev/sda1 /mnt/boot/efi
mount: /mnt/boot/efi: mount point does not exist.
root@kali:~# mount -o remount,rw /dev/sda1 /mnt/boot/efi
mount: /mnt/boot/efi: mount point does not exist.
root@kali:~# mount --bind /run /mnt/hostrun
mount: /mnt/hostrun: mount point does not exist.

_defalt
2018-03-02, 08:46
@hammondo I edited my original post to remove errors. Run it again.

hammondo
2018-03-03, 02:26
Thank you and kudos to you _efalt! I saw no mount point does not exist errors and grub-install and update grub commands ran. I did see this output on update grub however, not sure if this is anything to worry about - and I saw it with and without Internet connectivity during the grub install

generating grub configuration file ...
found background image: /usr/share/images/desktop-base/desktop-grub.png
found linux image: /boot/vmlinuz-4.14.0-kali3-amd64
found initrd image: /boot/initrd.img-4.14.0-kali3-amd64
WARNING: Device /dev/loop0 not initialized in udev database even after waiting 10000000 microseconds
WARNING: Device /dev/sda1 not initialized in udev database even after waiting 10000000 microseconds
WARNING: Device /dev/sda2 not initialized in udev database even after waiting 10000000 microseconds
WARNING: Device /dev/sda3 not initialized in udev database even after waiting 10000000 microseconds
WARNING: Device /dev/sda4 not initialized in udev database even after waiting 10000000 microseconds
WARNING: Device /dev/sda5 not initialized in udev database even after waiting 10000000 microseconds
WARNING: Device /dev/sda6 not initialized in udev database even after waiting 10000000 microseconds
WARNING: Device /dev/sda7 not initialized in udev database even after waiting 10000000 microseconds
WARNING: Device /dev/sda8 not initialized in udev database even after waiting 10000000 microseconds

After I got the command prompt back I did "exit" then reboot. The DVD was kicked out during the reboot. However I still do NOT see the grub loader during boot. I have fast boot and CSM disabled in the boot menu of my CMOS. I have just Windows Boot Management and P1: Matshashita CDROM/DVD as boot choices with no disk in the DVD drive. With WBM first and P1: second Windows loads. With P1 first and WBM second - this was how CMOS was set at the time of the reboot following the grub install and kicking out the disk - I got "boot disk not found please insert....." interestingly enough. And after swapping WBM/P1 and getting Windows I tried swapping back and I found no P1 option anymore in my boot choices in CMOS.

I'm leaving at that for now. Please advise _defalt of course when you get a chance to do so. I still would really like to have Kali/Windows dual-boot functional on this Asus notebook.

thank you!

_defalt
2018-03-06, 05:15
@hammondo Can you show the screenshot of your Boot menu options and your Boot order settings?

hammondo
2018-03-06, 14:46
Attached. First time attaching a file hope it works! Odd that the CD/DVD drive wasn't there after grub install also CMS was disabled, now CD/DVD drive appears as P1 (no disc in drive) and CMS is enabled.

Thank you!

_defalt
2018-03-08, 06:39
Attached. First time attaching a file hope it works! Odd that the CD/DVD drive wasn't there after grub install also CMS was disabled, now CD/DVD drive appears as P1 (no disc in drive) and CMS is enabled.

Thank you!

There it is. Add new Boot option. That's what I was looking for. Use that option to add entry of grub in your boot menu options. Post a screenshot if you face any problem.

hammondo
2018-03-08, 15:14
_defalt - here's what I found/did, still boots without any loader appearing (goes straight to Windows) and I'm not sure where I screwed up;-)
Add new Boot Option>next screen I have "Add boot option" "Path for boot option" "Boot option File Path" and "Create". I hit "Add boot option" the next screen is "Select a File System" with only one option PCI(13|0)\DevicePath(Type 3, SubType 12)HD(Part2,Sig775a3156-463a-f42d-b73f-25363fdda3d9)..... I select that>I next see "Select a File to Boot" with options "<xx>" "<Microsoft>" "<Boot>" and "<ASUS>". If I select "<..>" the next screen is again "Select a File to Boot" with choices "<EFI>" and "<System Volume Information>" if I select *<EFI>" it takes me back to the previous "Select A File to Boot" so I next tried "<Boot>" and the screen after that also said "Select a File to Boot" but the choices were "<..>" and "bootx64.efi" so I selected "bootx64.exe". At this point I had my Boot option File Path populated with "EFI\Boot\bootx64.efi". I hit save F10 as I found if I hit Create it just prompts me to enter the File Path which I already did. I saved and exited out of CMOS but as reported above I still don't see the loader screen and the laptop just boots to Windows. Perhaps there is a path I need to specify after I hit Create rather than browsing to the bootx64.efi?

_defalt
2018-03-09, 16:17
Add boot option> Select filesystem> EFI> kali> grubx64.efi

hammondo
2018-03-09, 16:48
_defalt? Are you saying I should input EFI in the Select a File System screen where "PCI(13|0)\DevicePath( type 3, Subtype 12)HD(Part1,Sig......." is visible or rather do I hit Enter at Select a File System (accepting the "PIC(13|0\DevicePath..."), then hit enter on <EFI> on the next screen (Select a File to Boot) - pretty sure it isn't the latter as there is no <kali> option and selecting <..> (first option, before <Microsoft><Boot> and <ASUS>) also doesn't produced a <kali> option. Or do I hit Create (after Add New Boot Opion) and input EFI\kali\grubx64.efi?

hammondo
2018-03-10, 02:09
I did some more exploring. I didn't notice previously that both Add Boot Option and Path for Boot Option are required. With Add Boot Option you can enter anything however with Path for Boot Option you must navigate to a .efi file. I tried EFI\kali\grubx64.efi for Add Boot Option but can find no grubx64.efi file in navigating through all the choices with Path for Boot Option. The files I could find were bootx64.efi, bootmgfw.efi, memtest.efi and bootmgr.efi. The only Path option I have tried thus far is bootx64.efi and when I do that and hit Create the boot order is populated with EFI\kali\grux64.efi (PO: WDC WD5000LPVX-80V0TT0)....and it boots to Windows.

_defalt
2018-03-11, 06:55
Boot into kali live and mount your EFI partition and see if grub exists in the directory /mnt/EFI/kali/grubx64.efi

mount /dev/sda1 /mnt
nautilus /mnt/EFI

hammondo
2018-03-11, 21:10
I booted to Kali live, mount command was ok but nautilus /mnt/EFI resulted in "unable to get contents of the bookmarks file: error opening file /root/.gti.bookmarks: no such file or directory exists" a window popped up showing the three folders visible in CMOS>add new boot option: ASUS BOOT MICROSOFT no Kali folder and no Kali folder beneath any of those three folders (and no grubx64.efi file). I tried running the grub install again but again saw the "mount point doesn't exist" error upon mount --bind /dev /mnt/dev despite upon running mount /dev/sda1 /mnt again the output is "mount point already exists".

_defalt
2018-03-12, 17:37
When it reports mount point does not exist, create a mount point using mkdir /mnt/dev before executing that command. Try it again. You have to install grub. Show the screenshot of terminal when you run those commands.

hammondo
2018-03-13, 02:35
did mkdir had to do mkdir for both mnt/boot and mnt/boot/efi. chroot would not work - as you'll see I screwed up and did a chroot /root first then chroot /mnt saw "failed to run command 'bin/bash' : no such file or directory. All previous commands had run without errors. I tried the next command out of curiosity. First tried mkdir /run/lvm saw "file exists" then ran mount --bind /hostrun/lvm /run/lvm saw "special device /hostrun/lvm does not exist". Tried mkdir /hostrun/lvm "no such file or directory" next tried mkdir /mnt/hostrun/lvm "file exists" and again ran mount --bind /hostrun/lvm /run/lvm but of course still saw "special device /hostrun/lvm does not exist. So....what did I screw up about the chroot command? and do I perform mkdir /hostrun then mkdir /hostrun/lvm and THEN the mount --bind /hostrun/lvm /run/lvm again?

hammondo
2018-03-14, 01:47
Ran again no errors (besides file already exists) until chroot - which I did correctly (chroot /mnt) this time. Tried sudo chroot /mnt no joy (same error). I tried again to go further and again no joy specifically "special device /hostrun/lvm does not exist". Why won't chroot work? Also tried grub-install /dev/sda - should sda have a number after it or is /dev/sda correct? grub-install resulted in "command not found" something possibly of interest is the fdisk -l output yesterday had sdb.... whereas today it is sda....

_defalt
2018-03-14, 13:20
When it says mount point does not exist you can create one using mkdir as i told you before. If it now says file exist it just means that the mount point already exists and you don't have to create one with mkdir. I think you have already learned this.

The error with chroot /mnt, i made an update to my original post. Run it again.

Make sure you are not booting 32-bit kali image on your 64-bit PC.

hammondo
2018-03-15, 03:32
_defalt! Yes you are correct in that I understand that if the file/folder already exists it means "good! I don't have to create it!". I ran chroot /mnt/bin/bash as noted in your updated instructions - I took a new pic of them before booting up to Kali Live. I see a different error now "chroot: cannot change root directory to '/mnt/bin/bash': Not a directory" I tried "sudo chroot /mnt/bin/bash got the same error. I can confirm that yes I am booting 64-bit Kali image 2018.1 on my 64 bit machine. I got tired of the delay booting to CD-ROM so I created a 64 bit Kali USB stick per the instructions on the Kali site. I can now boot to Kali Live in under a minute. I did go on to the rest of the commands but got the same results as before.

hammondo
2018-03-15, 04:10
_defalt? I saw you again changed the chroot instruction to chroot /mnt /usr/bin/bash so I tried again. This time the mount -o remount,rw command wouldn't work - the result was "mount: /mnt/boot/efi: mount or bad..." sorry I must be very tired as I didn't get the entire error in my screen cap and I can't remember if offhand AND I'm too tired to try this again, this evening. I double-triple-quadruple checked my syntax and it looked correct.

In the snip I was looking at I wasn't sure if there was a space between /mnt and /usr/bin/bash on the chroot command so I tried both. It looked more like there was a space so I tried it that way. There was an error either way "chroot: failed to run command 'usr/bin/bash': no such directory" with the space and "chroot: cannot change root directory to 'mnt/usr/bin/bash' no such directory" without the space.

_defalt
2018-03-15, 12:47
@Hammondo I've retested the solution of my original post (edited them again) and they are working as intended.

It looks like the chroot, grub-install & update-grub binaries are missing in your kali filesytem /usr/sbin. Can you show the output of:

mount /dev/sda* /mnt
ls /mnt/usr/sbin | grep grub
ls /mnt/usr/sbin | grep chroot
Replace * with your kali filesystem name.

If it returns no file then you have to reinstall kali.

cactus69
2018-03-18, 03:59
i had installed kali with win 10 in dual boot. but i accidently deleted the kali partition and swap area. using UEFI mode I can successfully boot into win 10. but when I try to boot into BIOS mode to do fresh install of kali, it shows error like "no such partition, grub rescue". How to get rid of this?

_defalt
2018-03-18, 10:02
i had installed kali with win 10 in dual boot. but i accidently deleted the kali partition and swap area. using UEFI mode I can successfully boot into win 10. but when I try to boot into BIOS mode to do fresh install of kali, it shows error like "no such partition, grub rescue". How to get rid of this?
Why are you booting into BIOS mode when kali can be installed in UEFI mode?

vosquare
2018-04-02, 11:10
Whenever I install kali linux, I never for once enjoy it.. Always Grub rescue issue.. What's the problem? Is it my system? Or what?... I use hp, Windows 10..720gb hard drive.. 80gb partitioned for Linux only... But I install kali now, I shut down later, after like 5 hours when I on system, I see Grub rescue again and this kali is really needed.. I don't know what to do again m. Please help me.. Please

_defalt
2018-04-04, 08:51
Whenever I install kali linux, I never for once enjoy it.. Always Grub rescue issue.. What's the problem? Is it my system? Or what?... I use hp, Windows 10..720gb hard drive.. 80gb partitioned for Linux only... But I install kali now, I shut down later, after like 5 hours when I on system, I see Grub rescue again and this kali is really needed.. I don't know what to do again m. Please help me.. Please

When it jumps to grub rescue mode, post the output of ls here.

embermage1
2018-06-11, 00:58
Well I have a new question based on this issue.
First here is the output of fdisk -l

root@Kali-Chaos:~# fdisk -l
Disk /dev/nvme0n1: 238.5 GiB, 256060514304 bytes, 500118192 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: gpt
Disk identifier: 6748ECF3-6336-4440-BCFD-1125C2E87896

Device Start End Sectors Size Type
/dev/nvme0n1p1 2048 1026047 1024000 500M EFI System
/dev/nvme0n1p2 1026048 1288191 262144 128M Microsoft reserved
/dev/nvme0n1p3 1288192 477663577 476375386 227.2G Microsoft basic data
/dev/nvme0n1p4 477665280 479655935 1990656 972M Windows recovery environment
/dev/nvme0n1p5 479655936 500082687 20426752 9.8G Windows recovery environment


Disk /dev/nvme1n1: 238.5 GiB, 256060514304 bytes, 500118192 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: 0x8a8e6123

Device Boot Start End Sectors Size Id Type
/dev/nvme1n1p1 2048 292968447 292966400 139.7G 83 Linux
/dev/nvme1n1p2 292970494 500117503 207147010 98.8G 5 Extended
/dev/nvme1n1p5 292970496 312500223 19529728 9.3G 82 Linux swap / Solaris
/dev/nvme1n1p6 312502272 500117503 187615232 89.5G 83 Linux


Disk /dev/sda: 477 GiB, 512110190592 bytes, 1000215216 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: 0x48742778

Device Boot Start End Sectors Size Id Type
/dev/sda1 2048 1000212479 1000210432 477G 7 HPFS/NTFS/exFAT

So as you can see, I have 2 NVME drives, and one SSD drive. NVME0N1 is the one that came with the system and is the one that the Windows 10 install is on (also the EFI partition I used for the grub fix in this thread). NVME1N1 is the second NVME drive and has a KALI install and a Ubuntu install on it. The SDA drive is simply data drive for the three OS systems to use. When installing 2018.2 Kali ran into the grub issue. Researched the forums and found this fix, used it, and for /dev/sda used /dev/nvme0n1. The grub-install line went without any issues, the update-grub however popped multiple warnings and only found the Ubuntu install. Sure enough after the umount and reboot, only Kali and Ubuntu were options to boot into. So I guess my question is how to correct the pointers so as to have all three OS availible.

embermage1
2018-06-11, 01:02
And I feel like an idiot, I might have found the fix.

Miko
2018-09-06, 08:56
Thanks _Defalt for all the time and effort you've put into this post, it allowed me to bypass the Grub Console. so greatly appreciated.

I am getting the same errors as joed1960 had - https://forums.kali.org/attachment.php?attachmentid=2603&d=1500068213 screenshot.

I ended up butchering the machine by updating a bunch of applications [800 ish] in human error, everything worked until I rebooted then the above screenshots, grub interface appears.

I was able to bypass the interface using what you provided, using..
set root=(hd0,2)
set prefix=(hd0,2)/boot/grub
insmod normal
normal

Once I got in
sudo update-grub
sudo grub-install /dev/sda1

fdisk -l
sda1 = efi
sda2 = Linux Filesystems
sda3 = Linux Swap
I made a error first by installing into sda2, then releasing my error, I've installed it on the efi.

No errors on install, everything looks perfect, apart from when I reboot the Grub console returns, which I then have to repeat above steps and I'm able to login

Sorry if I should of raised a new post, unsure but this post seems relative to the "error" I'm receiving

Any recommendations are greatly appreciated

Miko
2018-09-07, 01:34
Figured it out

For some reason the grub.cfg didn't exist in /boot/efi/EFI/debian

After running grub-mkconfig -o /boot/efi/EFI/debian/grub.cfg

Grub was bypassed on boot

anasddtk
2018-09-08, 03:37
i do its very carefully but at the time of "grub-install /dev/sda" the result showing no such file directory what i do:(

bayvista
2018-09-19, 01:00
When I tried this, Kali appeared in the boot menu. I clicked on it and received some console messages:-

Kali GNU/Linux Rolling Kali TTY
Login:
Password:

I logged in and got:

root@Kali ~#

Any ideas?

strider1108
2019-02-15, 05:34
If you have dual booted kali with Windows 10 then most probably you are running PC with UEFI firmware. The booting process of UEFI is completely different from BIOS. Right after installation or after updating your UEFI you find that kali is not present in boot menu options. You can see the entry of Windows boot manager but there is no entry of kali in boot menu.

The reason can be failed grub installation or Windows major updates.
If you update UEFI it deletes the entry of kali from NVRAM.

If you update UEFI from 1.x to 2.x then entry of Grub is removed from the boot-menu. Follow next post (https://forums.kali.org/showthread.php?36601-UEFI-How-to-repair-kali-linux-grub-dual-boot-with-Windows-10&p=72634&viewfull=1#post72634) if you did this
If you update UEFI from 1.x to 1.y then it remains there.

Boot into kali live USB and follow the instructions:

mount /dev/sda* /mnt
mount --bind /dev /mnt/dev
mount --bind /proc /mnt/proc
mount --bind /sys /mnt/sys
mkdir /mnt/sys/firmware/efi/efivars
mount --bind /sys/firmware/efi/efivars /mnt/sys/firmware/efi/efivars
mkdir /mnt/boot/efi
mount /dev/sda+ /mnt/boot/efi
mount -o remount,rw /dev/sda+ /mnt/boot/efi
mkdir /mnt/hostrun
mount --bind /run /mnt/hostrun
chroot /mnt
mkdir /run/lvm
mount --bind /hostrun/lvm /run/lvm
grub-install /dev/sda
update-grub
exit
umount /mnt/dev
umount /mnt/proc
umount /mnt/sys/firmware/efi/efivars
umount /mnt/sys
umount /mnt/boot/efi
umount /mnt/hostrun
umount /mnt/run/lvm
umount /mnt
REBOOT

/dev/sda* is your linux filesystem. Like mine is /dev/sda6
/dev/sda+ is your EFI partition which is most likely /dev/sda1.
Use fdisk -l to list all partitions.

@defalt your solution worked like a charm
I wasn't even able to boot into Kali before. But after I followed your instructions I was able to add Kali Linux into the UEFI Boot menu.

The problem I faced was in the UEFI Boot menu, where my default OS manager was Windows 10 and it used to boot without even showing Grub.

Therefore I found a solution for this, and it's really simple.

In my case I was dual booting windows 10 and Kali Linux.

So in my UEFi OS boot manger the boot order was:
1. Windows 10 boot manger
2. KALI Linux boot manager

Where Kali Linux contained the Grub.
If I had to boot Kali, I had to hold F9( Boot device selection in my HP laptop) and then I would get a Grub boot screen with 3 options:
1. Kali Linux
2. Advanced Options for Kali
3. Windows 10 Boot

So I had to make changes to my original Boot order in UEFI:

1. I was able to boot into Kali Linux by holding F9( This command may change in your laptop based on your vendor) to open Boot Devices menu.

Then I selected Kali Linux Boot Manager.
Now you will boot into your Installed Kali Linux(not Live USB).

2. Install efibootmgr using the following commands:

sudo apt-get update
sudo apt-get install efibootmgr

3. Find out your Boot Order:

sudo efibootmgr

The output looks something like this:

BootCurrent: 0004
Timeout: 0 seconds
BootOrder: 0001,0004,0002,0005,0006,2001
Boot0001 Windows Boot Manager
Boot0002 Network
Boot0004 Kali
Boot0005 Hard Drive
Boot0006 CD/DVD/CD-RW Drive
Boot2001 EFI USB Device

In the above output Windows 10 (0001) is set to boot before Kali(0004).


Note: The serial numbers of the boot devices may change in your system.


3. Now change the boot order to get your Kali Linux (with the Grub installed) to boot using the command:

sudo efibootmgr -o 0004,0001,2001,0006

In the above command we are setting Kali( with Grub installed) to boot before windows 10 in the UEFI OS manager.

4. Now check if your boot order has changed by typing the following command:

sudo efibootmgr

The output looks something like this:

BootCurrent: 0004
Timeout: 0 seconds
BootOrder: 0004,0001,0002,0005,0006,2001
Boot0001 Windows Boot Manager
Boot0002 Network
Boot0004 Kali
Boot0005 Hard Drive
Boot0006 CD/DVD/CD-RW Drive
Boot2001 EFI USB Device

If you get a similar output with Kali(0004) coming before Windows 10(0001) this means that your boot order has changed.

Note : You should install Grub on Kali to dual boot Kali and Windows 10.

monsterkc
2019-02-24, 20:49
Hey _defalt. I went through the same problem. The first two commands run fine. When i type insmod normal then an error comes. You can see the error in the image.

This happens when secure boot is enabled. When secure boot is off, then instead of "grub rescue" , the "grub" command menu opens. I type all the 4 commands there and after even typing the last normal command , it stays there . nothing boots. Please help

TK66
2019-04-02, 20:38
Hey _defalt. Your commands work but only to start Kali.
When I use the last two commands in the terminal (update-grub and grub-install) it does not mark any error but when I restart my PC, the grub rescue screen continues to appear. I tried to change the installation path to /deb/sda1 which is where I have the Efi partition but no progress.

_defalt
2019-08-03, 18:34
Hey _defalt. Your commands work but only to start Kali.
When I use the last two commands in the terminal (update-grub and grub-install) it does not mark any error but when I restart my PC, the grub rescue screen continues to appear. I tried to change the installation path to /deb/sda1 which is where I have the Efi partition but no progress.

Run:
grub-install /dev/sda
update-grub
update-initramfs -u

/dev/sda is the name of storage device. /dev/sda1 is the name of the partition. So don't use partition name. We only need storage device name to install grub.

_defalt
2019-08-03, 18:42
Hey _defalt. I went through the same problem. The first two commands run fine. When i type insmod normal then an error comes. You can see the error in the image.

This happens when secure boot is enabled. When secure boot is off, then instead of "grub rescue" , the "grub" command menu opens. I type all the 4 commands there and after even typing the last normal command , it stays there . nothing boots. Please help

Don't enable secure boot. Kali does not support secure boot. You might have been entering the wrong filesystem. Attachment resolution is very low. Can't see the error.

SazzadChowdhury
2020-01-06, 23:13
Can you please see this thread for me ???

https://forums.kali.org/showthread.php?46260-Facing-problem-quot-Reboot-and-select-proper-Boot-device-quot-after-install-Kali-Linux-2019-4-in-UEFI-mode

Javik
2020-01-28, 02:21
Great and clear post, thanks. It worked!
It might sound obvious to most of you but i think only thing missing is clarifying on this line
grub-install /dev/sda
Needs to refer to information gathered with fdisk... Specially when freaking out copy/paste is a temptation hehe

Zoys
2020-02-09, 13:51
Can somebody help me please, ive been stucking for a long time.. all search got same answer, run the mount commands. but when i reached the grub-install step, in never work, keep telling error about "boot0000" and not enought space (didnt tell which partition but my efi partition for kali is 1gb aready, is it not enough?

grub-install: warning: Cannot set EFI variable Boot0000.
grub-install: warning: efivarfs_set_variable: writing to fd 6 failed: No space left on device.
grub-install: warning: _efi_set_variable_mode: ops->set_variable() failed: No space left on device.
grub-install: error: failed to register the EFI boot entry: No space left on device.

this is the errors when i run the line "grub-install".. anybody can help please?

Ak331
2020-02-15, 11:21
I followed all the steps properly.
They didn't show any error.
But after the command ' grub-install dev/sdb '
NOTE: sdb as i have kali Linux on my hard drive (win 10 on ssd)
After the above mentioned command it shows " INSTALLING for x86_64-efi platform " and even after a long time shows no result.

Icewalker
2020-04-16, 03:11
PLEASE HELP
My Grub is not coming on. I'm trying to dual boot with Kali linux and Windows 7. When I try to boot, its directing me to Grub rescue - I've tried different things online for Grub rescue, its not responding.
I used a Kali live cd, and my UEFI boot is on from BIOS settings
While running this command -- sudo mkdir /mnt/sys/firmware/efi/efivars
I'm getting -- mkdir: cannot create directory ?/mnt/sys/firmware/efi/efivars?: No such file or directory
PLEASE I NEED HELP

THANKS

devpiggy72
2020-05-24, 16:24
Can somebody help me please. This is my 4th day trying to fix my bootloader missing after i deleted my windows 10 partitions (reinstalled it).

My Kali installation is on a 1TiB hdd, it looks like this:
Drive: sdb
Disk: /dev/sdb : 931.5GiB
Disklabel type: gpt

PARTITION SYSTEM
/dev/sdb1 EFI System Partition vfat
/dev/sdb2 Data partition (Linux) ext2
/dev/sdb3 Data partition (Linux) crypto_LUKS



This is the commands i have done using my Kali persistent LIVE usb for:

sudo mount /dev/sdb1 /mnt
sudo --bind /dev /mnt/dev
sudo mkdir /mnt/dev
sudo mount --bind /dev /mnt/dev
sudo mount --bind /dev/pts /mnt/dev/pts
sudo mkdir /mnt/proc
sudo mount --bind /proc /mnt/proc
sudo mkdir /mnt/sys
sudo mount --bind /sys /mnt/sys
sudo chroot /mnt


i know the now i did wrong that the first command should be "sudo mount /dev/sdb3 /mnt", but that disk is crypted and i dont know how to do it then.
My last command "sudo chroot /mnt" did not work so i fall to sleep, and when i woke up i could not log in to the session anymore. I dont have my password for the LIVE Kali. I turned off the computer and try start again. Then nothing worked anymore.
What to do now:???

devpiggy72
2020-05-26, 13:46
I have the same problem. I reinstalled windows 10 & accidently deleted all partitions before i installed windows 10 Enterprise.
After a lots of reading trying to fix it, i came to this thread.

This first command i had to change because my /dev/sdb3 is crypto_LUKS filesystem.
Instead of command 1, i had to do command 2-6. After all commands i rebooted and now i am in grub rescue mode.
What to do now?



1. sudo mount /dev/sdb3 /mnt

2. sudo cryptsetup open /dev/sdb3 backup
3. sudo lsblk -f /dev/sdb
4. sudo vgdisplay --short
5. sudo lvs -o lv_name,lv_size -S vg_name=server-vg
6. sudo mount /dev/server-vg/root /mnt

7. sudo mount --bind /dev /mnt/dev
8. sudo mount --bind /proc /mnt/proc
9. sudo mount --bind /sys /mnt/sys
10. sudo mkdir /mnt/sys/firmware/efi/efivars
11. sudo mount --bind /sys/firmware/efi/efivars /mnt/sys/firmware/efi/efivars
12. sudo mkdir /mnt/boot/efi
13. sudo mount /dev/sdb1 /mnt/boot/efi
14. sudo mount -o remount,rw /dev/sdb1 /mnt/boot/efi
15. sudo mkdir /mnt/hostrun
16. sudo mount --bind /run /mnt/hostrun
17. sudo chroot /mnt
18. mkdir /run/lvm
19. mount --bind /hostrun/lvm /run/lvm
20. grub-install /dev/sdb
21. update-grub
22. exit
23. sudo umount /mnt/dev
24. sudo umount /mnt/proc
25. sudo umount /mnt/sys/firmware/efi/efivars
26. sudo umount /mnt/sys
27. sudo umount /mnt/boot/efi
28. sudo umount /mnt/hostrun
29. sudo umount /mnt/run/lvm
30. sudo umount /mnt
31. sudo shutdown -r


error: disk 'lvmid/C5jYs5-VQXZ-2Aak-Cm6v-QEvf-F9UM-BBDwOD/RK6yu3-loSB-MyBU-H7w3-ALqX-2tRO-570YLW' not found.
grub rescue> ls
(hd0) (hd1) (hd2)
grub rescue>

shamsmehra90
2020-05-31, 10:01
Hi,
thanks guyz for help, this also faces by mee mcdvoice
(https://mcdvoicesurvey.onl/)
Regards mybkexperience (https://mybk-experience.onl/)

Sahi738
2020-07-01, 07:29
About Windows 10, which is currently working on my computer, was also installed by myself. My brother helped me to make a Windows 10 installation disk (https://www.windows10passwordreset.com/create-windows-10-bootable-usb.html) and then told me to use it to successfully install Windows 10. He was telling the truth and I did ii.In addition,Microsoft (https://www.microsoft.com) can also help install Windows 10.

aannaassalam
2020-07-16, 14:02
How did you opened this kali terminal...
Could you please help with this???

BlazinGirl
2020-07-24, 11:32
If you have dual booted kali with Windows 10 then most probably you are running PC with UEFI firmware. The booting process of UEFI is completely different from that of BIOS. Right after installation or after updating your UEFI, do you find that kali is missing from boot menu options? You can see the entry of Windows boot manager but there is no entry of kali in boot menu.

The reason can be failed grub installation or Windows major updates.
If you update UEFI it deletes the entry of kali from NVRAM.

If you update UEFI from 1.x to 2.x then entry of Grub is removed from the boot-menu. Follow next post (https://forums.kali.org/showthread.php?36601-UEFI-How-to-repair-kali-linux-grub-dual-boot-with-Windows-10&p=72634&viewfull=1#post72634) if you did this
If you update UEFI from 1.x to 1.y then it remains there.

Boot into kali live USB and follow the instructions:

mount /dev/sda* /mnt
mount --bind /dev /mnt/dev
mount --bind /proc /mnt/proc
mount --bind /sys /mnt/sys
mkdir /mnt/sys/firmware/efi/efivars
mount --bind /sys/firmware/efi/efivars /mnt/sys/firmware/efi/efivars
mkdir /mnt/boot/efi
mount /dev/sda+ /mnt/boot/efi
mount -o remount,rw /dev/sda+ /mnt/boot/efi
mkdir /mnt/hostrun
mount --bind /run /mnt/hostrun
chroot /mnt
mkdir /run/lvm
mount --bind /hostrun/lvm /run/lvm
grub-install /dev/sda
update-grub
exit
umount /mnt/dev
umount /mnt/proc
umount /mnt/sys/firmware/efi/efivars
umount /mnt/sys
umount /mnt/boot/efi
umount /mnt/hostrun
umount /mnt/run/lvm
umount /mnt
REBOOT

/dev/sda* is your linux filesystem. Like mine is /dev/sda6
/dev/sda+ is your EFI partition which is most likely /dev/sda1.
Use fdisk -l to list all partitions.
/dev/sda in grub-install /dev/sda is the name of your storage device, not the name of partition. Use fdisk -l to see the name of your stoage device.



If you are in grub rescue mode, then run these commands to reconfigure grub:

ls
set root=(hd0,gptx)
set prefix=(hd0,gptx)/boot/grub
insmod normal
normal

ls(LS) lists all the partitions of your hard drive like this (hd0) (hd0,gpt1) (hd0,gpt2). You can make some guesses which one is your kali filesystem to replace the variable gptx.

Once you boot into kali open terminal and type:

grub-install /dev/sda
update-initramfs -u
update-grub




By /dev/sda do you mean the exact /dev/sda that was done in Kali Linux live boot?

_defalt
2020-08-18, 17:13
...

Boot into kali live. Run fdisk -l to list all partitions. See which one is your EFI partition which is likely /dev/sda1, name can be different in your case if you are using SSD. Then run
sudo mount /dev/sda1 /mnt
ls /mnt/EFI

See if grubx64.efi is installed.


...

The last comment in this bug report may help you out in your case (https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=845023#52). Try copying the grubx64.efi in /EFI/BOOT.


...

It's because you are installing grub to the wrong storage unit. Your Windows is installed in SSD so this is where your EFI partition is. Use fdisk -l to check the name of SSD and use that name.


...

Re-run the commands, I added mkdir.


...

I've no solution how to achieve grub-install for encrypted filesystem. You should try reinstalling it or ask in unix.stackexchange.com.


...

Boot into kali live.


By /dev/sda do you mean the exact /dev/sda that was done in Kali Linux live boot?

/dev/sda is the example name of the storage unit where EFI partition is present. This name can be different for your HDD or SSD. Use fdisk -l to know the name.

Sacredtwig18
2021-01-20, 20:52
You are in grub rescue mode. I think grub no longer remembers that partition in which kali filesystem is. For that run these commands:
ls
set root=(hd0,gptx)
set prefix=(hd0,gptx)/boot/grub
insmod normal
normal

ls(LS) lists all the partitions of your hard drive like this (hd0) (hd0,gpt1) (hd0,gpt2). I think you can make some guesses which one is your kali filesystem to replace the variable gptx. Most likely it is (hd0,gpt2).

Once you boot into kali open terminal and type:
update-grub
grub-install /dev/sda


ok so when I tried making a live Kali for my dad's old computer he said it was a 32 bit computer and when I tried booting it to the flash drive it brought me to the Grub rescue, I tried my original live for my laptop which is 64 bit and it worked fine, check which image you are using and correct it to your machine

AParthenopaeus94
2021-05-25, 02:16
Through a bunch of research I found it makes a difference how you setup your USB disk to install Kali. I had previously been using unetbootin to create the image for the install. I found Rosa Image Writer, and I was able to install Kali without any issues. Grub installed automatically during setup.

I personally use a windows PC and use a program called Rufus. You can download it here: https://rufus.ie/en-us/

It is very easy to use and also has a log screen so you can monitor the progress and/or errors.

saksham3199
2021-09-02, 08:31
@_defalt Sorry for the late reply but I was trying other methods. Actually, my laptop is fairly new so I thought maybe if I try a newer release of kali would it work?... and it did. I downloaded kali-linux-2017.3-amd64 and booted from that. The setup did not stop at grub and it installed successfully past all the grub-install dummy step.

But now another problem rose. My wifi adapter is not being read. In the settings in the wifi tab it says wifi not supported. A key note:
*During installation an error came about some missing firmware files. It said: Some of your hardware needs non-free firmware files to operate. The firmware can be loaded from removable media, such as a USB stick or floppy.
The missing firmware files are: rtl_nic/rtl8168h-2.fw
If you have such media available now, insert it, and continue.
Load missing firmware from removable media? (yes/no)
Also at the network configuration step, the setup is supposed to first scan for lan0 and then wlan0. But during my setup, it scanned lan0 and skipped wlan0. Since I dont have means for LAN connection I had no choice but to choose for configure network later.

After the installation, I connected my phone through tethering and did a apt-get update and apt-get dist-upgrade. It fetched around 1.1GB of data but still no luck. I searched online and heard about backports. But during installation, there was a step which used "make unload" command which gave an error about the linux headers are not installed or missing.
To overcome this, i did a apt-cache search linux-headers and installed the ones corresponding to my version(using uname -r). They got installed but still no luck with the make command.

Sorry for such a long error post but I just think maybe you could connect all these problems. Also I dont think the kali image is corrupted as I installed kali in another laptop using the same image and it worked like a charm.



I am having the same problem using killer wifi 6 AX1650i adapter