In your BIOS make sure your EFI mode is set to generic/normal/"Others" and not Windows mode as this will only allow Windows to boot.
You should also disable Secure Boot unless you want to go through the complications of setting up signed grub. (not covered here)
You have a few different ways you can set it up. You can share your EFI partition with Windows (risky, Windows will probably wipe out grub with updates) or you can use a second EFI partition on your 2nd disk and make that your main boot option. I will cover that.
Your partitions should look somewhat like this:
disk1, (/dev/sda or /dev/nvme0n1) set up by Windows:
- partition 1: 500 MB Windows 10 recovery partition
- partition 2: 100 MB fat32 EFI system partition
- partition 3: NTFS Windows OS partition (remaining space)
disk2, (/dev/sdb or /dev/nvme0n2) set up by Kali installer OR parted magic OR any other Linux rescue CD
- partition 1: 100 MB fat32 EFI system partition (make sure it is marked as esp by gparted or installer)
- partition 2: Linux 200 MB ext4 /boot partition (can help get you recovery options if you experience file system corruption problems)
- partition 3: Linux system (/) partition (12 GB is usually a good choice, choose any file system you want, ext4 is almost certainly the best choice)
- (optional) partition 4: Linux home (/home) partition (remaining space, any file system, f2fs is a great option for speed on SSD/NVMe but is prone to bad corruption in power failures)
- (optional) partition 5: swap partition (it's not as important these days unless you are low on ram, I don't like using precious disk write cycles)
You can combine /, /boot, and /home to give you more freedom with your space, of course.
If you mark a partition as esp in the Kali installer then it should automatically choose to install grub-efi instead of grub. At the end of the installer it should auto-detect your Windows partition as well.
Once the install is finished, you simply go into your BIOS and change the boot priority so that your EFI partition on 2nd disk has higher priority than the Windows one.
If the installer fails to set up grub-efi properly then you may need to boot a live CD then do in a terminal as su:
Code:
mkdir /mnt/disk2
mount /dev/sdb3 /mnt/disk2
cd /mnt/disk2
mount /dev/sdb2 boot
mount /dev/sdb1 boot/efi
mount -t sysfs - sys
mount -t proc - proc
mount -o bind /dev dev
mount -o bind /dev/shm dev/pts
mount -o bind /dev/pts dev/shm
chroot .
apt-get update
apt-get install grub-efi
grub-install
# Installing for x86_64-efi platform.
# Installation finished. No error reported.
update-grub
While you are in the chrooted environment, you might as well also do this:
Code:
mkdir /boot/efi/EFI/boot
cp /boot/efi/EFI/debian/grubx64.efi /boot/efi/EFI/boot/bootx64.efi
This will put a copy of your grub efi boot binary in the standard EFI boot location, which might fix boot issues with older UEFI BIOSes which have hardcoded paths. I know it fixes VirtualBox at least.
Another option is to create a startup.nsh script.
Code:
cat <<EOF > /boot/efi/EFI/startup.nsh
fs0:
\EFI\debian\grubx64.efi
EOF
This tells the UEFI BIOS to execute this script (hardcoded like autorun in UEFI BIOSes) which will load the grubx64.efi file immediately.
I did both of the above things to make sure I was compatible with most if not all UEFI supported boards that I plugged my drive into.
Hopefully everything should be working on the next reboot.