You are not logged in.

#1 2017-11-12 16:38:31

FallingStar
Guest

[SOLVED] LVM on LUKS

Hello,

I'm new to Arch Linux, I recently installed it on my desktop system and was quite impressed that I thought I'd installed in on my laptop.
But since I carry my laptop around I decided to install it on top of a encrypted partition incase my laptop ever gets stolen.

I used the following wiki page
to set it up  I used a seperate /boot (ext4) partition. I setup the mkinitcpio.conf with the HOOKS(base systemd  autodetect  modconf keyboard keymap  block lvm2 encrypt filesystems fsck) mentioned. For grub to be able to unlock the
encrypted edited /etc/default/grub

GRUB_CMDLINE_LINUX="cryptdevice=UUID=(encrypted partition uuid):cryptolvm root=/dev/mapper/system-root"

and I tried

GRUB_CMDLINE_LINUX="cryptdevice=/dev/sda2:cryptolvm root=/dev/mapper/system-root"

Then generated grub.cfg via grub-mkconfig -o /boot/grub/grub.cfg.When I boot up I see grub and it tries to open root but it fails to open root.  When I boot from usb and mount my partitions and
enter into arch-chroot I am able to see my lvm setup, what am I missing?

Last edited by FallingStar (2017-11-13 19:34:19)

#2 2017-11-12 16:47:34

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: [SOLVED] LVM on LUKS

Welcome to the forums FallingStar smile

Check your HOOKS. If you use the systemd hook you have to use the appropriate systemd encrypt and lvm hooks as well. They also need to be in the correct order.

Last edited by Slithery (2017-11-12 16:52:58)


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#3 2017-11-12 16:50:21

fsckd
Forum Fellow
Registered: 2009-06-15
Posts: 4,173

Re: [SOLVED] LVM on LUKS

There's quite a few things we need to know, but let's start with these:

Confirm if /boot is outside of the encrypted container.

Also is this an EFI or legacy BIOS systems?

If you can, share the output of `lsblk -f` and your fstab.

Also, what is the exact error you are seeing?


aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies

Offline

#4 2017-11-12 17:04:41

FallingStar
Guest

Re: [SOLVED] LVM on LUKS

slithery wrote:

Welcome to the forums FallingStar smile

Check your HOOKS. If you use the systemd hook you have to use the appropriate systemd encrypt and lvm hooks as well. They also need to be in the correct order.

Thanks slithery! smile

I just changed my hooks from what I had in my first post to the following

HOOKS=(base systemd autodetect modconf keyboard keymap block sd-encrypt sd-lvm2 filesystems fsck)

I found somewhere in the wiki the sd hooks are used for systemd systems. I'll have another look at the page, did come across it when I was
searching for some info about HOOKS.

Last edited by FallingStar (2017-11-12 17:07:50)

#5 2017-11-12 17:07:22

FallingStar
Guest

Re: [SOLVED] LVM on LUKS

fsckd wrote:

There's quite a few things we need to know, but let's start with these:

Confirm if /boot is outside of the encrypted container.

Also is this an EFI or legacy BIOS systems?

If you can, share the output of `lsblk -f` and your fstab.

Also, what is the exact error you are seeing?

1. /boot is outside of the encrypted container
2.  I'm using  legacy BIOS system
3  lsblkid -f provides:

NAME              FSTYPE LABEL UUID MOUNTPOINT
loop0                               
sda                                 
├─sda1                              /boot
└─sda2                              
  └─cryptolvm                       
    ├─system-root                   /
    ├─system-swap                   
    └─system-home                   /home

4. fstab:

# /dev/mapper/system-root
UUID=a6defcdb-72a1-4400-9393-754d8cf33236	/         	ext4      	rw,relatime,data=ordered	0 1

# /dev/sda1
UUID=f1e24942-cf4b-45b2-9503-a72d6e83471e	/boot     	ext4      	rw,relatime,stripe=4,data=ordered	0 2

# /dev/mapper/system-home
UUID=0b8d1a27-83d8-4247-a540-7d20d1a4a7df	/home     	ext4      	rw,relatime,data=ordered	0 2

# /dev/mapper/system-swap
UUID=cb321143-e6aa-4462-8207-0308cd65ba62	none      	swap      	defaults  	0 0

5. It tries to open root

start job is running for dev-mapper-system\x2droot.device

After the timer runs out it shows these errors:
Dependency failed for initrd Root Device
Dependency failed for /sysroot
Dependencey failed for initrd Root File System
Dependency failed for File System Check on /dev/mapper/system-root
Then jumps to emergency mode.

But seems to me that since it can't open root since it fails there. Normally I would expect a password request to unlock
the encrypted partition. I don't even get requested for a password to unlock my encrypted partition where / resides.

Last edited by FallingStar (2017-11-12 17:19:35)

#6 2017-11-12 17:22:50

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: [SOLVED] LVM on LUKS

Did you remember to rebuild your initramfs after making the changes to your HOOKS?


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#7 2017-11-12 17:31:48

FallingStar
Guest

Re: [SOLVED] LVM on LUKS

slithery wrote:

Did you remember to rebuild your initramfs after making the changes to your HOOKS?

Yes I did, I followed the installation guide
So I figured when adding/removing hooks I would need to run it each time: "mkinitcpio -p linux", and I saw the ones
I added come across the screen as it regenerates initramfs-linux.img .

Last edited by FallingStar (2017-11-12 17:38:43)

#8 2017-11-12 20:31:26

FallingStar
Guest

Re: [SOLVED] LVM on LUKS

slithery wrote:

Welcome to the forums FallingStar smile

Check your HOOKS. If you use the systemd hook you have to use the appropriate systemd encrypt and lvm hooks as well. They also need to be in the correct order.

I found another useful wiki page via that link of yours, what's described here  sounds like the problem I have.
So I'm going to play around with the plymouth hook to see if I can solve it using that hook.

#9 2017-11-12 23:15:46

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,198

Re: [SOLVED] LVM on LUKS

Have you tried with the standard hooks rather than the systemd ones? Although, if you're using plymouth, looking at that would obviously be the first thing to do, as you suggest.


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#10 2017-11-12 23:31:57

loqs
Member
Registered: 2014-03-06
Posts: 19,113

Re: [SOLVED] LVM on LUKS

You appear to be mixing the sd-encrypt hook with the parameter cryptdevice which is only used by the none systemd encrypt hook.  See System_configuration#Using_sd-encrypt_hook.

Offline

#11 2017-11-13 18:34:57

FallingStar
Guest

Re: [SOLVED] LVM on LUKS

loqs wrote:

You appear to be mixing the sd-encrypt hook with the parameter cryptdevice which is only used by the none systemd encrypt hook.  See System_configuration#Using_sd-encrypt_hook.

That was it,  didn't  realize that, thanks for pointing that out smile Got it working now.

Last edited by FallingStar (2017-11-13 18:40:26)

#12 2017-11-13 19:33:12

loqs
Member
Registered: 2014-03-06
Posts: 19,113

Re: [SOLVED] LVM on LUKS

If you are satisfied a solution has been found,  please mark your thread as solved by editing the first post and prepending the tag [SOLVED] to the title in the "Subject" field.

Offline

Board footer

Powered by FluxBB