我的笔记本电脑中有 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:~$
答案1
这种类型的问题在 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