You are not logged in.

#1 2022-11-11 08:36:15

lv426
Member
Registered: 2022-11-11
Posts: 19

[SOLVED] Stuck in GRUB rescue mode. error: disk 'lvmid' not found.

Greetings,

Yesterday I ran `pacman -Syu` for the first time. Upon reboot, I could no longer get into Arch Linux. I honestly don't remember what the **original** problem was. Something with a kernel mismatch maybe? I spent an hour trouble shooting it to no avail. A post I found said I should reinstall GRUB, which I did. Doing that, completely broke the system and now I can't get past the rescue screen.

I spent over 2 hours trying to solve this on my own and I am at a loss.

I am running Arch Linux with an encrypted root partition using LVM. Boot is not encrypted.

What I have tried:
- Use live USB to chroot in and...
- Confirm UUID's match in etc/fstab
- Reinstall GRUB multiple times
- Recreate /boot/grub/grub.cfg
- `pacman -Syu linux`
- `mkinitcpio -p linux`
- Mount `boot` at `/boot` or `/boot/efi` or `/boot/EFI`, then reinstall GRUB, make the config again, confirm fstab matches.
- Confirm the lvmid shown in GRUB rescue matches `vgdisplay` and `lvdisplay`

Thanks

Last edited by lv426 (2022-11-16 03:30:09)

Offline

#2 2022-11-11 08:41:57

d.ALT
Member
Registered: 2019-05-10
Posts: 920

Re: [SOLVED] Stuck in GRUB rescue mode. error: disk 'lvmid' not found.

Topic solved, but /boot is encrypted. I suggest you taking a look at it anyway.


<49,17,III,I>    Fama di loro il mondo esser non lassa;
<50,17,III,I>    misericordia e giustizia li sdegna:
<51,17,III,I>    non ragioniam di lor, ma guarda e passa.

Offline

#3 2022-11-11 16:43:25

lv426
Member
Registered: 2022-11-11
Posts: 19

Re: [SOLVED] Stuck in GRUB rescue mode. error: disk 'lvmid' not found.

Morning,

My boot partition is not encrypted. It's not under lvm / luks.

I followed your instructions in the link, but am still presented with the same problem.

I created a keyfile and regenerated mkinitcpio.conf. I still get the same error.

Everything was working flawless before running `pacman -Syu`. Why would an upgrade break it? I never had to enter 2 passwords like the article mentions. Just once to unlock LUKS and the user or root password. I also never had a keyfile before this.

Offline

#4 2022-11-12 00:34:59

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,143

Re: [SOLVED] Stuck in GRUB rescue mode. error: disk 'lvmid' not found.

If you boot the live media and mount your partitions what does

file /mnt/boot/vmlinuz-linux
pacman --root=/mnt/ -Qi linux
lsblk -f

give?


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#5 2022-11-12 05:09:34

lv426
Member
Registered: 2022-11-11
Posts: 19

Re: [SOLVED] Stuck in GRUB rescue mode. error: disk 'lvmid' not found.

cfr wrote:

If you boot the live media and mount your partitions what does

file /mnt/boot/vmlinuz-linux
pacman --root=/mnt/ -Qi linux
lsblk -f

give?

`/mnt/boot/vmlinuz-linux: Linux kernel x86 boot executable bzImage, version 6.0.8-arch1-1 (linux@archlinux) #1 SMP PREEMPT_DYNAMIC Thus, 10 Nov 2022 21:14:24 +0000, RO-rootFS, swap_dev 0XA, Normal VGA`

Name: linux
Version: 6.0.8.arch1-1
Description: The Linux kernel and modules
Architecture: x86_64
URL: https://github.com/archlinux/linux/commits/v6.0.8-arch1
Licenses: GPL2
Groups:  None

sda
   sda1 vfat FAT32            /mnt/boot
   sda2 crypto_LUKS 2
       lvm
            volgroup0-lvol
                         ext4         /mnt

Offline

#6 2022-11-12 05:32:26

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,143

Re: [SOLVED] Stuck in GRUB rescue mode. error: disk 'lvmid' not found.

OK, so the kernel in /boot matches your installed kernel. So if you did have a mismatch, that problem seems to be solved. You need to arch-chroot into the system before reinstalling grub and remaking its configuration file. It is important that you boot the live ISO in UEFI mode if you're booting in UEFI mode. What commands are you using to reinstall grub and remake the config file once arch-chrooted? And do you get any errors or warnings?


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#7 2022-11-13 05:41:59

lv426
Member
Registered: 2022-11-11
Posts: 19

Re: [SOLVED] Stuck in GRUB rescue mode. error: disk 'lvmid' not found.

cfr wrote:

OK, so the kernel in /boot matches your installed kernel. So if you did have a mismatch, that problem seems to be solved. You need to arch-chroot into the system before reinstalling grub and remaking its configuration file. It is important that you boot the live ISO in UEFI mode if you're booting in UEFI mode. What commands are you using to reinstall grub and remake the config file once arch-chrooted? And do you get any errors or warnings?

Yeah, I think the kernel mismatch was the original problem, but I solved it (but not before breaking GRUB) after reading around.

Before running any commands and when in the live USB, boot is mounted to `mnt/boot`

To reinstall GRUB I am using `grub-install --target=x86_64-efi --bootloader-id=grub_uefi --recheck

then `grub-mkconfig -o /boot/grub/grub.cfg`

GRUB is installing to `/boot/efi`, which is default as far as I know. Also, that path is `etc/fstab`

I have tried other methods, such a mounting boot to `mnt/boot/efi` or changing `etc/fstab` to `/boot`. Nothing worked.

GRUB always installs. No errors, but I can't actually get into GRUB. I always get the lvmid error.

Offline

#8 2022-11-13 06:04:46

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,143

Re: [SOLVED] Stuck in GRUB rescue mode. error: disk 'lvmid' not found.

Are you doing

arch-chroot /mnt

after mounting your partitions and before installing grub?
You need something like

grub-install --target=x86_64-efi --efi-directory=<path to your EFI partition in the chroot> --bootloader-id=GRUB

The above is just copy-pasted from the wiki.

You say you're mounting boot to /mnt/boot. Is your EFI partition separate? If so, are you mounting it to /mnt/boot/EFI. Because if grub is installing to /boot/EFI, then your ESP needs to be mounted there. If your boot partition IS your EFI partition, you need to tell grub-install that. And you must be arch-chrooted for the grub-install step.

Last edited by cfr (2022-11-13 06:05:27)


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#9 2022-11-14 07:47:55

lv426
Member
Registered: 2022-11-11
Posts: 19

Re: [SOLVED] Stuck in GRUB rescue mode. error: disk 'lvmid' not found.

These are my steps:

- Boot into live USB
- `cryptsetup open --type=luks /dev/sda2 lvm` > enter password
- `mount /dev/volgroup0/lvol /mnt`
- `mount /dev/sda1 /mnt/boot`
- `arch-chroot /mnt`

Then I run any of the commands I posted above.

There is only 1 boot / -- EFI partition. That is /dev/sda1

When I am done, I exit chroot, unmount all, then reboot.

Offline

#10 2022-11-14 11:48:02

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,143

Re: [SOLVED] Stuck in GRUB rescue mode. error: disk 'lvmid' not found.

You need to specify the directory for grub.

grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB

As you say, grub is installing into /boot/efi, but that's not your ESP. Your ESP is /boot.


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#11 2022-11-14 20:39:36

lv426
Member
Registered: 2022-11-11
Posts: 19

Re: [SOLVED] Stuck in GRUB rescue mode. error: disk 'lvmid' not found.

cfr wrote:

You need to specify the directory for grub.

grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB

As you say, grub is installing into /boot/efi, but that's not your ESP. Your ESP is /boot.

It worked! Thank you cfr. Now, when booted into Arch, the path looks like this: `/boot/efi/EFI/GRUB/grubx64.efi` I assume that's correct considering it's working.

What I don't understand is why this didn't work before when I changed `/mnt/boot` to `/mnt/boot/efi`. GRUB installed with no errors then, but still couldn't boot. It seems like the `--efi-directory=<path>` was essential to making this work.

Unrelated to booting, but I had to remove the keyfile that was suggested in a linked post above. Otherwise, it wouldn't prompt me for my encryption password and that is no good.

My final question:

- To prevent GRUB from breaking again, am I supposed to be mounting /boot every time I run `pacman -Syu` ?

Thanks

Offline

#12 2022-11-14 23:58:30

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,143

Re: [SOLVED] Stuck in GRUB rescue mode. error: disk 'lvmid' not found.

lv426 wrote:

What I don't understand is why this didn't work before when I changed `/mnt/boot` to `/mnt/boot/efi`. GRUB installed with no errors then, but still couldn't boot. It seems like the `--efi-directory=<path>` was essential to making this work.

I'm not sure why this would be expected to work. You have to do something special to install grub without arch-chrooting (which the wiki explains) but grub needs to know your ESP is not mounted at the default /boot/efi. If you just mount your ESP there, your kernels etc. won't be under /boot but also under /boot/efi. I'm not sure that would matter for installing grub, but it would certainly screw up generating the configuration file.

lv426 wrote:

Unrelated to booting, but I had to remove the keyfile that was suggested in a linked post above. Otherwise, it wouldn't prompt me for my encryption password and that is no good.

Agreed. That's expected, though. People use keyfiles so they won't have to type passwords or so they don't have to rely on passwords. It can make sense if, say, you have boot encrypted, decrypt that with a password and then want other stuff decrypted without further intervention. Or if you keep the keyfile on an external device.

My final question:

- To prevent GRUB from breaking again, am I supposed to be mounting /boot every time I run `pacman -Syu` ?

Yes. If it is not mounted anyway, you need it mounted when you update the system. Specifically, you need it mounted when the kernel (or one of the kernels) is updated, but that is pretty frequent so mounting it before a system upgrade is safest. You might also need it mounted for other updates, but it will depend on what you have installed etc.


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#13 2022-11-15 05:11:18

lv426
Member
Registered: 2022-11-11
Posts: 19

Re: [SOLVED] Stuck in GRUB rescue mode. error: disk 'lvmid' not found.

cfr wrote:
lv426 wrote:

What I don't understand is why this didn't work before when I changed `/mnt/boot` to `/mnt/boot/efi`. GRUB installed with no errors then, but still couldn't boot. It seems like the `--efi-directory=<path>` was essential to making this work.

I'm not sure why this would be expected to work. You have to do something special to install grub without arch-chrooting (which the wiki explains) but grub needs to know your ESP is not mounted at the default /boot/efi. If you just mount your ESP there, your kernels etc. won't be under /boot but also under /boot/efi. I'm not sure that would matter for installing grub, but it would certainly screw up generating the configuration file.

lv426 wrote:

Unrelated to booting, but I had to remove the keyfile that was suggested in a linked post above. Otherwise, it wouldn't prompt me for my encryption password and that is no good.

Agreed. That's expected, though. People use keyfiles so they won't have to type passwords or so they don't have to rely on passwords. It can make sense if, say, you have boot encrypted, decrypt that with a password and then want other stuff decrypted without further intervention. Or if you keep the keyfile on an external device.

My final question:

- To prevent GRUB from breaking again, am I supposed to be mounting /boot every time I run `pacman -Syu` ?

Yes. If it is not mounted anyway, you need it mounted when you update the system. Specifically, you need it mounted when the kernel (or one of the kernels) is updated, but that is pretty frequent so mounting it before a system upgrade is safest. You might also need it mounted for other updates, but it will depend on what you have installed etc.

Still confused about the efi directory. I guess I will just have to research this. I remember seeing examples of people using `/boot/efi` as the mount point, but I guess they used that option `--efi-directory=/boot/efi`, whereas I just assumed GRUB didn't need to point to that path because it's the default.

Is there a reason why /boot is not mounted by default during `pacman -Syu` when it is in my `/etc/fstab`? Having to manually mount for kernel upgrades, which happens so frequently on Arch compared to say, Ubuntu, seems like an annoyance. I haven't run Ubuntu in sometime, but I don't remember a kernel upgrade every breaking GRUB because /boot was not mounted. Then again, maybe Ubuntu's kernel upgrade automatically mounted /boot in the background without me knowing.

Offline

#14 2022-11-15 16:35:28

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,143

Re: [SOLVED] Stuck in GRUB rescue mode. error: disk 'lvmid' not found.

It depends how you configured things in fstab (or equivalent). On my system, boot is mounted at /boot all the time, so there's no problem with upgrades. I believe this is pretty standard (and probably what happens on Ubuntu).

The point about the ESP path is that you're mounting your ESP at /boot and NOT at /boot/efi. Grub probably assumes /boot/efi by default, but /boot is a common choice on Arch.


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#15 2022-11-16 03:29:55

lv426
Member
Registered: 2022-11-11
Posts: 19

Re: [SOLVED] Stuck in GRUB rescue mode. error: disk 'lvmid' not found.

cfr wrote:

It depends how you configured things in fstab (or equivalent). On my system, boot is mounted at /boot all the time, so there's no problem with upgrades. I believe this is pretty standard (and probably what happens on Ubuntu).

The point about the ESP path is that you're mounting your ESP at /boot and NOT at /boot/efi. Grub probably assumes /boot/efi by default, but /boot is a common choice on Arch.

I changed `/boot/efi` to `/boot` in `/etc/fstab`. Hopefully I won't have any problems when the next kernel upgrade comes along. If I do, I know how to fix it now through the live USB.

Thank you again for all your help. I really appreciate it.

Marking this solved.

Offline

Board footer

Powered by FluxBB