LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-23-2013, 09:29 AM   #1
Nyyr
LQ Newbie
 
Registered: Nov 2012
Posts: 9

Rep: Reputation: Disabled
Question Resizable encrypted LVM requiring just one password on boot (encrypted volume group)?


Hello!

I wonder if following configuration for full disk encryption is possible
with some of the current distros:

Level 1:
2 physical disks (/dev/sda, /dev/sdb)

Level 2:
RAID1 /dev/md0 over /dev/sda1 and /dev/sdb1 as /boot
RAID1 /dev/md1 over /dev/sda2 and /dev/sdb2

Level 3:
Encrypted LVM volume group /dev/vg00 over "unencrypted" LVM physical disk /dev/md1

Level 4:
LVM logical volume /dev/vg00/lv00 as swap over encrypted volume group /dev/vg00
LVM logical volume /dev/vg00/lv01 as / over encrypted volume group /dev/vg00
LVM logical volume /dev/vg00/lv02 as /home over encrypted volume group /dev/vg00
...

I have found other common configuration on the web: LVM over encrypted /dev/mdX partitions - but this requires entering password for each encrypted /dev/mdX partition upon boot. While in my configuration above this would be just one, if I later decide to extend LVM volume group by adding another physical volume /dev/mdX (on additional physical disks), I would have to enter one more password upon boot, even if they would be the same.
 
Old 01-23-2013, 11:00 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
I'm wondering could this work if you first generate a key
Code:
dd if=/dev/urandom of=/path/keyfile bs=512 count=4
and then initialize the assembled md devices with the same key?
 
Old 01-23-2013, 11:37 AM   #3
Nyyr
LQ Newbie
 
Registered: Nov 2012
Posts: 9

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by unSpawn View Post
I'm wondering could this work if you first generate a key
Code:
dd if=/dev/urandom of=/path/keyfile bs=512 count=4
and then initialize the assembled md devices with the same key?
I am not sure if it is supported by distro init scripts. Iīd guess init scripts do not try password entered for previous encrypted volume on the next encrypted one.... If they would, I could use the more common configuration LVM on encrypted /dev/mdX.
 
Old 01-23-2013, 11:51 AM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
/etc/crypttab?:
Code:
boot /dev/md0 /path/keyfile luks
root /dev/md1 /path/keyfile luks
Else why not combine /dev/sd{ab}{1,2} into one md, LUKS the whole md and divide that into VGs?
 
1 members found this post helpful.
Old 01-23-2013, 11:57 AM   #5
Nyyr
LQ Newbie
 
Registered: Nov 2012
Posts: 9

Original Poster
Rep: Reputation: Disabled
I mean: Ideal startup script would work like this:

1) Found encrypted partition?
2) If yes, do I have the right encryption/decryption key set? If yes, mount/read the partition.
3) If not, do I have the right encryption/decryption key password set? If yes, read and decrypt key with the password, set a variable with the key value and then goto 2)
4) If not, read the password from user (terminal), set a variable with the password value and then goto 3)

But I doubt ANY startup script is that smart. Script writers donīt have any imagination. In my whole life, I might see max. 5 script written according to defensive programming rules.
The rest of scripts just hopes everything will be right a then screw it with the rest of the code :-)
 
Old 01-23-2013, 12:11 PM   #6
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by Nyyr View Post
But I doubt ANY startup script is that smart. Script writers donīt have any imagination.
Its OSS so BMG and do something (instead of talking) about it...
 
Old 01-23-2013, 12:13 PM   #7
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Moved: This thread is more suitable in the Software forum (not a security issue) and has been moved accordingly to help your thread/question get the exposure it deserves.
 
Old 01-24-2013, 04:30 AM   #8
Nyyr
LQ Newbie
 
Registered: Nov 2012
Posts: 9

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by unSpawn View Post
Its OSS so BMG and do something (instead of talking) about it...
Point taken.
 
Old 01-24-2013, 04:36 AM   #9
Nyyr
LQ Newbie
 
Registered: Nov 2012
Posts: 9

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by unSpawn View Post
/etc/crypttab?:
Code:
boot /dev/md0 /path/keyfile luks
root /dev/md1 /path/keyfile luks
Else why not combine /dev/sd{ab}{1,2} into one md, LUKS the whole md and divide that into VGs?
I think there would be issues with crypttab solution in case of hibernation. I guess this would not work with just one password input.

But maybe I could create nested RAID:

Layer:
1. /dev/md1 over /dev/sda2, /dev/sdb2 - RAID1 on lowest level
2. encrypted /dev/md2 over /dev/md1 - JBOD over RAID1 (initially with just one member)
3. LVM over /dev/md2

If I later decide to extend /dev/md2 with another physical disk, I can create /dev/md3 over /dev/sdc1 and /dev/sdd2 and then grow /dev/md2 by adding /dev/md3 to it(?).
I am just not sure if mdadm supports this.... (?)
 
Old 01-24-2013, 06:52 AM   #10
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by Nyyr View Post
I think there would be issues with crypttab solution in case of hibernation.
Yeah, what doesn't cause problems combined with hibernation? ;-p


Quote:
Originally Posted by Nyyr View Post
I guess this would not work with just one password input.
But maybe I could create nested RAID
(..) I am just not sure if mdadm supports this.... (?)
It's something you could test?
 
  


Reply

Tags
boot, encrypted, lvm, password, volume


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Encrypted, LVM volume /home not recognizing (global) passphrase and so not mounting saivnoba Fedora 3 10-30-2011 11:24 AM
Ubuntu 11.04 encrypted LVM password not working after user login password change prateekm21 Linux - Security 0 10-29-2011 02:20 PM
Recovering data from password encrypted volume akumarkind Linux - Enterprise 3 03-06-2010 02:35 AM
Recovering data from password encrypted volume akumarkind Linux - Software 1 03-04-2010 09:45 AM
Recovering data from password encrypted volume akumarkind LQ Suggestions & Feedback 1 03-04-2010 09:41 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:30 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration