LVM needed for encrypted, expandable RAID?

1

I am currently building a RAID-5 with three 2TB HDDs on Debian. I am wondering how I could configure my RAID to be encrypted and expandable in the future. I do not need nor want partitions, but must I use LVM to be able to resize the filesystem? Or do I need it (LVM) for the encryption? If so, between which layers?

Disks > RAID > (LVM?) > Encryption > (LVM?) > Filesystem (JFS)

Also, for the encryption, I was wondering if I should use dm-crypt, dm-crypt with LUKS, or loop-AES. Do you have suggestions?

Thanks for your time,

William

William

Posted 2012-08-11T01:57:09.707

Reputation: 13

Answers

1

RAID 5? Do you hate your data that much?

OK, now that I've gotten that out of the way...

The RAID array will appear to the OS as a single disk, and that's how you'll treat it.

By default, pretty much everybody layers it this way, and the OS installer will too if you set it up during installation:

Filesystem
LVM volume(s)
Encryption
Disk

As for what to use, dm-crypt/LUKS is also what the proverbial everyone uses; it's bog standard. Loop-AES is much less common since it runs in user space.

Using these choices also guarantees that the OS will properly prompt you for the passphrase at startup. (If you have an existing system, you may need to rerun dracut after setting up the disk...)

Michael Hampton

Posted 2012-08-11T01:57:09.707

Reputation: 11 744

So then I'll put LVM after the encryption. I was asking that since the OS is already installed, so I must setup the RAID manually. Now I just need to choose whether I use LUKS or not with dm-crypt. Thanks for the heads up about data corruption, I just ordered another drive to transform it into RAID-6. – William – 2012-08-11T03:03:17.543

All the existing init scripts, initial ramdisk, etc., will be expecting LUKS, so if you want a less painful boot process, best to use it. :) – Michael Hampton – 2012-08-11T03:07:19.503

1Ok. Thanks a lot for your help. You answered in minutes questions that puzzled me for weeks! – William – 2012-08-11T03:18:51.103

If you use 4 drives(with the new disk added) in RAID 6 then your available disk space will equal that of RAID 10. And the latter will be faster. (R6 will allow up to 2 drive failures though. With R10 it depends on which disks fail). - And neither is a replacement for backups. (think theft, fire, PSU failure etc) – Hennes – 2012-08-11T06:13:56.947