Gentoo Archives: gentoo-user

From: thelma@×××××××××××.com
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] BIOS can not find boot partition
Date: Sun, 24 Jan 2021 20:50:01
Message-Id: 6a10f49d-8a83-3cb2-c66d-7c9da599da64@sys-concept.com
In Reply to: Re: [gentoo-user] BIOS can not find boot partition by Michael
1 On 1/24/21 5:03 AM, Michael wrote:
2 > On Sunday, 24 January 2021 05:49:28 GMT thelma@×××××××××××.com wrote:
3 >> I'm missing something as system can not find boot device
4 >>
5 >> fdisk /dev/nvme0n1
6 >> Disklabel type: gpt
7 >>
8 >> Device Start End Sectors Size Type
9 >> /dev/nvme0n1p1 2048 6143 4096 2M BIOS boot
10 >> /dev/nvme0n1p2 6144 268287 262144 128M EFI System
11 >> /dev/nvme0n1p3 268288 1316863 1048576 512M Linux swap
12 >> /dev/nvme0n1p4 1316864 315889663 314572800 150G Linux filesystem
13 >>
14 >> I don't want to use EFI.
15 >
16 > If you do NOT want to use EFI why have you set up /dev/nvme0n1p2 as an ESP
17 > type partition?
18 >
19 > With just 4 partitions in total there's also the question of your choice to
20 > use GPT instead of the legacy MBR partition table. :-/
21
22 I have 5-partitions, all together, and use
23 fdisk -t gpt /dev//dev/nvme0n1
24
25 >
26 >> /boot = dev/nvme0n1p2 (ext4) file system
27 >>
28 >> When I run:
29 >> grub-install /dev/nvme0n1p2
30 >> Installing for x86_64-efi platform.
31 >> grub-install: error: cannot find EFI directory.
32 >
33 > First, the handbook clearly directs to install GRUB to a disk not a partition:
34 >
35 > https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Bootloader
36 >
37 > However, you *can* install GRUB's boot code in a partition instead of a disk,
38 > if you wish to chainload the partition's GRUB from another boot loader, e.g.
39 > MSWindows, rEFInd, another GRUB, etc. I don't see you want to do this, from
40 > what you have shared.
41
42 You are correct here, this was my mistake, it should be (it was late at night didn't notice it) :
43 grub-install /dev/nvme0n1 (now it works)
44
45 not:
46 grub-install /dev/nvme0n1p2
47
48 > Second, I think the error you get is caused because you have created ESP type
49 > partition, but there is no EFI/ directory in it, which the UEFI boot protocol
50 > requires.
51 >
52 >
53 >> but there is /boot/grub
54 >
55 > Yes, the error you got does not complain about /boot/grub missing, but about
56 > the absence of an "... EFI directory".
57 >
58 >
59 >> Running: grub-mkconfig -o /boot/grub/grub.cfg is OK (no errors)
60 >>
61 >> fstab:
62 >> /dev/nvme0n1p2 /boot ext4
63 > noauto,noatime 1 2
64 >>
65 >> The BIOS has CSM compatibly mode enable.
66 >> When I try to boot, system can not find bootable partition.
67 >>
68 >> Am I suppose to put any file system on /dev/nvme0n1p1 (2Mb partition) the
69 >> installation manual did not mention anything.
70 >
71 > No filesystem formatting is required for the small /dev/nvme0n1p1 BIOS boot
72 > partition - GRUB will install its 2nd stage core image in there.
73 >
74 > I'd question if your boot partition should be set as ESP type in the first
75 > place. Set it as a Linux partition, reformat it with ext2, or if you want as
76 > ext4, mount it as /boot and then install GRUB on the disk as the handbook
77 > instructs.
78
79 Yah, I change this partition to "Linux filesystem"
80 /dev/nvme0n1p2 6144 268287 262144 128M Linux filesystem
81
82 Without reinstalling anything, it works (it was ext4).