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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
01-23-2013, 09:29 AM
|
#1
|
LQ Newbie
Registered: Nov 2012
Posts: 9
Rep:
|
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.
|
|
|
01-23-2013, 11:00 AM
|
#2
|
Moderator
Registered: May 2001
Posts: 29,415
|
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?
|
|
|
01-23-2013, 11:37 AM
|
#3
|
LQ Newbie
Registered: Nov 2012
Posts: 9
Original Poster
Rep:
|
Quote:
Originally Posted by unSpawn
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.
|
|
|
01-23-2013, 11:51 AM
|
#4
|
Moderator
Registered: May 2001
Posts: 29,415
|
/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.
|
01-23-2013, 11:57 AM
|
#5
|
LQ Newbie
Registered: Nov 2012
Posts: 9
Original Poster
Rep:
|
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 :-)
|
|
|
01-23-2013, 12:11 PM
|
#6
|
Moderator
Registered: May 2001
Posts: 29,415
|
Quote:
Originally Posted by Nyyr
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...
|
|
|
01-23-2013, 12:13 PM
|
#7
|
Moderator
Registered: May 2001
Posts: 29,415
|
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.
|
|
|
01-24-2013, 04:30 AM
|
#8
|
LQ Newbie
Registered: Nov 2012
Posts: 9
Original Poster
Rep:
|
Quote:
Originally Posted by unSpawn
Its OSS so BMG and do something (instead of talking) about it...
|
Point taken.
|
|
|
01-24-2013, 04:36 AM
|
#9
|
LQ Newbie
Registered: Nov 2012
Posts: 9
Original Poster
Rep:
|
Quote:
Originally Posted by unSpawn
/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.... (?)
|
|
|
01-24-2013, 06:52 AM
|
#10
|
Moderator
Registered: May 2001
Posts: 29,415
|
Quote:
Originally Posted by Nyyr
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
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?
|
|
|
All times are GMT -5. The time now is 08:30 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|