How to set up an encrypted RAID1?

Should I encrypt my two drives first and then set up the RAID1 or the other way around?
For now I encrypted my to drives using LUKS and created a RAID using mdadm and the two /dev/mapper/LUKS-xyz, which is syncing right now. Was that correct?

From my reading on the topic - you create the partitions - then create raid - then format the raid.

In the described case - I don’t know - the question is not that clear - and frankly I have not tried setting up luks on a raid.

I seems you are asking about two options

  • to create LUKS containers on each partition - then create MD raid
  • create the MD/RAID then create the LUKS container

From my recently acquired experience - within MD/RAID - I would probably have selected the second option - as creating the LUKS container is done before formatting the container - but it may work equally well - I really don’t know the difference here - logic would lead me to option number two.

I have been investigating the possibilities while migrating mirror to another system using MD/RAID10,far2 for the actual repository copy.

Thanks for your answer, I tried to finish it, as I’ve started. While following the Arch wiki I had some difficulties, like getting no output assembling the array or calculating the stride and stripe width. But I then simple formatted the array and mounted it and it seems to be accessible. Since I’m not going to install the OS on the array I might be okay and try some benchmarks to evaluate, if it works nevertheless.

How did it go? :slight_smile:

I eventually abandoned the project and moved away from Manjaro, but in general it worked fine to encrypt two disks and install RAID on them. Do you have further questions about this?