Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
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 '13 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 '13 at 11:43

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

share|improve this answer

Your Answer


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.