Search This Blog

Monday, December 22, 2014

How to mount RAID1 volume on Ubuntu

If you ever need to mount an encrypted partition from a RAID1 NAS on your Ubuntu system (like a laptop or a different server) here's a simple three steps instruction. Figure out what partition needs to be mounted (you can do it by running parted or similar to figure out what your target should be); for the sake of the example it will be /dev/sdd2. And now:

% sudo mdadm --assemble --run /dev/md0 /dev/sdd2
% sudo cryptsetup -v luksOpen /dev/md0 mapperpoint
% sudo mount /dev/mapper/mapperpoint /mnt/external/

If you need to check the state of the drive while connected via USB enclosure, run
% sudo smartctl -aH -d sat /dev/sdd
The only trick is to add -d sat disk type.

Or to simplify the whole thing, just run Disk Utility and click "Start RAID" button ;)