[gentoo-user] grub-install error

2023-10-04 Thread dhk



After setting up a new laptop the grub-install command produces an 
error:  "grub-install: error: disk `lvm/nvme0n1p1' not found."


A few comments about the system . . it is a basic setup except that it 
uses luks2 on each partition; lvm is not used, but the decrypted 
partitions are in /dev/mapper and may be the reason lvm is in the error 
message.  The device.map file does not exist on my other working 
machines so it is not clear if that is even necessary.  Also the 
/dev/mapper/nvme0n1p1 partition is certainly there, it is vfat and 
mounted on /efi. The intent is to use a custom initramfs to do the 
decryption.


The laptop will be rebuilt a couple times to work out some ideas, but 
before starting over it would be helpful to understand this error (it is 
not one of the two errors mentioned in the Debugging GRUB section of the 
Handbook).  Responses to questions will be slow since all my traffic 
goes through the weekly digest.


Thanks in advance.

Below is the output of some commands.

* The grub-install command run twice first without and second with 
--verbose.

(chroot) livecd / # grub-install --target=x86_64-efi --efi-directory=/efi
Installing for x86_64-efi platform.
grub-install: error: disk `lvm/nvme0n1p1' not found.

(chroot) livecd / # grub-install --target=x86_64-efi 
--efi-directory=/efi --verbose

Installing for x86_64-efi platform.
grub-install: info: cannot open `/boot/grub/device.map': No such file or 
directory.

grub-install: info: changing current directory to /dev/mapper.
grub-install: info: /dev/mapper/nvme0n1p1 is not present.
grub-install: info: /dev/mapper/nvme0n1p1 is not present.
grub-install: info: /dev/mapper/nvme0n1p1 is not present.
grub-install: info: Scanning for DISKFILTER devices on disk host.
grub-install: info: Scanning for mdraid1x devices on disk host.
grub-install: info: Scanning for mdraid09_be devices on disk host.
grub-install: info: Scanning for mdraid09 devices on disk host.
grub-install: info: Scanning for dmraid_nv devices on disk host.
grub-install: info: Scanning for ldm devices on disk host.
grub-install: info: scanning host for LDM.
grub-install: info: no LDM signature found.
grub-install: info: Scanning for lvm devices on disk host.
grub-install: info: Scanning for DISKFILTER devices on disk proc.
grub-install: info: Scanning for mdraid1x devices on disk proc.
grub-install: info: Scanning for mdraid09_be devices on disk proc.
grub-install: info: Scanning for mdraid09 devices on disk proc.
grub-install: info: Scanning for dmraid_nv devices on disk proc.
grub-install: info: Scanning for ldm devices on disk proc.
grub-install: info: scanning proc for LDM.
grub-install: info: no LDM signature found.
grub-install: info: Scanning for lvm devices on disk proc.
grub-install: info: drive = -1.
grub-install: error: disk `lvm/nvme0n1p1' not found.

* The /efi partition is vfat.
(chroot) livecd / # fdisk -l /dev/mapper/nvme0n1p1
Disk /dev/mapper/nvme0n1p1: 34 MiB, 35651584 bytes, 69632 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: dos
Disk identifier: 0x

* The lsblk command on the drive.
(chroot) livecd /usr/src/linux # lsblk /dev/nvme0n1
NAME  MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINTS
nvme0n1   259:0    0 238.5G  0 disk
├─nvme0n1p1   259:1    0    50M  0 part
│ └─nvme0n1p1 253:0    0    34M  0 crypt /efi
├─nvme0n1p2   259:2    0 2G  0 part
│ └─nvme0n1p2 253:1    0   1.9G  0 crypt /boot
├─nvme0n1p3   259:3    0    16G  0 part
│ └─nvme0n1p3 253:2    0    16G  0 crypt [SWAP]
├─nvme0n1p4   259:4    0    10G  0 part
│ └─nvme0n1p4 253:3    0    10G  0 crypt /
├─nvme0n1p5   259:5    0 2G  0 part
│ └─nvme0n1p5 253:4    0 2G  0 crypt /tmp
├─nvme0n1p6   259:6    0    60G  0 part
│ └─nvme0n1p6 253:5    0    60G  0 crypt /usr
├─nvme0n1p7   259:7    0    25G  0 part
│ └─nvme0n1p7 253:6    0    25G  0 crypt /var
├─nvme0n1p8   259:8    0    20G  0 part
│ └─nvme0n1p8 253:7    0    20G  0 crypt /opt
└─nvme0n1p9   259:9    0 103.5G  0 part
  └─nvme0n1p9 253:8    0 103.5G  0 crypt /home

* The emerge --info
(chroot) livecd / # emerge --info
!!! CONFIG_PROTECT is empty
Portage 3.0.51 (python 3.11.5-final-0, 
default/linux/amd64/17.1/no-multilib, gcc-13, glibc-2.37-r7, 
6.1.28-gentoo-x86_64 x86_64)

=
System uname: 
Linux-6.1.28-gentoo-x86_64-x86_64-11th_Gen_Intel-R-_Core-TM-_i5-1145G7_@_2.60GHz-with-glibc2.37

KiB Mem:    16154684 total,  15575452 free
KiB Swap:   16760828 total,  16760828 free
Timestamp of repository gentoo: Wed, 04 Oct 2023 03:00:01 +
Head commit of repository gentoo: 5194d8a0709d5d13abf436928bd7d6299e404a43
sh bash 5.1_p16-r6
ld GNU ld (Gentoo 2.40 p5) 2.40.0
app-misc/pax-utils:    1.3.5::gentoo
app-shells/bash:   5.1_p16-r6::gentoo
dev-lang/perl: 5.38.0-r1::gentoo
dev-lang/python:   3.11.5::gentoo
dev-util/cmake

Re: [gentoo-user] grub-install: error: cannot find EFI directory [RESOLVED]

2022-07-27 Thread Arve Barsnes
On Wed, 27 Jul 2022 at 15:24, n952162  wrote:
> Well, I discovered that this works:
>
>   grub-install --target=i386-pc /dev/sda
>
> Although that is an UNDOCUMENTED option!  It's dropped from the --help menu.
>
> I found it in the --help on an old system.
>
> Amazing how these things just disappear.

It shows both in --help and in the man page for my up-to-date grub.

Regards,
Arve



Re: [gentoo-user] grub-install: error: cannot find EFI directory [RESOLVED]

2022-07-27 Thread n952162

On 7/27/22 14:33, n952162 wrote:

Hello all,

has the default been changed from BIOS to EFI?

Do I have to, e.g. set the platform USE flag and reinstall the humongous
grub package or is there an option I can pass to grub-install?




Well, I discovered that this works:

*grub-install --target=i386-pc /dev/sda*

Although that is an UNDOCUMENTED option!  It's dropped from the --help menu.

I found it in the --help on an old system.

Amazing how these things just disappear.


Re: [gentoo-user] grub-install: error: cannot find EFI directory

2022-07-27 Thread n952162

On 7/27/22 14:33, n952162 wrote:

Hello all,

has the default been changed from BIOS to EFI?

Do I have to, e.g. set the platform USE flag and reinstall the humongous
grub package or is there an option I can pass to grub-install?




I see I have this:

CONFIG_EFI=y

CONFIG_EFI_STUB=y

CONFIG_EFI_MIXED=y


... or will I have to rebuild my kernel?

Surely genkernel would have determined that I have a BIOS system
wouldn't it have?





[gentoo-user] grub-install: error: cannot find EFI directory

2022-07-27 Thread n952162

Hello all,

has the default been changed from BIOS to EFI?

Do I have to, e.g. set the platform USE flag and reinstall the humongous
grub package or is there an option I can pass to grub-install?