You are not logged in.

#1 2014-10-11 03:02:40

cynicalpsycho
Member
Registered: 2009-12-22
Posts: 57

[Solved] LVM Ontop of LUKS using Grub

What am I trying to do?

Install Arch with full system encryption (sans boot and media partition) using LVM ontop of LUKS on an external hard drive (sdb)
using: http://suddenkernelpanic.blogspot.com/2 … style.html


What is my problem:

System boots grub and it appears there is some confusion on where to find root
Error: Device 'uuid=f7153c4b-e6ea-48a2-9ee1-bf38c037173d' not found. skipping fsck
Error: Unable to find root device 'uuid=f7153c4b-e6ea-48a2-9ee1-bf38c037173d'

Where I deviated from this tutorial

1. I used Grub Instead of Syslinux as the tutorial suggests (This seems to be the crux) and it's really hazy on the solution for Grub
2. My partition scheme consists of an extra FAT32 partition that is not involved in the encryption (seems irrelevant to the issue)


Issues on /etc/default/grub:

(I feel like this is where the issue is)

From what I've read I need to update a couple of places in this file specifically:

GRUB_CMDLINE_LINUX="root=/dev/mapper/lvmpool-root cryptdevice=/dev/sdb2:crypt ro"
and I'm supposed to uncomment:
GRUB_DISABLE_LINUX_UUID=true


Issues on /etc/mkinitcpio.conf

I'm supposed to add the hooks as follows
HOOKS="... encrypt lvm2 ... filesystems ..."


Here's my fstab entry for root

<filesystem>                                                                           <dir>         <type>      <dump>                              <pass>
#/dev/mapper/lvmpool-root                                                 
UUID=f7153c4b-e6ea-48a2-9ee1-bf38c037173d                    /               ext4      rw,relatime,data=ordered        0 1




Current Work-Around

I can still use the system because after it errors out, it drops me into a recovery shell, at which type I can simply do a:
cryptsetup luksOpen /dev/sdb2 crypt
enterpassword
Then exit recovery shell and it drops me back into a normal arch login prompt.

This wouldn't be so bad, if it weren't so time consuming... (Takes forever to error out on boot, like 20 seconds)

Other Resources I tried
I have also used:
https://wiki.archlinux.org/index.php/Beginners%27_guide
https://wiki.archlinux.org/index.php/Gr … encryption
https://wiki.archlinux.org/index.php/Dm … oot_loader
https://wiki.archlinux.org/index.php/Dm … VM_on_LUKS
Along with a couple of forum questions others posted here, but no luck there either.

Last edited by cynicalpsycho (2014-10-11 18:28:14)

Offline

#2 2014-10-11 03:50:56

bleach
Member
Registered: 2013-07-26
Posts: 264

Re: [Solved] LVM Ontop of LUKS using Grub

Have you tried cryptdevice=UUID=<u-u-i-d>:name root=/dev/mapper/lvmpool-root ro

Offline

#3 2014-10-11 03:56:25

cynicalpsycho
Member
Registered: 2009-12-22
Posts: 57

Re: [Solved] LVM Ontop of LUKS using Grub

bleach wrote:

Have you tried cryptdevice=UUID=<u-u-i-d>:name root=/dev/mapper/lvmpool-root ro

Do you just mean switching the order of the two?

Offline

#4 2014-10-11 04:01:54

bleach
Member
Registered: 2013-07-26
Posts: 264

Re: [Solved] LVM Ontop of LUKS using Grub

im not sure if the order matters but ya also you do update grub right you can also edit grub in /boot even though it says not to I have had to when opening the partition and did not want to chrooting. I am not using grub at the moment so I cannot test it just an idea. if you do not want to use uuid why not change the fstab as well.

Last edited by bleach (2014-10-11 04:04:44)

Offline

#5 2014-10-11 09:24:06

teateawhy
Member
From: GER
Registered: 2012-03-05
Posts: 1,138
Website

Re: [Solved] LVM Ontop of LUKS using Grub

cynicalpsycho wrote:

GRUB_CMDLINE_LINUX="root=/dev/mapper/lvmpool-root cryptdevice=/dev/sdb2:crypt ro"

This looks wrong to me. The name of the lvmpool should be the same for the root and cryptdevice arguments.
I think you should change this like so:

cryptdevice=/dev/sdb2:lvmpool root=/dev/mapper/lvmpool-root

Offline

#6 2014-10-11 09:25:12

teateawhy
Member
From: GER
Registered: 2012-03-05
Posts: 1,138
Website

Re: [Solved] LVM Ontop of LUKS using Grub

teateawhy wrote:
cynicalpsycho wrote:

GRUB_CMDLINE_LINUX="root=/dev/mapper/lvmpool-root cryptdevice=/dev/sdb2:crypt ro"

This looks wrong to me. The name of the lvmpool should be the same for the root and cryptdevice arguments.
I think you should change this like so:

cryptdevice=/dev/sdb2:lvmpool root=/dev/mapper/lvmpool-root

EDIT: Change grub.cfg directly, it is a lot easier than regenerating it in your case.

Offline

#7 2014-10-11 10:35:03

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

Re: [Solved] LVM Ontop of LUKS using Grub

that blogspot guide you linked to is simply dreadful

does cryptdevice= not support UUID as well? the /dev/sdb2 name could change at some point...

Offline

#8 2014-10-11 18:29:40

cynicalpsycho
Member
Registered: 2009-12-22
Posts: 57

Re: [Solved] LVM Ontop of LUKS using Grub

Solution

It seems the solution to my issue was two parts.

1. The entry in /etc/default/grub, for me should read:
GRUB_CMDLINE_LINUX="cryptdevice=/dev/sdb2:lvmpool root=/dev/mapper/lvmpool-root"

To break down each entry:
cryptdevice consists of the partition you applied the encryption too, in my case /dev/sdb2 and lvmpool (my volume group)

root is simply pointing to the location of my encrypted root lvmpool (which is located on sdb2)

2. After that entry is made (and this was a key mistake for me) you must run:
grub-mkconfig -o /boot/grub/grub.cfg

This will update your /boot/grub/grub.cfg with the information you added to /etc/default/grub.
After I did that, the system booted straight into the prompt to unlock the root partition.

Offline

#9 2014-11-25 18:12:46

dartfira
Member
Registered: 2010-08-23
Posts: 104

Re: [Solved] LVM Ontop of LUKS using Grub

Think I've made a mistake the problem is about grub nor the encryptiion.

Last edited by dartfira (2014-11-26 09:26:24)

Offline

Board footer

Powered by FluxBB