0

Before I start, here are my software (OS) and hardware specs:

System:
  Host: kali Kernel: 5.14.0-kali4-amd64 x86_64 bits: 64 compiler: gcc
  v: 10.3.0 Desktop: Xfce 4.16.0 Distro: Kali GNU/Linux 2021.4
  base: Debian testing
Machine:
  Type: Laptop System: Acer product: Aspire E5-575G v: V1.27
  serial: <superuser required>
  Mobo: Acer model: Ironman_SK v: V1.27 serial: <superuser required>
  UEFI: Insyde v: 1.27 date: 05/26/2017
Battery:
  ID-1: BAT1 charge: 32.6 Wh (100.0%) condition: 32.6/62.2 Wh (52.5%)
  volts: 12.6 min: 11.1 model: PANASONIC AS16B5J status: Full
CPU:
  Info: Dual Core model: Intel Core i5-7200U bits: 64 type: MT MCP
  arch: Amber/Kaby Lake note: check rev: 9 cache: L2: 3 MiB
  flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
  bogomips: 21599
  Speed: 500 MHz min/max: 400/3100 MHz Core speeds (MHz): 1: 500 2: 500
  3: 500 4: 500
Graphics:
  Device-1: Intel HD Graphics 620
  vendor: Acer Incorporated ALI Aspire E5-575G driver: i915 v: kernel
  bus-ID: 00:02.0
  Device-2: NVIDIA GM108M [GeForce 940MX] vendor: Acer Incorporated ALI
  driver: nouveau v: kernel bus-ID: 01:00.0
  Device-3: Chicony HD WebCam type: USB driver: uvcvideo bus-ID: 1-7:5
  Display: x11 server: X.Org 1.20.11 driver: loaded: modesetting
  unloaded: fbdev,vesa resolution: 1920x1080~60Hz
  OpenGL: renderer: Mesa Intel HD Graphics 620 (KBL GT2)
  v: 4.6 Mesa 21.2.5 direct render: Yes
Audio:
  Device-1: Intel Sunrise Point-LP HD Audio
  vendor: Acer Incorporated ALI Acer Aspire E5-575G driver: snd_hda_intel
  v: kernel bus-ID: 00:1f.3
  Sound Server-1: ALSA v: k5.14.0-kali4-amd64 running: yes
  Sound Server-2: PulseAudio v: 15.0 running: yes
  Sound Server-3: PipeWire v: 0.3.40 running: yes
Network:
  Device-1: Qualcomm Atheros QCA9377 802.11ac Wireless Network Adapter
  vendor: Lite-On driver: ath10k_pci v: kernel bus-ID: 03:00.0
  IF: wlan0 state: up mac: 3c:95:09:ca:9e:7f
  Device-2: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet
  vendor: Acer Incorporated ALI Acer Aspire E5-575G driver: r8169
  v: kernel port: 3000 bus-ID: 04:00.1
  IF: eth0 state: down mac: a8:1e:84:aa:b2:8d
Bluetooth:
  Device-1: Lite-On Qualcomm Atheros QCA9377 Bluetooth type: USB
  driver: btusb v: 0.8 bus-ID: 1-5:4
  Report: hciconfig ID: hci0 rfk-id: 4 state: down bt-service: disabled
  rfk-block: hardware: no software: no address: 3C:95:09:CA:9E:80
Drives:
  Local Storage: total: 245.69 GiB used: 0 KiB (0.0%)
  ID-1: /dev/sda vendor: Kingston model: RBU-SNS8152S3256GG2
  size: 238.47 GiB temp: 30 C
  ID-2: /dev/sdb type: USB model: USB DISK 2.0 size: 7.21 GiB
Partition:
  Message: No partition data found.
Swap:
  Alert: No swap data was found.
Sensors:
  System Temperatures: cpu: 37.0 C mobo: N/A
  Fan Speeds (RPM): N/A
Info:
  Processes: 186 Uptime: 16h 16m Memory: 7.64 GiB used: 2.26 GiB (29.6%)
  Init: systemd runlevel: 5 Compilers: gcc: 11.2.0 clang: 11.1.0-4
  Packages: 2465 Shell: Zsh v: 5.8 inxi: 3.3.07

Above is generated by using Inxi.

Current partition state is:

Disk /dev/sda: 238.47 GiB, 256060514304 bytes, 500118192 sectors
Disk model: KINGSTON RBU-SNS
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: 4BA38183-8A45-4F49-A381-5E4630853A0A

Device         Start       End   Sectors   Size Type
/dev/sda1       2048    206847    204800   100M EFI System
/dev/sda2     206848    239615     32768    16M Microsoft reserved
/dev/sda3     239616 434941951 434702336 207.3G Microsoft basic data
/dev/sda4  498020352 500118158   2097807     1G Windows recovery environment
/dev/sda5  496066560 498020351   1953792   954M Linux swap
/dev/sda6  434941952 496066559  61124608  29.1G Linux filesystem

This is generated by using fdisk command.

Now, my laptop had Windows 10 as a default OS then I decided to dual boot it with Kali linux using a live USB drive with DD image of Kali Linux. For the context, I followed this official guide for dual booting Kali with Windows 10. I made the live USB drive using Rufus, booted into live Kali by manipulating booting order in the UEFI menu (the one that required me to press F2 key when my laptop restarts), created disk partitions for Kali using GParted, then started graphical installer for Kali.

Everything up until this point worked smoothly, but after the "installation complete" page showed up and prompted me to reboot the system (after which I removed my USB drive to boot into GRUB), the minimal Bash-like line supporting GRUB appeared instead of the expected blue GRUB boot menu.

I have encountered this phenomenon before when I dual booted Windows and Ubuntu on this very laptop (I uninstalled Ubuntu way before I attempted to dual boot Windows and Kali), and recalled that, unlike the guide I followed, my computer skipped the step for installing GRUB. I suspect that the previous removal of Ubuntu wasn't complete and interfered with this.

Anyways, I searched for solutions and found some posts that directed me to try things like

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

from this thread,

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

and this from the same thread (of course, I changed the partition designations appropriately so that they match my system). I also followed threads that offered similar entries as the one above, but the problem still persists. I know Kali was properly installed in my sda/dev5 because I was able to type

set prefix=(hd0,gpt6)/boot/grub
insmod normal
normal 

these three lines to enter the installed Kali OS, but for some reason, I couldn't see the regular GRUB boot screen that allows me to choose between Kali and Windows when I reboot.

In addition, my problem persists further. At one point, I decided to remove GRUB from EFI partition (as you can tell, I use UEFI boot mode, not BIOS) and reinstall it; I followed
this post and removed two subfolders: /ubuntu and /kali from EFI folder. Then I used the live USB drive to follow the Kali Linux installation proces again, expecting that I would be able to install GRUB this way, but now I am in more trouble. The "GRUB 0: EFI Partition" now doesn't even show me the minimal BASH-like line editing page; it just briefly shows

System BootOrder not found. Initializing defaults. Reset System

and enters a perma error-reboot cycle. I know the reason for this error because it happened right after removing the aforementioned two subfolders, but now I ran out of ideas what to try.

I just listed out the entire details about how I've got to this point. What should I try now? My goal is to successfully dual boot Windows 10 and Kali Linux by getting greeted with GRUB Bootloader that provides options to boot into either systems.

1 Answer 1

0

The reason why you get the grub> prompt is because the /boot partition cannot be mounted. E.g. /boot/grub/grub.conf or /boot/grub2/grub.cfg etc.

The wrong filesystem location was set in the EFI config.

After you boot with these commands...

set prefix=(hd0,gpt6)/boot/grub
insmod normal
normal 

then you may "update-grub" command to correct the situation. It will update the efi config to reference the right filesystem.

Your latest problem, can be fixed by manipulating the EFI boot order with the efibootmgr command and replacing the missing EFI boot files.

Basically those folders hold EFI boot entries (.efi files). And the boot order / priority of those EFI boot entries (.efi files) is controlled using efibootmgr on linux.

Restore the files, or if they are gone make another EFI system (VM maybe?) then copy the files over from there using a livecd, and then use efibootmgr from the livecd to create an entry and link them to corresponding files,

P.S. These are the entries you see in the BIOS/UEFI setup screen, e.g. the one that says "UEFI: Windows Boot Loader" etc. They are programmed into the EFI using "efibootmgr"

Please see this guide on how to use efibootmgr: https://www.linuxbabe.com/command-line/how-to-use-linux-efibootmgr-examples

Alternatively, you can reboot to LiveCD, chroot into the environment, and then "grub-install" should fix it by installing new EFI files, and you can check if a new EFI boot entry is created with efibootmgr. This is the easiest way (using grub-install), but the above explanation will help you understand exactly how you broke the system and how to fix it in more direct way.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .