Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
2 encrypted partitions 1 key
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
freaky
n00b
n00b


Joined: 05 Jan 2003
Posts: 22

PostPosted: Fri Jun 05, 2009 11:24 am    Post subject: 2 encrypted partitions 1 key Reply with quote

Hi,

I have 2 encrypted partitions /dev/sda6 and /dev/sda7. These are luks encrypted and basically are my /home and /mnt/data, the latter one I use for downloads, vm's and some other stuff and also to open it from windows with FreeOTFE and a ext2/ext3 driver for windows.

I'd like both partitions to mount at boot, by asking me for a password. However, I only want to enter 1 password, I don't mind they can both be decrypted by the same password, it's more for theft than anything else anyways. Have some confidential data I don't like anyone to see without my consent and the encryption is more than strong enough for that.

I'm on baselayout-2, so I have /etc/conf.d/dmcrypt, but can't seem to get it to run with just entering a key once. It does already randomly encrypt swap and that works fine, but randomly encrypting obviously isn't very desirable for my data as it will be destroyed on reboot.

Anyone know if it's possible? Otherwise I'll have to make a script myself or something. Also, I'd just like to enter a password, I don't use gpg. I suppose I could add a second key slot with a gpg key tho'.

TIA
Back to top
View user's profile Send private message
truc
Advocate
Advocate


Joined: 25 Jul 2005
Posts: 3199

PostPosted: Fri Jun 05, 2009 12:39 pm    Post subject: Reply with quote

If you don't mind having two identical keys for your partitions, then modify the initscript so that it asks you for the key, store the value in a variable (say $key), then:
Code:
for dev in dev1 dev2; do echo -n $key | cryptsetup luksOpen /dev/$dev --key-file - ; done


You can test this on the command line first
_________________
The End of the Internet!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum