UEFI does not see installed Linux (SOLVED)
January 31, 2022
How to add a new boot option to UEFI
UEFI usually automatically detects operating system loaders on media connected to a computer. But sometimes UEFI does not show all available options. Let's see how to add a new option to the UEFI boot menu.
For example, I plugged a flash drive with two operating systems – Windows 11 and Kali Linux – into my computer USB port, pressed ESC during boot to select boot options. The screenshot shows two options:
- Linux OS on internal drive
- Windows OS on a flash drive
If I select the first option, then it will boot from the internal disk, if the second, then Windows will boot. There is no way to boot Kali Linux from a flash drive.
Go to UEFI settings.
To come to the advanced UEFI settings, on my laptop I use the F7 key.
Go to the “Boot” tab.
As you can see, two boot options are selected and I can add additional ones – both from the drop-down list and new ones that are not in the list.
Among the options available in the drop-down list, there is no Kali Linux from a flash drive.
I select “Add New Boot Option”.
In the “Path for boot option” field, I need to specify the path to the /EFI/kali/grubx64.efi file.
I select a USB flash drive (there is a line “USB” in the path).
Select the “EFI” folder.
Select the “kali” folder.
Select the “grubx64.efi” file.
In the “Add boot option” field, I enter a name for this boot option and click the “Create” button.
The new boot option has been successfully created.
I add this option to the boot menu.
I save the settings made and restart the computer.
The option to boot “Kali” from a flash drive is now available.
The Linux bootloader is aware of the existence of Windows 11 installed and adds the ability to boot it into its menu.
When you select the “Windows Boot Manager” item, Windows 11 is booted from a USB flash drive.
When choosing to boot Kali Linux, you are required to enter a password for the encrypted partition on which the /home folder is located.
Further, work from a USB flash drive in Kali Linux continues as usual.
What to do if there are no settings for adding boot options in UEFI (BIOS)
UEFI varies from manufacturer to manufacturer: some have a lot of settings, some don't. It is possible that UEFI does not see the Linux bootloader and does not have the option to add a new item to the boot menu.
In this case, you can use a different approach. The essence of the method is that any UEFI by default tries to load the bootloader with the /EFI/BOOT/BOOTX64.EFI path. This is the so-called fallback path to the bootloader. Therefore, it is enough to rename the existing path to fallback for UEFI to start loading it.
For example, the path to the Kali Linux bootloader is /EFI/kali/grubx64.efi. In this case, you need to rename the “kali” folder to “BOOT” and the “grubx64.efi” file to “BOOTX64.EFI”.
These files are located on a hidden partition with the FAT32 file system.
Renaming files and folders on an EFI partition in Linux
To make these changes on Linux, mount the drive with read/write permissions and rename the directory and file.
Let's see the names of disks and partitions:
sudo fdisk -l
The partition with the EFI System on which we want to make changes is called /dev/sdb1, let’s mount it:
mkdir /tmp/efi sudo mount /dev/sdb1 /tmp/efi
Now rename the folder and file sequentially.
sudo mv /tmp/efi/EFI/kali/ /tmp/efi/EFI/BOOT/ sudo mv /tmp/efi/EFI/BOOT/grubx64.efi /tmp/efi/EFI/BOOT/BOOTX64.EFI
When finished, unmount the /dev/sdb1 partition:
sudo umount /dev/sdb1
Renaming files and folders on an EFI partition in Windows
Open the Windows Command Prompt with administrator rights. To do this, press Win+x and select “Windows Terminal (Admin)”.
In the command line, run the program and wait for it to open:
At the DISKPART prompt, type:
We need to find out what number the boot disk has. In my case it is 0.
Now enter the following command, replacing 0 with the number of your boot disk:
sel disk 0
Now the following command will list the volumes:
This is a very important step! We need to find out what number the partition with EFI has. The EFI partition has a FAT32 file system and does not have a letter.
In my screenshot, the EFI volume is number 2.
Run the following command, replacing 2 with your partition number:
sel vol 2
Now this volume needs to be assigned a letter. It can be any unoccupied letter.
Close Command Prompt.
To edit the names of folders and files on the disk, administrator rights are required. To do this, for example, I run Double Commander with administrator rights.
See also: Free analogue of Total Commander
After that, you can edit the EFI partition like regular folders and files.
- How to check if a computer is using BIOS or UEFI; GRUB or systemd-boot bootloader; MBR or GPT partition table (52.1%)
- Free analogue of Total Commander (50.9%)
- How to check if my router supports IPv6 (50.9%)
- Script to connect and disconnect from OpenVPN depending on server availability (50.9%)
- Error “Authentication helper program /usr/lib64/squid/basic_ncsa_auth: (2) No such file or directory” (SOLVED) (50.4%)
- What you need to pay attention to when buying a TV (monitor) for HDR (RANDOM - 27.5%)