Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
lvm on luks, open volume with custom name
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
sad_dam
n00b
n00b


Joined: 07 May 2018
Posts: 12

PostPosted: Thu Jul 19, 2018 7:34 am    Post subject: lvm on luks, open volume with custom name Reply with quote

Hello, how to set up grub to open encrypted volume with custom name?

sda2:
Code:
NAME                   FSTYPE
sda                   
├─sda1                 ext2
└─sda2                 crypto_LUKS
  └─root_sda2-vg0-root LVM2_member
    ├─vg0-swap         swap
    └─vg0-root         ext4


My grub.conf:
Code:
menuentry "Gentoo" {
   linux /kernel-linux-x86_64-4.14.52-gentoo dolvm crypt_root=UUID=db5b400d-25a8-433e-bf0e-7ba884952b60 root=/dev/mapper/vg0-root init=/lib/systemd/systemd loglevel=3 ro
   initrd /initramfs-linux-x86_64-4.14.52-gentoo
}


In my previous installations, everything was fine, with what names i were opening volumes during installation, such names and remained.
Now apparently it did not work and luks opens volume with a garbage name.
A minor problem, but I still would like to know how to fix it.
Back to top
View user's profile Send private message
PrSo
Tux's lil' helper
Tux's lil' helper


Joined: 01 Jun 2017
Posts: 127

PostPosted: Thu Jul 19, 2018 11:02 am    Post subject: Reply with quote

Are you using genkernel or genkernel-next ("real_root=UUID=", and "rootfstype=")?

Maybe you could try UUID's to specify root partition in grub commandline?
Code:
lsblk -f
Back to top
View user's profile Send private message
sad_dam
n00b
n00b


Joined: 07 May 2018
Posts: 12

PostPosted: Thu Jul 19, 2018 11:39 am    Post subject: Reply with quote

PrSo wrote:
Are you using genkernel or genkernel-next ("real_root=UUID=", and "rootfstype=")?

genkernel-next
PrSo wrote:
Maybe you could try UUID's to specify root partition in grub commandline?
Code:
lsblk -f

The name has changed.
Code:
NAME
sda
├─sda1
└─sda2
  └─sda2
    ├─vg0-swap
    └─vg0-root
Back to top
View user's profile Send private message
PrSo
Tux's lil' helper
Tux's lil' helper


Joined: 01 Jun 2017
Posts: 127

PostPosted: Thu Jul 19, 2018 11:55 am    Post subject: Reply with quote

First "sda2" is "crypto_LUKS" and second is "LVM2_member", so now it seems ok to me.
Back to top
View user's profile Send private message
sad_dam
n00b
n00b


Joined: 07 May 2018
Posts: 12

PostPosted: Fri Jul 20, 2018 1:05 am    Post subject: Reply with quote

PrSo wrote:
First "sda2" is "crypto_LUKS" and second is "LVM2_member", so now it seems ok to me.

I don't know what do you mean ok.
My request is "how to set up grub to open encrypted volume with custom name".
Back to top
View user's profile Send private message
PrSo
Tux's lil' helper
Tux's lil' helper


Joined: 01 Jun 2017
Posts: 127

PostPosted: Fri Jul 20, 2018 6:15 am    Post subject: Re: lvm on luks, open volume with custom name Reply with quote

From the output of lsblk that you have provided:
- fist "sda2" - (crypto_LUKS) is physical partition encrypted by luks, created by "luksFormat..." command - LUKS volume, and opened by "luksOpen.." during instalation;
- second "sda2" - (LVM2_member) is a logical partition with physical volume group which contains logical volume group created by "vgcreate .."(in your case "vg0") and it has two logical volumes "root" and "swap" created by "pvcreate...".

From your grub kernel command line name of volume group appear to be "vg0" and "/" partition name appear to be "root".

Generaly LUKS volumes don't have a names.

Logical volume group names can be changed by "vgrename.." and volume name with "lvrename" command.
You can see actual volume names with "lvdisplay"

If you want to label filesystem inside luks container there are tools to do that ie. for ext4 there is "e2label" or "tune2fs -L".

What do you mean by "encrypted volume with custom name"? Please, can you elaborate?
Back to top
View user's profile Send private message
Ultimator
n00b
n00b


Joined: 23 Jun 2018
Posts: 11

PostPosted: Thu Aug 16, 2018 4:57 pm    Post subject: Re: lvm on luks, open volume with custom name Reply with quote

PrSo wrote:
What do you mean by "encrypted volume with custom name"? Please, can you elaborate?


The aim is probably to have something like this

Code:

NAME                   FSTYPE
sda                   
├─sda1                 ext2
└─sda2                 crypto_LUKS
  └─custom-name-here   LVM2_member
    ├─vg0-swap         swap
    └─vg0-root         ext4


In Arch Linux this is accomplished by adding a custom name preceeded by a colon to the cryptdevice parameter in the grub config.
Code:
cryptdevice=UUID=device-UUID:custom-name-here

However when adding the same to the crypt_root parameter in gentoo it fails to boot.
Code:
crypt_root=UUID=device-UUID:custom-name-here
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