View previous topic :: View next topic |
Author |
Message |
sad_dam n00b
Joined: 07 May 2018 Posts: 23
|
Posted: Thu Jul 19, 2018 7:34 am Post subject: lvm on luks, open volume with custom name |
|
|
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 |
|
|
PrSo Tux's lil' helper
Joined: 01 Jun 2017 Posts: 136
|
Posted: Thu Jul 19, 2018 11:02 am Post subject: |
|
|
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?
|
|
Back to top |
|
|
sad_dam n00b
Joined: 07 May 2018 Posts: 23
|
Posted: Thu Jul 19, 2018 11:39 am Post subject: |
|
|
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?
|
The name has changed.
Code: | NAME
sda
├─sda1
└─sda2
└─sda2
├─vg0-swap
└─vg0-root
|
|
|
Back to top |
|
|
PrSo Tux's lil' helper
Joined: 01 Jun 2017 Posts: 136
|
Posted: Thu Jul 19, 2018 11:55 am Post subject: |
|
|
First "sda2" is "crypto_LUKS" and second is "LVM2_member", so now it seems ok to me. |
|
Back to top |
|
|
sad_dam n00b
Joined: 07 May 2018 Posts: 23
|
Posted: Fri Jul 20, 2018 1:05 am Post subject: |
|
|
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 |
|
|
PrSo Tux's lil' helper
Joined: 01 Jun 2017 Posts: 136
|
Posted: Fri Jul 20, 2018 6:15 am Post subject: Re: lvm on luks, open volume with custom name |
|
|
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 |
|
|
Ultimator n00b
Joined: 23 Jun 2018 Posts: 26
|
Posted: Thu Aug 16, 2018 4:57 pm Post subject: Re: lvm on luks, open volume with custom name |
|
|
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 |
|
|
|