Re: [gentoo-user] BIOS can not find boot partition

2021-01-24 Thread thelma
On 1/24/21 5:03 AM, Michael wrote:
> On Sunday, 24 January 2021 05:49:28 GMT the...@sys-concept.com wrote:
>> I'm missing something as system can not find boot device
>>
>> fdisk /dev/nvme0n1
>> Disklabel type: gpt
>>
>> Device StartEndSectors   Size Type
>> /dev/nvme0n1p1  2048   6143   4096 2M BIOS boot
>> /dev/nvme0n1p2  6144 268287 262144   128M EFI System
>> /dev/nvme0n1p326828813168631048576   512M Linux swap
>> /dev/nvme0n1p4   1316864  315889663  314572800   150G Linux filesystem
>>
>> I don't want to use EFI.
> 
> If you do NOT want to use EFI why have you set up /dev/nvme0n1p2 as an ESP 
> type partition?
> 
> With just 4 partitions in total there's also the question of your choice to 
> use GPT instead of the legacy MBR partition table.  :-/

I have 5-partitions, all together, and use 
fdisk  -t gpt  /dev//dev/nvme0n1
 
> 
>> /boot = dev/nvme0n1p2  (ext4) file system
>>
>> When I run:
>> grub-install /dev/nvme0n1p2
>> Installing for x86_64-efi platform.
>> grub-install: error: cannot find EFI directory.
> 
> First, the handbook clearly directs to install GRUB to a disk not a partition:
> 
> https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Bootloader
> 
> However, you *can* install GRUB's boot code in a partition instead of a disk, 
> if you wish to chainload the partition's GRUB from another boot loader, e.g. 
> MSWindows, rEFInd, another GRUB, etc.  I don't see you want to do this, from 
> what you have shared.

You are correct here, this was my mistake, it should be (it was late at night 
didn't notice it) :
grub-install /dev/nvme0n1   (now it works)

not:
grub-install /dev/nvme0n1p2

> Second, I think the error you get is caused because you have created ESP type 
> partition, but there is no EFI/ directory in it, which the UEFI boot protocol 
> requires.
> 
> 
>> but there is /boot/grub
> 
> Yes, the error you got does not complain about /boot/grub missing, but about 
> the absence of an "... EFI directory".
> 
> 
>> Running: grub-mkconfig -o /boot/grub/grub.cfg  is OK (no errors)
>>
>> fstab:
>> /dev/nvme0n1p2   /boot   ext4
> noauto,noatime1 2
>>
>> The BIOS has CSM compatibly mode enable.
>> When I try to boot, system can not find bootable partition.
>>
>> Am I suppose to put any file system on /dev/nvme0n1p1 (2Mb partition) the
>> installation manual did not mention anything.
> 
> No filesystem formatting is required for the small /dev/nvme0n1p1 BIOS boot 
> partition - GRUB will install its 2nd stage core image in there.
> 
> I'd question if your boot partition should be set as ESP type in the first 
> place.  Set it as a Linux partition, reformat it with ext2, or if you want as 
> ext4, mount it as /boot and then install GRUB on the disk as the handbook 
> instructs.

Yah, I change this partition to "Linux filesystem" 
/dev/nvme0n1p2  6144 268287 262144   128M Linux filesystem

Without reinstalling anything, it works (it was ext4).



Re: [gentoo-user] BIOS can not find boot partition

2021-01-24 Thread Andrea Conti

Hello,


I don't want to use EFI.


Then you probably should not be attempting to boot off an NVMe drive, as that 
is only possible if the drive has an onboard BIOS-mode boot ROM; AFAIK those 
are only found on some of the earliest NVMe drives.

Moreover...


grub-install /dev/nvme0n1p2
Installing for x86_64-efi platform.


You are installing GRUB in EFI mode. My guess is that it's because you're 
running the command from a system that was booted in EFI mode, so grub-install 
picks EFI by default.
For BIOS you want the 'i386-pc' platform, and you _must_ install GRUB to the 
block device itself (/dev/nvme0n1)

And once again, whether or not you'll be able to boot from that is very much 
open to debate.


Am I suppose to put any file system on /dev/nvme0n1p1 (2Mb partition) the 
installation manual did not mention anything.


That partition is only there to reserve space for the initial stages of GRUB 
when BIOS-booting from a GPT disk. It does not need to be formatted or mounted, 
and as long as it has the proper flags grub-install should be able to pick it 
up on its own.

andrea




Re: [gentoo-user] BIOS can not find boot partition

2021-01-24 Thread Michael
On Sunday, 24 January 2021 05:49:28 GMT the...@sys-concept.com wrote:
> I'm missing something as system can not find boot device
> 
> fdisk /dev/nvme0n1
> Disklabel type: gpt
> 
> Device StartEndSectors   Size Type
> /dev/nvme0n1p1  2048   6143   4096 2M BIOS boot
> /dev/nvme0n1p2  6144 268287 262144   128M EFI System
> /dev/nvme0n1p326828813168631048576   512M Linux swap
> /dev/nvme0n1p4   1316864  315889663  314572800   150G Linux filesystem
> 
> I don't want to use EFI.

If you do NOT want to use EFI why have you set up /dev/nvme0n1p2 as an ESP 
type partition?

With just 4 partitions in total there's also the question of your choice to 
use GPT instead of the legacy MBR partition table.  :-/


> /boot = dev/nvme0n1p2  (ext4) file system
> 
> When I run:
> grub-install /dev/nvme0n1p2
> Installing for x86_64-efi platform.
> grub-install: error: cannot find EFI directory.

First, the handbook clearly directs to install GRUB to a disk not a partition:

https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Bootloader

However, you *can* install GRUB's boot code in a partition instead of a disk, 
if you wish to chainload the partition's GRUB from another boot loader, e.g. 
MSWindows, rEFInd, another GRUB, etc.  I don't see you want to do this, from 
what you have shared.

Second, I think the error you get is caused because you have created ESP type 
partition, but there is no EFI/ directory in it, which the UEFI boot protocol 
requires.


> but there is /boot/grub

Yes, the error you got does not complain about /boot/grub missing, but about 
the absence of an "... EFI directory".


> Running: grub-mkconfig -o /boot/grub/grub.cfg  is OK (no errors)
> 
> fstab:
> /dev/nvme0n1p2/boot   ext4
noauto,noatime  1 2
> 
> The BIOS has CSM compatibly mode enable.
> When I try to boot, system can not find bootable partition.
> 
> Am I suppose to put any file system on /dev/nvme0n1p1 (2Mb partition) the
> installation manual did not mention anything.

No filesystem formatting is required for the small /dev/nvme0n1p1 BIOS boot 
partition - GRUB will install its 2nd stage core image in there.

I'd question if your boot partition should be set as ESP type in the first 
place.  Set it as a Linux partition, reformat it with ext2, or if you want as 
ext4, mount it as /boot and then install GRUB on the disk as the handbook 
instructs.

signature.asc
Description: This is a digitally signed message part.