You are not logged in.

#1 2017-03-26 11:17:03

rookie0
Member
Registered: 2017-02-19
Posts: 11

Grub vs. LVM on LUKS

Hi,

I have installed Arch on a "LVM on LUKS" layout. I am using grub for booting.
Layout is:

sda1 - /boot/efi (of course not encrypted)
sda2 - dont care
sda3 - root (LVM on LUKS)
(no seperate boot partition)

Everything works fine. SOMETIMES. Thats the problem.
After the first installation I rebooted and grub did not accept my password for unlocking. The password was correct, I could unlock the disk on a live system on USB stick.
I had no idea what do to but just to be sure I changed (luksChangeKey) the password to "aaaa". I rebooted and it worked. Then I set it back to the old password. It still worked.
But after some time it stopped working again on boot. Same password, still working on live usb system. I did not change grub/kernel/boot/etc...
I decided to choose another password just to make sure I dont mix up with the US keyboad layout (I am using a german qwertz keyboard). And it worked again. Today I booted the system and... grub dont accept my password. I did not change anything since last boot.

Now I just used the live usb system again to verify the password is still working. And yes, it still works. So I went back to grub to read the exact error messages (lvmid not found) to post them here. Guess what, its booting now....

I have NO idea what is happening smile
It is like I have to open the crypted disk once to get it booting again but this is not working all the time.

I used https://wiki.archlinux.org/index.php/Dm … VM_on_LUKS for creating but as you can see above I have no seperate boot partition.

Some configs I changed:

// /etc/default/grub

GRUB_CMDLINE_LINUX="cryptdevice=UUID=[correct uuid]:cryptolvm"
GRUB_ENABLE_CRYPTODISK=y
// /boot/grub/grub.cfg
// Interesting parts are looking good...
[...]
menuentry ....
[...]
cryptomount -u [UUID] // which is the correct one
set root = 'lmvid/[vg id]/[lv id]' // correct

Please let me know if you need to see any other config.

Thanks for reading and best regards!

Offline

#2 2017-03-26 11:24:06

frostschutz
Member
Registered: 2013-11-15
Posts: 1,409

Re: Grub vs. LVM on LUKS

Things that work "sometimes" are hard to debug. If your config was really wrong then it would work "never".

If your /boot/efi is not encrypted, then what are you using grub cryptodisk for? Can't you just go with unencrypted grub/kernel/initramfs/...?

If you have keyboard layout issues, you can add the same passphrase twice, once for german and once for US layout so LUKS will accept the same key sequence regardless of layout. ( http://unix.stackexchange.com/a/174657/30851 )

Offline

#3 2017-03-26 11:59:59

rookie0
Member
Registered: 2017-02-19
Posts: 11

Re: Grub vs. LVM on LUKS

Hi, thanks for the fast reply!

I want to have kernel/initramfs encrypted too. I dont need encryption at all but I just want it... smile
I dont have keyboard issues. I just changed the password to exclude this possibility.

Thanks

Offline

#4 2017-03-27 16:22:17

rookie0
Member
Registered: 2017-02-19
Posts: 11

Re: Grub vs. LVM on LUKS

Hi, I have new information smile
It seems it only happens on a cold start. I have to open the disk once (using live system on usb stick) and then I can successfully boot and do (warm) reboots....

Offline

#5 2017-03-30 16:22:32

rookie0
Member
Registered: 2017-02-19
Posts: 11

Re: Grub vs. LVM on LUKS

Alright I think I found the problem and I guess its always a good idea to share smile
It seems like there is already some date in the input buffer when booting. So when I press backspace some times before entering the password it works...
Well... I will take that as a valid workaround smile

Offline

Board footer

Powered by FluxBB