0

I have two encrypted drives (one SSD for booting and a hard drive for storage) I need both to be unlocked and mounted before all of the runlevel programs/services. Else some of my services would freak out when they can't find my storage drive.

Currently, when I boot from my fully encrypted drive I get the following:

A password is required to access the root volume:
Enter passphrase for /dev/sda1

What I'd like to happen is:

A password is required to access the root volume:
Enter passphrase for /dev/sda1
Enter passphrase for /dev/sdb1

So I type in the key of /dev/sda1, then the key for /dev/sdb1 and then /dev/sdb1 is mounted. After this the system continues to boot.

1

jasonwryan's solution would work for most users so if anyone is reading this who uses Arch Linux with systemd (vanilla Arch Linux) then do that.

However, in my case I use OpenRC. I followed this Gentoo wiki guide though I wasn't quite sure what the "target=" line meant.

To manually unlock my device I run "cryptsetup luksOpen /dev/sdb1 lvm" since it has an LVM partition and according to IRC the formatting for the luksOpen command is "cryptsetup luksOpen $source $target".

So I stole Gentoo's dmcrypt OpenRC init script and pasted it in /etc/init.d/dmcrypt. Then I stole the default config file and pasted it in /etc/conf.d/dmcrypt. I then added the following to the bottom of the config file:

target=lvm
source=UUID="insertUUIDhere"

Then I added dmcrypt to the default runlevel with "rc-update add dmcrypt default".

The device now prompts to be decrypted on boot :).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.