Post by L. Rose
I want to setup a couple of drives using RAID10 with mdadm. On top of
/dev/md0, I want to setup one large dmcrypt/LUKS encrypted ext4 volume.
As Arch wiki reads, this seems to be possible. But what about expanding
that volume later on? RAID#Format_the_RAID_Filesystem recommends
calculating the stripe_width value for ext4 based on the number of data
disks. When adding a new disk, the number of data disks would
increase by one, and expanding both the dmcrypt/LUKS and the ext4 layer
should be possible - but what about the stripe width_value? Does it need
to be updated? Should it be updated? Is it possible to update the
stripe_width value afterwards?
Encryption is a must for me, and having the space accessible in one big
chunk instead of individual disks would allow more efficient usage and
is therefore important for me. So it would be really nice to get some
information on this. Thanks in advance!
As far as I can tell, the stripe size doesn't have a noticeable impact
on performance. I'd go with a sensible starting stripe size and not fuss
over the stripe size after that. I don't know if you can modify stripe
size after the fact.
Adding onto RAID 10 should be pretty simple as long as you remember you
can only add drives in multiples of 2, since you're mirroring and
striping. Depending on how your RAID 10 is set up you can use mdadm to
add the drives or, if you're using something like Intel Rapid Storage
you could use your UEFI to expand the array with perhaps a little less
LUKS should handle the expansion just fine, though I'd recommend putting
LVM in the encrypted mapping so that you can more easily manage volumes
once the LUKS container is unlocked. This way you can have multiple
volumes under one key. LVM also readily expands and shrinks as you need,
which makes things less of a headache.
You could even do a RAID 10-like setup with LVM if I'm not mistaken. I'd
probably do it that way just to avoid the hassle of dealing with
differing RAID formats, plus mdadm isn't as friendly as LVM. I only use
RAID 10 myself because I wanted one big shared volume between Arch Linux
and Windows 10.