r/debian•
etrask

Encrypted Drive Mount on Startup?

Hello all, this may not be the place for this... sorry!

Anyway I have Squeeze installed on my server, I have it setup like this:

The hard drive has two physical partitions, one formatted as ext2 and mounted for /boot, and the other is a physical volume for encryption. Inside the encrypted partition, I used LVM to make two volumes, one for the swap and one for /.

This all installed fine, and when the system is booting up it asks for a password to be able to mount the encrypted partition. This is exactly what I want. However, I also have an external hard drive that I've encrypted using cryptsetup. I'd like the system to decrypt and mount this hard drive [single partition] at /ftp, at the same time it decrypts and mounts the main hard drive.

How could I go about this? I can manually mount the drive when I login as root:

cryptdisks_start /dev/sdb1 some_mapper_name

[enter password]

But I'd like this to happen at startup with the original password entry. Thanks for any help, guys!

Posted Apr 22, 2012, 9:02 PM UTC

52
[deleted]•

[deleted]

5
existentialhero•

If you want it to be decrypted automatically when you put in the password for your main partition, you can use decrypt_derived, as documented here. You can do this in one keyslot and have a normal passphrase in another, so you can still decrypt the drive the normal way if you ever need to.

3