Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I installed a Debian 6 with the "use LVM and encrypt" option. Now I would like to add a second disk and also encrypt it.

This is what I did so far:

  1. pvcreate /dev/sdb
  2. vgextend [vgname] /dev/sdb
  3. lvcreate -n [lvname] -l 100%FREE [vgname]
  4. luksformat -t ext3 /dev/[vgname]/[lvname]
  5. updated fstab

Unfortunately trying to mount /dev/mapper/[vgname]-[lvname] produces the following error under dmesg:

VFS: Can't find ext3 filesystem on dev dm-3

What am I doing wrong?

Update 1:

pvscan

PV /dev/dm-0   VG reactorblock01   lvm2 [49.76 GiB / 0    free]
PV /dev/dm-3   VG reactorblock01   lvm2 [100.00 GiB / 0    free]
Total: 2 [149.75 GiB] / in use: 2 [149.75 GiB] / in no VG: 0 [0   ]

lvs

LV     VG             Attr   LSize   Origin Snap%  Move Log Copy%  Convert
backup reactorblock01 -wi-a- 100.00g
root   reactorblock01 -wi-ao  48.80g
swap_1 reactorblock01 -wi-ao 984.00m

ls -l /dev/mapper/

total 0
crw------- 1 root root 10, 59 Jul  7 23:34 control
lrwxrwxrwx 1 root root      7 Jul  8 01:52 reactorblock01-backup -> ../dm-4
lrwxrwxrwx 1 root root      7 Jul  7 23:34 reactorblock01-root -> ../dm-1
lrwxrwxrwx 1 root root      7 Jul  7 23:34 reactorblock01-swap_1 -> ../dm-2
lrwxrwxrwx 1 root root      7 Jul  7 23:34 sda5_crypt -> ../dm-0
lrwxrwxrwx 1 root root      7 Jul  8 01:44 sdb1_crypt -> ../dm-3

cat /etc/crypttab

sda5_crypt UUID=d09c908f-0f3b-4f3e-b86b-87ef817732db none luks

Update 2:

Easy as pie with this guide: https://wiki.archlinux.org/index.php/System_Encryption_with_LUKS and some manpages

share|improve this question
add comment

1 Answer 1

up vote 2 down vote accepted

The Debian installer sets up the 'Encrypted LVM' by

  • creating a partition on the physical drive,
  • using LUKS/DM-Crypt to encrypt the physical partition,
  • unlock the DM-crypt volume, and
  • building a LVM volume group ontop of the DM-Crypt volume.

In the procedure you followed you basically attempted to follow the steps backwards. You put LVM ontop of the physical disk, and tried to create a DM-Crypt volume on a logical volume.

If you had wanted to do it the Debian way, you should have setup DM-Crypt on the new disk, then added the encrypted device's unlocked version to the volume group. Once that was done you could create logical volumes as described in the standard LVM docs.

Are you still able to mount your other filesystems? What I think you probably need to do is revert everything you have tried so far, and then set it up with LVM on top of DM-Crypt. So remove any new logcal volumes you created, shrink the volume group, and remove the PV you added.

share|improve this answer
    
I reverted everything and did this: created a partition, luksformat -t ext3 /dev/sdb1, cryptsetup create sdb1_crypt /ded/sdb1, pvcreate /dev/mapper/sdb1_crypt, vgextend xxx /dev/dm-3, lvcreate -n backup -l 100%FREE xxx /dev/dm-3 and now I'm trying to mount /dev/mapper/xxx-backup and fail again :/ –  Tie-fighter Jul 8 '11 at 0:00
    
D-I must be able to do it either way, because my Debian 6 systems use LVM then luks. @Tie-fighter get the system back to "normal" then update your question with outputs of pvscan and ls -l /dev/mapper/ and the contents of /etc/crypttab for good measure. Need to figure out which order these things are being used in. –  DerfK Jul 8 '11 at 0:50
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.