Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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). –  Joel Davis 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. –  Joel Davis May 2 '13 at 11:43
add comment

1 Answer

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
add comment

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.