我需要一台Gentoo 13机器来测试平台上的一些软件。我不是Gentoo常客,所以我正在遭受他们的安装程序。我正在 配置引导加载程序| 安装GRUB2,但失败了:
# grub2-install --target=x86_64-efi --efi-directory=/boot
Installing for x86_64-efi platform.
grub2-install: error: /boot doesn't look like an EFI partition.
我回溯到准备磁盘| 默认值:使用parted对磁盘进行分区,看来我按照说明进行了设置:
(chroot) Gentoo-2012 / # parted
GNU Parted 3.2
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) unit mb
(parted) print
Model: ATA VMware Virtual I (scsi)
Disk /dev/sda: 21475MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 1.05MB 3.15MB 2.10MB grub bios_grub
2 3.15MB 131MB 128MB ext2 boot boot, esp
3 131MB 2572MB 2441MB linux-swap(v1) swap msftdata
4 2572MB 21474MB 18902MB ext4 rootfs msftdata
上面的结果来自手册的相同章节,将文件系统应用于分区和激活交换分区。
我也跟着注释EFI目录不应该是/ boot而是/ boot / efi来自Bootloader在Gentoo论坛上的问题和问题,但是它导致了同样的错误:
(chroot) Gentoo-2012 / # mkdir /boot/efi
(chroot) Gentoo-2012 / # grub2-install --target=x86_64-efi --boot-directory=/boot --efi-directory=/boot/efi
Installing for x86_64-efi platform.
grub2-install: error: /boot/efi doesn't look like an EFI partition.
有什么问题,我该如何解决?
以下fdisk
是上述信息的相应视图gparted
。
(chroot) Gentoo-2012 / # fdisk -l
Disk /dev/loop0: 3.3 GiB, 3567640576 bytes, 6968048 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/sda: 20 GiB, 21474836480 bytes, 41943040 sectors
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: 52F5571A-808B-XXXX-XXXX-XXXXXXXX
Device Start End Sectors Size Type
/dev/sda1 2048 6143 4096 2M BIOS boot
/dev/sda2 6144 255999 249856 122M EFI System
/dev/sda3 256000 5023743 4767744 2.3G Microsoft basic data
/dev/sda4 5023744 41940991 36917248 17.6G Microsoft basic data
我还验证了包sys-boot/grub
支持EFI:
(chroot) Gentoo-2012 / # cat /etc/portage/make.conf | grep GRUB
GRUB_PLATFORMS="emu efi-32 efi-64 pc"
然后我执行了emerge --ask --newuse sys-boot/grub
,emerge -pv sys-boot/grub
然后重建grub
。
grub2-install --target=x86_64-efi --boot-directory=/boot --efi-directory=/boot/efi