Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Block device not a valid root device - LUKS/LVM/EFI Stub
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
killer_robo
n00b
n00b


Joined: 08 Feb 2008
Posts: 10

PostPosted: Fri Jun 11, 2021 3:23 am    Post subject: Block device not a valid root device - LUKS/LVM/EFI Stub Reply with quote

Hi all, I've been trying to install Gentoo on my Thinkpad X1 Carbon for a few days, but haven't been able to actually boot the system. My configuration is a LUKS-encrypted LVM, using an EFI stub kernel with a separate initramfs file. The laptop has an NVMe drive.

Right now, when I boot I get the following message:

Code:
Activating volume groups ...
Determining root device (trying PARTUUID=23cc2414-ebaf-494c-8eed-11e522ce9242) ..........
Block device PARTUUID=23cc2414-ebaf-494c-8eed-11e522ce9242 is not a valid root device ...
Could not find the root block device in PARTUUID=23cc2414-ebaf-494c-8eed-11e522ce9242.


Here is the command that I use to produce my initramfs, and its output:

Code:
$ genkernel --install --no-mountboot --luks --lvm --no-gpg --no-zfs --kernel-config=/usr/src/linux/.config --busybox --all-ramdisk-modules --firmware --initramfs
[32;01m* Gentoo Linux Genkernel; Version 4.2.1
* Using genkernel configuration from '/etc/genkernel.conf' ...
* Running with options: --install --no-mountboot --luks --lvm --no-gpg --no-zfs --kernel-config=/usr/src/linux/.config --busybox --all-ramdisk-modules --firmware initramfs

* Working with Linux kernel 5.10.27-gentoo for x86_64
* Using kernel config file '/usr/src/linux-5.10.27-gentoo/.config' ...

* Current kernel's LOCALVERSION is set to ''; Will ignore set --kernel-localversion value '-x86_64' because kernel was not build ...

* initramfs: >> Initializing ...
*         >> Appending devices cpio data ...
*         >> Appending base_layout cpio data ...
*         >> Appending util-linux cpio data ...
*         >> Appending eudev cpio data ...
*         >> Appending devicemanager cpio data ...
*         >> Appending auxiliary cpio data ...
*         >> Appending busybox cpio data ...
*         >> Appending luks cpio data ...
*         >> Appending lvm cpio data ...
*         >> Appending modprobed cpio data ...
*         >> Appending firmware cpio data ...
*         >> Appending modules cpio data ...
*         >> Appending linker cpio data ...
*         >> Deduping cpio ...
*         >> Pre-generating initramfs' /etc/ld.so.cache ...
*         >> Compressing cpio data (.gz) ...
*
* You will find the initramfs in '/boot/initramfs-5.10.27-gentoo.img'.

* WARNING... WARNING... WARNING...
* Additional kernel parameters that *may* be required to boot properly:
* - Add "dolvm" for LVM support
* - Add "crypt_root=<device>" for LUKS-encrypted root
* - Add "crypt_swap=<device>" for LUKS-encrypted swap
*
* With support for several ext* filesystems available, it may be needed to
* add "rootfstype=ext3" or "rootfstype=ext4" to the list of boot parameters.
*
* Note:
* You have set CONFIG_CMDLINE_OVERRIDE=y.
* You will be unable to alter set kernel parameters ("dolvm root=PARTUUID=23cc2414-ebaf-494c-8eed-11e522ce9242 crypt_root=UUID=3f786775-0e29-47b7-96e3-4a68212af929") at runtime!

* Do NOT report kernel bugs as genkernel bugs unless your bug
* is about the default genkernel configuration...
*
* Make sure you have the latest ~arch genkernel before reporting bugs.


I then move this file to /boot/EFI/Gentoo as per this wiki article: https://wiki.gentoo.org/wiki/EFI_Stub#Optional:_Initramfs.

Code:
$ tree -L 3 /boot
/boot/
└── EFI
    └── Gentoo
        ├── bzImage-5.10.27.efi
        └── initramfs.img

2 directories, 2 files


I used EFIBootMGR to update the entry, as per the above linked wiki article.

Not sure what else to post in advance. Here's my blkid output (the sda is an external HDD with a few partitions; I'm using the Gentoo LiveCD to chroot back into the system).

Code:
$ blkid
/dev/mapper/vg0-root: UUID="3f786775-0e29-47b7-96e3-4a68212af929" BLOCK_SIZE="4096" TYPE="ext3"
/dev/mapper/vg0-home: UUID="fb2259bb-8825-458d-bf92-93dceefa35ac" SEC_TYPE="ext2" BLOCK_SIZE="4096" TYPE="ext3"
/dev/mapper/vg0-swap: UUID="d64ba133-54f6-4c03-9863-1e41aeb023d5" TYPE="swap"
/dev/loop0: TYPE="squashfs"
/dev/nvme0n1p1: UUID="21D7-A293" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="EFI System Partition" PARTUUID="83ae3011-e253-447e-b3b7-4898119c7e65"
/dev/nvme0n1p2: UUID="b43d256f-ec10-47fa-b002-7d2adfa13bd0" TYPE="crypto_LUKS" PARTLABEL="lvm" PARTUUID="23cc2414-ebaf-494c-8eed-11e522ce9242"
/dev/sda1: LABEL="ntfs-store" BLOCK_SIZE="512" UUID="44BED3045679C827" TYPE="ntfs" PARTUUID="36b1ad90-0a32-a143-85af-0f8dd3eea98e"
/dev/sda3: BLOCK_SIZE="2048" UUID="2021-06-03-01-04-35-23" LABEL="Gentoo amd64 20210602T214502Z" TYPE="iso9660" PTUUID="134bd1a4" PTTYPE="dos" PARTUUID="91b8a131-b127-2443-86e1-d641c336c4f6"
/dev/mapper/lvm: UUID="MFbqnL-vJLr-lOoy-p7PO-Tezd-g1J6-J1yBzA" TYPE="LVM2_member"
/dev/sda2: PARTUUID="aa1a36b5-4628-424a-9c42-b45f800b51e8"


I've read the wiki articles for dm-crypt, LVM, EFI Stub, Initramfs, and NVMe, and I'm fairly certain that I have all my settings properly configured. My entire config is here: https://pastebin.com/HQWQf2AP

Code:
$ cat /usr/src/linux/.config | grep CMDLINE
CONFIG_CMDLINE_BOOL=y
CONFIG_CMDLINE="dolvm root=PARTUUID=23cc2414-ebaf-494c-8eed-11e522ce9242 crypt_root=UUID=3f786775-0e29-47b7-96e3-4a68212af929"
CONFIG_CMDLINE_OVERRIDE=y
CONFIG_EFI_GENERIC_STUB_INITRD_CMDLINE_LOADER=y
# CONFIG_BLK_CMDLINE_PARSER is not set
# CONFIG_CMDLINE_PARTITION is not set
CONFIG_FB_CMDLINE=y


Code:

$ cat /usr/src/linux/.config | grep EFI
CONFIG_EFI=y
CONFIG_EFI_STUB=y
CONFIG_EFI_MIXED=y
CONFIG_DMI_SCAN_MACHINE_NON_EFI_FALLBACK=y
# EFI (Extensible Firmware Interface) Support
CONFIG_EFI_VARS=y
CONFIG_EFI_ESRT=y
CONFIG_EFI_RUNTIME_MAP=y
# CONFIG_EFI_FAKE_MEMMAP is not set
CONFIG_EFI_RUNTIME_WRAPPERS=y
CONFIG_EFI_GENERIC_STUB_INITRD_CMDLINE_LOADER=y
# CONFIG_EFI_BOOTLOADER_CONTROL is not set
# CONFIG_EFI_CAPSULE_LOADER is not set
# CONFIG_EFI_TEST is not set
# CONFIG_EFI_RCI2_TABLE is not set
# CONFIG_EFI_DISABLE_PCI_DMA is not set
# end of EFI (Extensible Firmware Interface) Support
CONFIG_EFI_EARLYCON=y
CONFIG_EFI_CUSTOM_SSDT_OVERLAYS=y
CONFIG_EFI_PARTITION=y
CONFIG_FB_EFI=y
CONFIG_EFIVAR_FS=m
# CONFIG_EFI_PGT_DUMP is not set


Code:

$ cat /usr/src/linux/.config | grep NVME
# NVME Support
# CONFIG_BLK_DEV_NVME is not set
# CONFIG_NVME_FC is not set
# end of NVME Support
CONFIG_RTC_NVMEM=y
CONFIG_NVMEM=y
CONFIG_NVMEM_SYSFS=y


I've tried many variations of all these commands, including a much simpler genkernel --luks --lvm initramfs (it produces a different error that does not get as far as trying to activate the volume group or read the PARTUUID). I've tried using dracut to produce the initramfs, and get a similar error; I've tried removing the "dolvm" and "crypt_root=UUID=..." from the CMDLINE, but then it just produces a the same error, with whitespace where that string is in the above quote.

Any help would be appreciated! I've referred to the wiki articles for the various pieces of software being used, to Sakaki's guide, to the Full Disk Encryption from Scratch Simplified guide on the wiki, to Ali3nx's guide, as well as various forum threads. However, none of the advice I've found elsewhere has solved whatever problem it is I'm having--likely because none of them are trying to use an EFI stub kernel with a separate initramfs file (rather than compiled into the kernel).
Back to top
View user's profile Send private message
user
Apprentice
Apprentice


Joined: 08 Feb 2004
Posts: 168

PostPosted: Fri Jun 11, 2021 8:20 am    Post subject: Reply with quote

Hi killer_robo,
Code:
root=PARTUUID=23cc2414-ebaf-494c-8eed-11e522ce9242

pointed to an encrypted partition but root= expect decrypted filesystem.

My guess your root filesystem is
Code:
/dev/mapper/vg0-root: UUID="3f786775-0e29-47b7-96e3-4a68212af929" BLOCK_SIZE="4096" TYPE="ext3"

so try
Code:
root=UUID=3f786775-0e29-47b7-96e3-4a68212af929
Back to top
View user's profile Send private message
killer_robo
n00b
n00b


Joined: 08 Feb 2008
Posts: 10

PostPosted: Fri Jun 11, 2021 2:12 pm    Post subject: Reply with quote

user wrote:
Hi killer_robo,
Code:
root=PARTUUID=23cc2414-ebaf-494c-8eed-11e522ce9242

pointed to an encrypted partition but root= expect decrypted filesystem.

My guess your root filesystem is
Code:
/dev/mapper/vg0-root: UUID="3f786775-0e29-47b7-96e3-4a68212af929" BLOCK_SIZE="4096" TYPE="ext3"

so try
Code:
root=UUID=3f786775-0e29-47b7-96e3-4a68212af929


This produces the same error, but with whitespace where it once displayed the PARTUUID.

Code:
 Activating volume group ...
Failed to find LUKS device. If crypt_root kernel command-line argument is correct you are probably missing kernel support for your storage!
Could not find the root in .


I also tried with root=/dev/mapper/vg0-root.
Back to top
View user's profile Send private message
Goverp
Veteran
Veteran


Joined: 07 Mar 2007
Posts: 1185

PostPosted: Fri Jun 11, 2021 3:46 pm    Post subject: Reply with quote

Are you sure you don't need CONFIG_BLK_DEV_NVME? I suspect you need that to read the partition labelled "lvm".
_________________
Greybeard
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 48578
Location: 56N 3W

PostPosted: Fri Jun 11, 2021 3:52 pm    Post subject: Reply with quote

killer_robo,

Code:
Could not find the root in .
contains a list of all the block devices the kernel can see.
That's an empty list, so the kernel cannot see the device that holds your LUKS container.

When booting fails, it should offer you a shell.
Go into the shell and run
Code:
ls /dev

If its empty, then devtmpfs is not being mounted.

If its populated, do you see sd* or nvme* ?

-- edit --

Code:
/dev/nvme0n1p1: UUID="21D7-A293" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="EFI System Partition" PARTUUID="83ae3011-e253-447e-b3b7-4898119c7e65"
/dev/nvme0n1p2: UUID="b43d256f-ec10-47fa-b002-7d2adfa13bd0" TYPE="crypto_LUKS" PARTLABEL="lvm" PARTUUID="23cc2414-ebaf-494c-8eed-11e522ce9242"

and
Code:
$ cat /usr/src/linux/.config | grep NVME
# NVME Support
# CONFIG_BLK_DEV_NVME is not set


Means that you don't have the kernel block device driver you need.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
killer_robo
n00b
n00b


Joined: 08 Feb 2008
Posts: 10

PostPosted: Fri Jun 11, 2021 6:44 pm    Post subject: Reply with quote

Goverp wrote:
Are you sure you don't need CONFIG_BLK_DEV_NVME? I suspect you need that to read the partition labelled "lvm".


Can't believe I missed this. What a jackass I am. Works now. :oops:
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum