Hmm… Maybe… That is more dangerous than I am willing to try at this point. I DO have some data in my MyCloud that I kinda want to keep, and so dont want to reformat the internal drive to do crazy wild testing.
What I HAVE tested, is creating a mirrored array using an iSCSI target, and a USB disk, then having it get mounted at an empty share. THAT works!
EDIT:
The automated umount seems to be working as planned. There is just one little snag. Once the new /dev/md* is populated by mdadm, the unit does not scan for partitions on it. I am grabbing sources for utils-linux, which contains partx. partx can be used to scan the device for partitions. I will build a static binary and add it to this package.
EDIT AGAIN:
Static partx has been added to the package. Tested, working. Successfully detects the partitions on our md_1 device
Another thing that might be neat to do, is mount the iscsi target’s container as read only on the remote location, using the loopback device. Why? So you can see the files that have been mirrored of course. Why read only? Because we aren’t stupid that’s why.
The system hosting the target does not need any raid set up on it. It is a poor man’s DR site. DR Sites are supposed to be read only, except to the system that is backing up to it. Since this is raid 1 (mirror), and it contains an ext4 file system with a partition and everything, we an likely mount that partition in that image as read only, and get access to the files inside, while it is still being used as a target lun. I am sure you can think of any number of impressive uses for being able to access the files, even if it is read only.
I will test that idea out now.