Kali-Linux

grub-install:錯誤:找不到 EFI 目錄。(重新安裝 Grub Boot Loader Windows 10/Kali Linux Dual Boot with Dual Hard Drive)

  • June 10, 2021

我的筆記型電腦中有 2 個硬碟驅動器 (SSD)。一個硬碟安裝了windows 10,另一個硬碟安裝了kali linux。重新安裝 Windows 10 後,我的 kali linux grub 引導載入程序不再工作。因此,我嘗試使用 kali live cd 重新安裝 kali linux 的 grub 引導載入程序。

我使用這些命令為 kali linux 安裝 grub 引導載入程序:

sudo mount /dev/sdb4 /mnt
sudo mount --bind /dev /mnt/dev &&
sudo mount --bind /dev/pts /mnt/dev/pts &&
sudo mount --bind /proc /mnt/proc &&
sudo mount --bind /sys /mnt/sys
sudo chroot /mnt
grub-install /dev/sdb

每當我寫命令時:

grub-install /dev/sdb

我收到一條錯誤消息“ grub-install:錯誤:找不到 EFI 目錄。

誰能幫幫我!

這是 fdisk -l 結果:

kali@kali:~$ sudo fdisk -l
Disk /dev/sdb: 447.14 GiB, 480113590272 bytes, 937721856 sectors
Disk model: WDC WDS480G2G0A-
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: E85DA061-C60D-4CA9-9EEF-B703A8B89C96

Device         Start       End   Sectors   Size Type
/dev/sdb1         34     32767     32734    16M Microsoft reserved
/dev/sdb2      32768 734455807 734423040 350.2G Microsoft basic data
/dev/sdb3  734455808 745361407  10905600   5.2G Microsoft basic data
/dev/sdb4  745361408 922120191 176758784  84.3G Linux filesystem
/dev/sdb5  922120192 937719807  15599616   7.4G Linux filesystem


Disk /dev/sda: 238.49 GiB, 256060514304 bytes, 500118192 sectors
Disk model: SanDisk SD9SN8W2
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: AC00DC72-4C02-49E3-B211-9AC5CB577E09

Device       Start       End   Sectors   Size Type
/dev/sda1     2048   1085439   1083392   529M Windows recovery environment
/dev/sda2  1085440   1290239    204800   100M EFI System
/dev/sda3  1290240   1323007     32768    16M Microsoft reserved
/dev/sda4  1323008 500117503 498794496 237.9G Microsoft basic data


Disk /dev/sdc: 15.12 GiB, 16231956480 bytes, 31703040 sectors
Disk model: v165w           
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: 0x121f4f51

Device     Boot Start     End Sectors  Size Id Type
/dev/sdc1  *        0 7539839 7539840  3.6G  0 Empty
/dev/sdc2       20412   21275     864  432K ef EFI (FAT-12/16/32)
kali@kali:~$ 

這是 blkid 結果:

kali@kali:~$ sudo blkid
/dev/sdb1: PARTLABEL="Microsoft reserved partition" PARTUUID="117cfa3e-e16a-4240-b6bc-c1fd34f0d7c6"
/dev/sdb2: LABEL="Data" UUID="92360F97360F7C0B" TYPE="ntfs" PARTUUID="d59a6755-9afd-4eb2-8975-9b1ed0558568"
/dev/sdb3: LABEL="Extra" UUID="5CBC4FB1BC4F848C" TYPE="ntfs" PARTUUID="2230936f-4a3c-4812-ac5b-ec4dc56f5eb1"
/dev/sdb4: UUID="214bbee0-4f90-455c-9703-5b9518bbbca1" TYPE="ext4" PARTUUID="c3962ed9-e800-40e1-8e99-0d159533cdf3"
/dev/sdb5: UUID="6dd82a88-7622-4d48-b8ec-1e27b379ae9b" TYPE="ext4" PARTUUID="a5f85b50-533b-4ded-86b6-33c1ca7c6a46"
/dev/sda1: LABEL="Recovery" UUID="F4C46F12C46ED700" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="cbc4ba92-f9e1-4318-b564-c9cdb4fbd673"
/dev/sda2: UUID="7071-13EF" TYPE="vfat" PARTLABEL="EFI system partition" PARTUUID="2ffb528c-6180-446e-8d9a-39f544dccbdd"
/dev/sda3: PARTLABEL="Microsoft reserved partition" PARTUUID="a8ebfdac-d662-435c-a75f-e87989ae9f78"
/dev/sda4: LABEL="OS" UUID="46E281D3E281C81F" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="39245a43-640e-4d8c-b3a6-5e815dbc8680"
/dev/sdc1: UUID="2020-05-08-14-35-45-00" LABEL="Kali Linux amd64 1" TYPE="iso9660" PTUUID="121f4f51" PTTYPE="dos" PARTUUID="121f4f51-01"
/dev/sdc2: SEC_TYPE="msdos" UUID="E35D-15CD" TYPE="vfat" PARTUUID="121f4f51-02"
kali@kali:~$ 

fdisk -l 截圖: fdisk -l

blkid 截圖: 在此處輸入圖像描述

這種類型的問題在 Windows 10 中很常見。它有重新格式化 EFI 分區的習慣。

Grub-install for EFI 將文件安裝到 EFI 文件系統。首先為自己掛載文件系統還不夠智能。它期望 EFI 分區已經掛載到/boot/efi.

使用 .找到您的 EFI 分區blkid。它應該是一個 0.5GB 或更小的 vfat 文件系統。然後將它掛載到 /boot/efi 並檢查你現在有一個目錄 /boot/efi/EFI

這將讓你執行grub-install


根據您的螢幕截圖,這意味著您需要:

sudo mount /dev/sda2 /boot/efi
sudo grub-install

引用自:https://unix.stackexchange.com/questions/589390