LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   LUKS on LVM (http://www.linuxquestions.org/questions/linux-newbie-8/luks-on-lvm-4175421462/)

musiqdefunk 08-10-2012 04:04 PM

LUKS on LVM
 
RHEL 6

I am trying to encrypt an LV with LUKS but everytime I boot it says superblock could not be read... I've tried many commands and it still does not work, it doesn't even ask for a password.

Code:

lvcreate -L500MB -n "lvname" "vgname"
shred -n1 -v "/dev/mapper/vgname_lvname"
cryptsetup luksFormat "/dev/mapper/vgname_lvname"
cryptsetup luksOpen "/dev/vgname/vgname_lvname" "name"
mkfs.ext4 "/dev/mapper/name"

vi /etc/fstab
/dev/mapper/name dir ext4 defaults 1 2

vi /etc/crypttab
dir /dev/mapper/name none

When I go into rescue mode however it does ask me for a password.

unSpawn 08-10-2012 07:50 PM

Quote:

Originally Posted by musiqdefunk (Post 4751146)
everytime I boot it says superblock could not be read... (..)
When I go into rescue mode however it does ask me for a password.

Right SELinux context on dir?
Anything in dmesg / syslog?

musiqdefunk 08-10-2012 11:16 PM

well i guess in /etc/crypttab it should be :

Code:

dir /dev/mapper/vgname_lvname none
instead of
Code:

dir /dev/mapper/name
that seemed to have work but I also did it at home on my vm... i'll try it again at work on monday

unSpawn 08-11-2012 06:07 AM

OK. BTW if you read the documentation carefully you'll find the RHEL 6 Security Guide uses /dev/VGname/LVname for crypttab but the RHEL 6 Installation Guide uses UUIDs...


All times are GMT -5. The time now is 07:33 AM.