*** EDITED *** to correct a couple of glaring errors - thanks @raisOr for providing feedback!! ***
@doron
I managed to setup an encrypted installation (root and swap encrypted) using the wiki article.
I would be very much interested in setting up an encrypted RAID6 now, can you please post the steps (cmds) to be taken here ?
Sure. Basically, what you need to do is create the RAID array structure you want, and then, before creating a filesystem on it, do the LUKS. Then you go on building a filesystem over the dm-crypt layer. OMV is smart enough to detect it, so that all the higher level tools (File Systems, Shared Folders etc.) will be automagically available.
Special care should be given to the location of the key. The crypto setup happens rather early in the boot sequence; your key needs to be available at that time. Either you type it in (boot sequence stops and prompts you on the primary console, you need it to be available to you), or, if you use a key file, it needs to be available. If it is on the (encrypted?) root fs, that should work (root fs is expected to be mounted at that time, obviously).
Okay, buckle up (this is essentially similar to what's described in "Step 3" of the wiki article
1. Create the RAID structure you want. Simplest is to use the GUI. Raid Management --> Create, like you always do, but you can use md if you prefer. Note the name of the device created - /dev/mdxxx . Wait for the RAID array to become fully initialized.
2. Get a root level command prompt. Build an encrypted block device on top of the array. If you plan to type the key (passphrase) during boot, just do:
cryptsetup -c aes-xts-plain64 -s 512 -h sha512 -y luksFormat /dev/mdxxx
Alternatively, if you plan to use a key file, first create the key file (can do via e.g. dd if=/dev/urandom of=/path/to/keyfile bs=1024 count=4) and place it where early init process can find it(!). Then, do:
cryptsetup -c aes-xts-plain64 -s 512 -h sha512 -y luksFormat /dev/mdxxx /path/to/keyfile
3. Open the encrypted block device, like so (the name "myraid6" is an example, use your own):
cryptsetup luksOpen /dev/mdxxx myraid6
or, if you used a keyfile, use this syntax:
cryptsetup luksOpen -d /path/to/keyfile /dev/mdxxx myraid6
This step creates a new block device, /dev/mapper/myraid6 . We will now use this device for upper-layer actions.
4. Now we need to create a file system. We can simply do e.g.:
mkfs.ext4 -m 0 /dev/mapper/myraid6
Or, we can go back to the OMV GUI, go to File Systems, and select "Create", making sure we are building the file system on /dev/mapper/myraid6 (and not on /dev/mdxxx).
5. Last thing we need to do is add a line to /etc/crypttab, so that the device is opened upon boot. Best is to use the device's UUID (which remains constant in the face of hardware or OS version changes). Find out the UUID by:
blkid | grep /dev/mdxxx
and copy the UUID into a line you add into /etc/crypttab which, if you want to be prompted for a password, will look something like this:
myraid6 UUID=b90f8cce-a777-4915-a871-3cbc4f87c34a none luks
or if you used a key file, like this:
myraid6 UUID=b90f8cce-a777-4915-a871-3cbc4f87c34a /path/to/keyfile luks
That's all there's to it. Now you should be able to use your new filesystem from the GUI, create shared folders, share over NFS/CIFS/AFS or whatever you want to do with OMV.
I hope I haven't missed anything, please report success or failure...