You are not logged in.

#1 2024-10-17 16:51:01

yataghan012
Member
Registered: 2024-10-17
Posts: 3

Can't Install GRUB, "grub-install: error: disk lvmid not found"

Hello, I'm trying to setup a new system on a qemu VM and I'm making some tests, so I can later implement it on my actual hardware.

The system consists of Arch Linux as main distro and booted .iso. Disk formatting is: LVM with thinpool (one partition for root, then data, a nextcloud server partition and a whonix partition, these last two encrypted with LUKS), BTRFS in all partitions except the whonix partition with ext4 and a swap partition inside the volume group of the thinpool. And I later plan to make the system dual boot with whonix and enable snapshots. However I got stuck installing GRUB for UEFI while in chroot, I already tried solving this issue editing and recreating the "mkinitcpio" file by adding "lvm2" but nothing. I'll detail my procedure:

1) Enter live system through "Install medium". Install and use reflector for mirrors.
2) Partitioning: "gdisk /dev/vda". Set gpt "o". Create a EFI system partition 200M. Create a LVM partition (~49GB).
3) Set up LVM: "pvcreate /dev/vda2", "vgcreate my_vg /dev/vda2", logical volumes: "lvcreate --size 46.5G --thinpool my_thin my_vg", "lvcreate --thin -V22GB my_vg/my_thin -n root", "lvcreate --thin -V3GB my_vg/my_thin -n data", "lvcreate --thin -V10GB my_vg/my_thin -n nextcloud", "lvcreate --thin -V11.5GB my_vg/my_thin -n whonix". swap: ""lvcreate -L 3G -n swap my_vg"
4) Encrypt partitions: "cryptsetup luksFormat /dev/my_vg/nextcloud" and "cryptsetup luksOpen /dev/my_vg/nextcloud nextcloud_crypt" (same commands for whonix)
5)Formatting: "mkfs.btrfs /dev/my_vg/root" (and /data) "mkfs.fat -F32 /dev/vda1", "mkfs.btrfs /dev/mapper/nextcloud_crypt", "mkfs.ext4 /dev/mapper/whonix_crypt". Swap: "mkswap /dev/my_vg/swap" and "swapon /dev/my_vg/swap"
6)Mounting: "mount /dev/my_vg/root /mnt", "mkdir /mnt/data" and "mount dev/my_vg/data /mnt/data", "mkdir -p /boot/efi" and "mount /dev/vda1 /boot/efi", "mkdir /mnt/nextcloud" and "mount /dev/mapper/nextcloud_crypt /mnt/nextcloud", "mkdir /mnt/whonix" and "mount /dev/mapper/whonix_crypt /mnt/whonix".
7)Set Home folder on DATA partition: -Create a BTRFS subvolume for /home:"btrfs subvolume create /mnt/data/@home" -Mount data partition as /home: "umount /mnt/data", "mkdir /mnt/home", "mount -o subvol=@home /dev/my_vg/data /mnt/home"
8)Install base packages: "pacstrap /mnt base linux-lts linux-firmware amd-ucode nano lvm2"
9)Configure fstab: "genfstab -U /mnt >> /mnt/etc/fstab"
10)Enter chroot: "arch-chroot /mnt". Installing GRUB: "pacman -S grub efibootmgr". Changed hooks in "/etc/mkinitcpio.conf" added "lvm2" between block and filesystems. And recreate "mkinitcpio -p linux-lts"

then "grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB" gives me "grub-install: error: disk lvmid/Ew306z-umcz-3WSW-FU0e-2QQ6-DCBL-rboAm0/ZjpcfC-fenW-VbgK-oVYZ-sc03-NNRf-c36db1' not found." and I'm not sure how to proceed.

I also appreciate constructive criticism at the whole procedure I'm attempting to do, I'll be attentive to that as well.

Offline

#2 2024-10-17 17:42:07

Scimmia
Fellow
Registered: 2012-09-01
Posts: 12,119

Re: Can't Install GRUB, "grub-install: error: disk lvmid not found"

Why are you telling it your ESP is at /boot if that's not where you mounted it?

Online

#3 2024-10-17 18:29:36

yataghan012
Member
Registered: 2024-10-17
Posts: 3

Re: Can't Install GRUB, "grub-install: error: disk lvmid not found"

Scimmia wrote:

Why are you telling it your ESP is at /boot if that's not where you mounted it?

Because it says "failed to get canonical path of '/boot/efi'

Offline

#4 2024-10-18 01:25:00

Scimmia
Fellow
Registered: 2012-09-01
Posts: 12,119

Re: Can't Install GRUB, "grub-install: error: disk lvmid not found"

Then that's what needs debugged. What is the output of `mount`?

Online

#5 2024-10-18 06:03:53

yataghan012
Member
Registered: 2024-10-17
Posts: 3

Re: Can't Install GRUB, "grub-install: error: disk lvmid not found"

Scimmia wrote:

Then that's what needs debugged. What is the output of `mount`?

I thought it had something to do with the encrypted partitions

  
/dev/mapper/newvg-root on / type btrfs (rw, relatime, discard=async, space_cache=v2, subvolid=5, subvol=/) 
/dev/mapper/newvg-data on /data type btrfs (rw, relatime, discard=async,space_cache=v2, subvolid=5, subvol=/) 
/dev/mapper/nextcloud_crypt on /nextcloud type btrfs_(rw, relatime, space_cache=v2, subvolid=5, subvol=/) 
/dev/mapper/whonix_crypt on /whonix type ext4 (rw, relatime, stripe=16)
proc on /proc type proc (rw, nosuid, nodev, noexec, relatime)
sys on /sys type sysfs (ro, nosuid, nodev, noexec, relatime)
efivarfs on /sys/firmware/efi/efivars type efivarfs (rw, nosuid, nodev, noexec, relatime)
udev on /dev type devtmpfs (rw, nosuid, relatime,size=1927620k, nr_inodes=481905,mode=755, inode64)
deupts on /dev/pts type deupts (ru,nosuid, noexec, relatime, gid=5,mode=620,ptmxmode=000)
shm on /dev/shm type tmpfs (rw,nosuid, nodev, relatime, inode64)
run on /run type tmpfs (rw, nosuid, nodev, relatime,mode=755, inode64)
tmp on /tmp type tmpfs (rw, nosuid, nodev, inode64)
run on /etc/resolv.conf type tmpfs (rw, nosuid, nodev, relatime, mode=755, inode64)

I noticed "/boot/efi" is not listed, I tried the commands I did during the mounting step again this time in chroot and it returns the same error I first pointed out (lvmid not found...).

update: The UUID refers to (volume group)/root

Last edited by yataghan012 (2024-10-18 16:10:52)

Offline

#6 2024-10-26 20:00:34

live4thamuzik
Member
Registered: 2024-02-27
Posts: 49

Re: Can't Install GRUB, "grub-install: error: disk lvmid not found"

yataghan012 wrote:

Hello, I'm trying to setup a new system on a qemu VM and I'm making some tests, so I can later implement it on my actual hardware.

The system consists of Arch Linux as main distro and booted .iso. Disk formatting is: LVM with thinpool (one partition for root, then data, a nextcloud server partition and a whonix partition, these last two encrypted with LUKS), BTRFS in all partitions except the whonix partition with ext4 and a swap partition inside the volume group of the thinpool. And I later plan to make the system dual boot with whonix and enable snapshots. However I got stuck installing GRUB for UEFI while in chroot, I already tried solving this issue editing and recreating the "mkinitcpio" file by adding "lvm2" but nothing. I'll detail my procedure:

1) Enter live system through "Install medium". Install and use reflector for mirrors.
2) Partitioning: "gdisk /dev/vda". Set gpt "o". Create a EFI system partition 200M. Create a LVM partition (~49GB).
3) Set up LVM: "pvcreate /dev/vda2", "vgcreate my_vg /dev/vda2", logical volumes: "lvcreate --size 46.5G --thinpool my_thin my_vg", "lvcreate --thin -V22GB my_vg/my_thin -n root", "lvcreate --thin -V3GB my_vg/my_thin -n data", "lvcreate --thin -V10GB my_vg/my_thin -n nextcloud", "lvcreate --thin -V11.5GB my_vg/my_thin -n whonix". swap: ""lvcreate -L 3G -n swap my_vg"
4) Encrypt partitions: "cryptsetup luksFormat /dev/my_vg/nextcloud" and "cryptsetup luksOpen /dev/my_vg/nextcloud nextcloud_crypt" (same commands for whonix)
5)Formatting: "mkfs.btrfs /dev/my_vg/root" (and /data) "mkfs.fat -F32 /dev/vda1", "mkfs.btrfs /dev/mapper/nextcloud_crypt", "mkfs.ext4 /dev/mapper/whonix_crypt". Swap: "mkswap /dev/my_vg/swap" and "swapon /dev/my_vg/swap"
6)Mounting: "mount /dev/my_vg/root /mnt", "mkdir /mnt/data" and "mount dev/my_vg/data /mnt/data", "mkdir -p /boot/efi" and "mount /dev/vda1 /boot/efi", "mkdir /mnt/nextcloud" and "mount /dev/mapper/nextcloud_crypt /mnt/nextcloud", "mkdir /mnt/whonix" and "mount /dev/mapper/whonix_crypt /mnt/whonix".
7)Set Home folder on DATA partition: -Create a BTRFS subvolume for /home:"btrfs subvolume create /mnt/data/@home" -Mount data partition as /home: "umount /mnt/data", "mkdir /mnt/home", "mount -o subvol=@home /dev/my_vg/data /mnt/home"
8)Install base packages: "pacstrap /mnt base linux-lts linux-firmware amd-ucode nano lvm2"
9)Configure fstab: "genfstab -U /mnt >> /mnt/etc/fstab"
10)Enter chroot: "arch-chroot /mnt". Installing GRUB: "pacman -S grub efibootmgr". Changed hooks in "/etc/mkinitcpio.conf" added "lvm2" between block and filesystems. And recreate "mkinitcpio -p linux-lts"

then "grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB" gives me "grub-install: error: disk lvmid/Ew306z-umcz-3WSW-FU0e-2QQ6-DCBL-rboAm0/ZjpcfC-fenW-VbgK-oVYZ-sc03-NNRf-c36db1' not found." and I'm not sure how to proceed.

I also appreciate constructive criticism at the whole procedure I'm attempting to do, I'll be attentive to that as well.

Typically when I use LVM and LUKS, I swap steps 3 & 4. So following what you have the order would be 1,2,4,3,5,6,etc....

Add these to the end your LVM setup:

modprobe dm_mod

vgscan

vgchange -ay

Then Proceed to step 5.

Last edited by live4thamuzik (2024-10-26 20:05:17)

Offline

Board footer

Powered by FluxBB