Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Problem when booting with encrypted 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
Dechcaudron
n00b
n00b


Joined: 22 Jan 2020
Posts: 1

PostPosted: Wed Jan 22, 2020 10:18 pm    Post subject: Problem when booting with encrypted root Reply with quote

Hi all,

My setup involves a 4-partition disk, with the last one being used completely as the only PV of a main LV. This LV is then encrypted. When I boot from the Live distribution, I do something like

cryptsetup luksOpen /dev/mapper/encrypted-PV decrypted-PV

so that /dev/mapper/decrypted-PV will be created and I will mount it normally.
My fstab lists /dev/mapper/decrypted-PV as the target for the mount point "/". However, when finishing the installation and specifying the initramfs kernel parameters:

dolvm crypt_root=/dev/mapper/encrypted-PV

it results in the initramfs kernel asking me for the key for <...>/encrypted-PV, which suceeds, but then fails to find <...>/decrypted-PV. Entering the rescue shell and `ls /dev/mapper`-ing reveals the block device providing access to the decrypted content has the name "root", as if cryptsetup was being passed "root" as its last parameter. I assume there has to be a way to change that, but I have not been able to find it. Passing the initramfs kernel parameter root=/dev/mapper/root indeed circumvents the issue, successfully mounting the partition and allowing me to log in normally. I have tried specifying root=<...>/decrypted-PV, but it does not make a difference.

Is there a way to specify the name of the resulting block device?

Thanks in advance,
Dechcaudron
Back to top
View user's profile Send private message
SpiderPigLoki
n00b
n00b


Joined: 22 Aug 2008
Posts: 74

PostPosted: Wed Jan 29, 2020 9:09 pm    Post subject: Re: Problem when booting with encrypted root Reply with quote

Dechcaudron wrote:
When I boot from the Live distribution, I do something like

cryptsetup luksOpen /dev/mapper/encrypted-PV decrypted-PV

so that /dev/mapper/decrypted-PV will be created and I will mount it normally.


Shouldn't it be something like
Code:
cryptsetup luksOpen /dev/sda2 encrypted-pv


You want to open the partition on the hard drive (because it's encrypted) and then open the LVM to mount it.

As regards to grub, here's my /etc/default/grub:
Quote:
RUB_CMDLINE_LINUX="rd.luks.allow-discards net.ifnames=0 dolvm real_resume=/dev/mapper/gentoo-swap crypt_root=/dev/sda2 real_root=/dev/mapper/gentoo-root rootfstype=ext4 verbose rd.luks.uuid=luks-68bbd643-d419-4a20-a9cd-90921f807e05"


Maybe it helps you to figure somethings out and inspire you :D

Kind regards
SPL
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