I recently installed Debian Wheezy and let the installer guide partition the disk using a whole partition with encryption (LVM). Later on I've added four disks and setup RAID5 on them (using mdadm).

My question is: How do I add the RAID-set to the existing crypto-lvm, making the RAID encrypted as well?

  • LVM has internal RAID5 capabilities, you might try to research that avenue rather than mixing block device management schemes (not that there's anything wrong with that, just involves one extra thing in the configuration).
    – Bratchley
    May 2, 2013 at 11:36
  • Found this while working the old google machine: olearycomputers.com/ll/linux_mirrors.html . It's comparing mdadm raid to LVM raid.
    – Bratchley
    May 2, 2013 at 11:43

1 Answer 1


Assuming the RAID doesn't have any files on it yet;

you'd format it using LUKS for encryption:

cryptsetup luksFormat /dev/md42

then you'd open the LUKS container

crytpsetup luksOpen /dev/md42 luks42

if you want to use LVM with that, you'd turn it into a Physical Volume:

pvcreate /dev/mapper/luks42

and if you want to add that to your existing volume group

vgextend yourvg /dev/mapper/luks42

and then you can create some new LVs

lvcreate -L42G -n fourtytwo yourvg

and then you'd put some filesystem on that

mkfs.ext42 /dev/yourvg/fourtytwo

and then mount it

mkdir /mnt/42
mount /dev/yourvg/fourtytwo /mnt/42

and so on and so forth

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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