LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
LinkBack Search this Thread
Old 04-12-2012, 05:41 PM   #1
ferdog
LQ Newbie
 
Registered: Jul 2003
Location: Pennsylvania
Distribution: Arch Linux
Posts: 10

Rep: Reputation: 0
LVM and LUKS Question


I want to make sure that I've correctly configured my system to install Linux on a fully encrypted disk (minus /boot). I'm using LVM on LUKS - both of which I've got very little experience with. Here's what I did:

First, I created two partitions.

Code:
/dev/sda1 (100mb. I'll use this for /boot)
/dev/sda2 (Rest of disk. This is the LVM Container)
I then encrypted /dev/sda2:

Code:
cryptsetup -c aes-xts-plain -y -s 512 luksFormat /dev/sda2
I opened the LUKS partition:

Code:
cryptsetup luksOpen /dev/sda2 container
So, now I have:

Code:
/dev/mapper/container
I setup my logical volumes:

Code:
pvcreate /dev/mapper/container
vgcreate VolGroup00 /dev/mapper/container
lvcreate -L 20G VolGroup00 -n root
lvcreate -C y -L 10G VolGroup00 -n swap
lvcreate -l +100%FREE VolGroup00 -n home
created filesystems:

Code:
mkfs.ext4 /dev/VolGroup00/root
mkswap /dev/VolGroup00/swap
mkfs.ext4 /dev/VolGroup00/home
and mounted them:
Code:
swapon /dev/VolGroup00/swap
mount /dev/VolGroup00/root /
mount /dev/VolGroup00/home /home
Does this look correct? Did I miss anything?
 
Old 04-12-2012, 06:53 PM   #2
roger_heslop
Member
 
Registered: Oct 2009
Location: Leander, TX
Distribution: CentOS
Posts: 81

Rep: Reputation: 31
It looks correct as far as I can tell, however when I set up a LUKS partition, I do it the opposite way. In other words I create the logical volume / use luksFormat to open that logical volume as a seperate device in /dev/mapper, and then format that with ext4 (or whatever).

The important difference is that creating a the encrypted volume on top of the logical volume allows me to initially set the pv properly to type 8e, though your method may allow more flexibility in resizing the volumes. (I've never tested your method though.) I've written a few blog entries on this topic (to include automounting LUKS) here:

http://thehomelab.blogspot.com/

Edit: Both methods should work, see discussion here:
https://bbs.archlinux.org/viewtopic.php?id=87897

Last edited by roger_heslop; 04-12-2012 at 07:00 PM.
 
1 members found this post helpful.
Old 04-13-2012, 01:31 PM   #3
ferdog
LQ Newbie
 
Registered: Jul 2003
Location: Pennsylvania
Distribution: Arch Linux
Posts: 10

Original Poster
Rep: Reputation: 0
Thanks for your advice and the links, Roger. Your blog is a helpful resource for someone new to LUKS such as myself.
 
  


Reply


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 On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] LUKS and LVM on two separate drives jjthomas Slackware - Installation 3 07-01-2010 10:39 AM
Luks/Lvm after dd duplication brodo Slackware 10 03-12-2009 03:56 PM
New kernel and existing Luks/Lvm ? brodo Slackware 3 09-14-2008 09:44 AM
Slackware 12.1, LUKS, LVM on external HD. How? randomsel Slackware - Installation 7 06-26-2008 06:35 PM
luks cryptsetup and lvm question ruzzed Linux - Software 3 09-16-2007 07:21 PM


All times are GMT -5. The time now is 04:23 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration