Removed HDD-2 from NAS (while running) and plugged into a Sharkoon USB-Bay and tried to recover data.
Tried to assemble all existing volumes:
% sudo mdadm --assemble --scan
mdadm: /dev/md/9 has been started with 1 drive (out of 24).
mdadm: /dev/md/256 has been started with 1 drive (out of 2).
mdadm: /dev/md/13 has been started with 1 drive (out of 24).
% cat /proc/mdstat
Personalities : [raid1]
md13 : active (auto-read-only) raid1 sdb4[1]
458880 blocks super 1.0 [24/1] [_U______________________]
bitmap: 1/1 pages [4KB], 65536KB chunk
md256 : active (auto-read-only) raid1 sdb2[1]
530112 blocks super 1.0 [2/1] [_U]
bitmap: 0/1 pages [0KB], 65536KB chunk
md9 : active (auto-read-only) raid1 sdb1[1]
530048 blocks super 1.0 [24/1] [_U______________________]
bitmap: 1/1 pages [4KB], 65536KB chunk
/dev/sdb3
did not get detected. Started raid manually:
% sudo mdadm --verbose --assemble /dev/md1 /dev/sdb3
mdadm: looking for devices for /dev/md1
mdadm: /dev/sdb3 is identified as a member of /dev/md1, slot 1.
mdadm: no uptodate device for slot 0 of /dev/md1
mdadm: added /dev/sdb3 to /dev/md1 as 1
mdadm: /dev/md1 assembled from 1 drive - need all 2 to start it (use --run to insist).
% sudo mdadm --readonly --run /dev/md1
mdadm: started array /dev/md1
Activated volume group:
% sudo pvscan
% sudo vgchange -ay vg1
2 logical volume(s) in volume group "vg1" now active
Decrypt volume:
% perl -e 'print crypt("__PASSWORD__HERE__", "\$1\$YCCaQNAP\$")' > qnap.key
% sudo cryptsetup open /dev/vg1/lv1 test --key-file=qnap.key
See: https://www.kormoc.com/2014/06/10/unlock-qnap-encrypted-disk/ 1
Mount volume:
% sudo mount -o ro /dev/mapper/test /mnt/source/
Unmount and stop volumes:
% sudo mount -o ro /dev/mapper/test /mnt/source/
% sudo cryptsetup close test
% sudo vgchange -an vg1
% sudo mdadm --stop --scan
Re-Inserted HDD in QNAP and the rebuild process was started automatically.
Footnotes
-
Yes, URL does not exist anymore and was excluded from Wayback Machine! sigh! Any other options? ↩