Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Solved] LVM on LUKS with rEFInd: Unable to mount root
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
glamhckr
n00b
n00b


Joined: 03 Jun 2018
Posts: 6

PostPosted: Sun Jun 03, 2018 2:25 pm    Post subject: [Solved] LVM on LUKS with rEFInd: Unable to mount root Reply with quote

Hi All,

I'm a long-time Arch user, and having recently become interested in Gentoo I recently attempted to install it alongside Arch on my Thinkpad T470. So far, I've been able to install Gentoo from my Arch installation (via chroot), but I'm having issues during boot, where I receive the following error:

Code:

Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)


To explain my setup in more detail, I'm using LVM on LUKS with dm-crypt:

Code:

nvme0n1         259:0    0  477G  0 disk 
├─nvme0n1p1     259:1    0    1G  0 part  /boot
├─nvme0n1p2     259:2    0  349G  0 part 
│ └─cryptoroot  254:0    0  349G  0 crypt
│   ├─vol-swap  254:1    0   30G  0 lvm   [SWAP]
│   ├─vol-root  254:2    0   61G  0 lvm   
│   ├─vol-home  254:3    0  199G  0 lvm   
│   └─vol-groot 254:4    0   59G  0 lvm   /
├─nvme0n1p3     259:3    0   16M  0 part 
└─nvme0n1p4     259:4    0 97.7G  0 part 


I set up the logical container 'vol-groot' which holds my Gentoo installation, and I'm using rEFInd to boot:

Code:

$ tree /boot -L 3
/boot
├── EFI
│   ├── Arch
│   │   ├── initramfs-linux-fallback.img
│   │   ├── initramfs-linux.img
│   │   ├── refind_linux.conf
│   │   └── vmlinuz-linux
│   ├── Boot
│   │   └── bootx64.efi
│   ├── Gentoo
│   │   ├── initramfs-genkernel-x86_64-4.9.95-gentoo
│   │   ├── old
│   │   ├── refind_linux.conf
│   │   ├── System.map-genkernel-x86_64-4.9.95-gentoo
│   │   └── vmlinuz-linux
│   ├── Microsoft
│   │   ├── Boot
│   │   └── Recovery
│   ├── refind
│   │   ├── BOOT.CSV
│   │   ├── icons
│   │   ├── keys
│   │   ├── refind.conf
│   │   ├── refind_x64.efi
│   │   └── themes
│   └── tools
└── intel-ucode.img


Here is my 'refind_linux.conf'. Note: this configuration is working perfectly with my Arch installation (albeit using mkinitcpio):

Code:

"Boot with Gentoo defaults" "cryptdevice=/dev/disk/by-partuuid/5ef2eaac-76b6-4e40-90a5-69a49ba85d69:cryptogroot root=/dev/mapper/vol-groot rw"


Here's my output of 'blkid' for reference:

Code:

/dev/nvme0n1: UUID="cc06d47d-ef5a-4f1c-9769-18eecbd4d0cb" TYPE="crypto_LUKS" PTUUID="72e86fc1-577f-419a-baa6-6d5246642916" PTTYPE="gpt"
/dev/nvme0n1p1: UUID="F567-A140" TYPE="vfat" PARTLABEL="EFI System" PARTUUID="c5b9b2ef-7254-4e96-a341-5b5bfb25c0e5"
/dev/nvme0n1p2: UUID="2890a755-42e9-40cb-92ec-00208ed5f695" TYPE="crypto_LUKS" PARTLABEL="Linux filesystem" PARTUUID="5ef2eaac-76b6-4e40-90a5-69a49ba85d69"
/dev/nvme0n1p4: UUID="54F4A9E1F4A9C618" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="b92c6bbd-0808-4091-8f03-0c54795f2b37"
/dev/mapper/cryptoroot: UUID="EP8kHM-1wXj-2AZo-fN2q-R680-S3M8-E8iLhm" TYPE="LVM2_member"
/dev/mapper/vol-swap: UUID="b6662774-1a20-4fec-a791-33a08ab6af2e" TYPE="swap"
/dev/mapper/vol-root: UUID="ebd0e659-d99f-4e0f-ad17-6b2fa3a03e46" TYPE="ext4"
/dev/mapper/vol-home: UUID="42d0a13c-7402-48da-b673-827bf6d1869d" TYPE="ext4"
/dev/mapper/vol-groot: UUID="c8037bf6-7c03-4ea2-b20d-96fbc63fb06d" TYPE="ext4"
/dev/nvme0n1p3: PARTLABEL="Microsoft reserved partition" PARTUUID="dad530d3-5518-4fb6-a243-d12693502da0"


My LUKS container uses 'aes-xts-plain64' which has been enabled in the kernel (not as a module):

Code:

$ dmsetup table cryptoroot
... crypt aes-xts-plain64 ...


Kernel was compiled with the following options, as per the documentation (full kernel at https://pastebin.com/CuhA7tQN):

Code:

$ genkernel --luks --lvm --no-zfs all


I've tried many combinations and different alterations to the rEFInd config such as 'enc_root' and 'root=/dev/ram0' but nothing seems to work and I receive the same errors each time I boot. What's interesting here is that it sometimes looks like it attempts to mount my LVM container /dev/mapper/vol-groot before unlocking LUKS, though I'm never prompted for a passphrase.

Any help is greatly appreciated, and let me know if I have left anything out. Thank you!

EDIT: Title updated


Last edited by glamhckr on Mon Jun 04, 2018 8:19 pm; edited 2 times in total
Back to top
View user's profile Send private message
glamhckr
n00b
n00b


Joined: 03 Jun 2018
Posts: 6

PostPosted: Mon Jun 04, 2018 11:41 am    Post subject: Reply with quote

Just an update on my progress with this issue -- I booted up with initramfs and recieve a similar error: 'Could not find the root block device in .' which indicates there were no devices found.

I then changed my rEFInd boot options to the following:

Code:

crypt_root=UUID=2890a755-42e9-40cb-92ec-00208ed5f695 rootfstype=ext4 real_root=/dev/mapper/vol-groot ro


When I reboot, I see the following error:

Code:

Device /dev/disk/by-uuid/2890a755-42e9-40cb-92ec-00208ed5f695' doesn't exist or access denied.
The LUKS device UUID=2890a755-42e9-40cb-92ec-00208ed5f695 does not contain a LUKS header.


I then opened a shell to determine the contents of '/dev/' and I noticed two things:
- The '/dev/disk' directory does not exist.
- None of my '/dev/nvme*' devices are listed here.

When I perform a 'blkid' from this shell, I don't see any of the NVMe devices. As a result, it's possible that the NVMe device is not being detected, although I'm sure I enabled it prior to kernel compilation. Does anyone know if I'm missing any other options I might have missed?

Any further ideas are greatly appreciated!
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7553
Location: Goose Creek SC

PostPosted: Mon Jun 04, 2018 4:13 pm    Post subject: Reply with quote

does the genkernel created initramfs inlude nvme drivers?
_________________
Defund the FCC.
Back to top
View user's profile Send private message
glamhckr
n00b
n00b


Joined: 03 Jun 2018
Posts: 6

PostPosted: Mon Jun 04, 2018 4:27 pm    Post subject: Reply with quote

Hi Donahue,

I just included 'CONFIG_BLK_DEV_NVME' in the kernel (which was previously set as a module for some reason) and recompiled but unfortunately that made no difference. That said, I'm checking again and it looks like my .config file has reverted once again to 'M' for this option. I'll recompile once more and update the thread if it makes any difference.
Back to top
View user's profile Send private message
glamhckr
n00b
n00b


Joined: 03 Jun 2018
Posts: 6

PostPosted: Mon Jun 04, 2018 5:15 pm    Post subject: Reply with quote

Hmm, I set 'CONFIG_BLK_DEV_NVME' to be built-in again but after performing a genkernel it was reverted back to 'M' -- not sure why, I assume it's conflicting with some other setting.
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6228
Location: Room 101

PostPosted: Mon Jun 04, 2018 5:51 pm    Post subject: Reply with quote

glamhckr wrote:
Hmm, I set 'CONFIG_BLK_DEV_NVME' to be built-in again but after performing a genkernel it was reverted back to 'M' -- not sure why, I assume it's conflicting with some other setting.

glamhckr ... never used genkernel, but from what I've read (and someone correct me if I'm wrong) you need to use 'genkernel --menuconfig' ... and then make your changes.

HTH & best ... khay
Back to top
View user's profile Send private message
glamhckr
n00b
n00b


Joined: 03 Jun 2018
Posts: 6

PostPosted: Mon Jun 04, 2018 7:33 pm    Post subject: Reply with quote

Thanks khayyam, that actually did the trick! It turns out I was using 'make menuconfig' rather than 'genkernel menuconfig' 8O Looks like I confused myself whilst referencing multiple sources.

Is there an advantage of using 'make' over 'genkernel'?
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6228
Location: Room 101

PostPosted: Mon Jun 04, 2018 7:48 pm    Post subject: Reply with quote

glamhckr wrote:
Is there an advantage of using 'make' over 'genkernel'?

glamhckr ... that would depend on who you ask, genkernel is what all the documentation points to, and so what many use. If you're doing 'genkernel --menuconfig' then what is the difference between this and 'make menuconfig ; make'? Like many tools, its of very little use if you need to do something outside its scope, and most of the time you need to do just that (ie, strip out cruft, select needed drivers, etc).

best ... khay
Back to top
View user's profile Send private message
glamhckr
n00b
n00b


Joined: 03 Jun 2018
Posts: 6

PostPosted: Mon Jun 04, 2018 8:17 pm    Post subject: Reply with quote

I understand. Thanks for your assistance and pointing me in the right direction! Marking this thread as solved.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo 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