I want it to be reliable and secure so it will have two HDDs in RAID 1 (AKA mirroring) and their content will be encrypted.
But what if in the future I will want to upgrade the drives with larger ones? A common scenario with RAID 1 is to replace one of the disks with the bigger one, rebuild the mirror then replace the other one and rebuild it again. In theory it sounds like an easy process that will keep all your data intact.
In practice however it’s not, Mike explains how to do it under FreeNAS in his blog. Growing mirrored and encrypted drives is a bit more complicated.
Here is how, in case you might need it:
- After replacing the HDD, boot your box and log into the FreeNAS web interface
- Go to Disks/Management, edit the disk you have replaced and click “Save”. This will read the new disk’s size.
- Go to Disks/RAID, the status will be DEGRADED which is normal. In Tools select the new disk, “forget” and then “insert” it. Wait until the rebuild process is finished.
- Go to Disks/Encryption, attach the disk and make sure your data is fine.
- Go to Disks/Mount Point and delete the mount.
- Get to the NAS console, either directly or via SSH. Things will get more interesting now:
geli is the command line tool to manage encrypted storage in FreeNAS. raid1 is the volume name I used, yours might be different. The first line saves the encrypted volume’s metadata to a file called “bak”, we will need it later.
- Go to Disks/RAID again, delete and re-add the RAID. Use the same volume name and tick the “Create and initialize RAID” check box.
- Now back to the terminal:
This will restore the metadata from our backup and re-attach the encrypted volume
- Fix the partition table, re-create and grow the partition to fill the entire disk:
Note that the device name ends with “.eli” – it’s our encrypted disk.
- Finally go to Disks/Mount Point and mount the partition.
That’s it, your encrypted partition should be functional now!
NOTE: always do your backups, I can make no guarantees that it will work for you.
under cc license