Fun with software RAID on Gen2

I decided to have some fun with software raid on the Gen2. By default, it does not seem to want to let you make new /dev/md* devices. There is a way around that by manually abusing the module properties in the /sys tree. EG, we can make a new /dev/md_1 device by doing:

echo md_1 > /sys/module/md_mod/parameters/new_array

After that, we can use mdadm like you would expect.

Why do this though? Well, the MyCloud DOES have a USB3 port, and hubs being connected are supported. There is a caveat though.

The first partition on USB devices always gets “busy” because of the automounter, even if it fails to mount it. :rage: We can fix that by putting a worthless 1k partition at the start of every drive we want to use as a raid container. Just bear in mind that unless you install fox_exe’s debian package, you do not have any partitioning tool native to the gen2, so partition your devices properly on another system first.

For my test, I did a rather worthless setup, that uses two partitions on the same device with raid 1. I did all the needful on one of my linux boxes, with a partition table a bit like this:

P1) 1kb linux partition
P2) 50% of volume (type FD)
P3) 50% of volume (type FD)

I then created a software raid on the linux machine out of them with mdadm, then created a partition table on the created raid device, and formatted it with EXT4

I then unmounted the raid array, stopped the raid array, and kicked out the usb device and attached it to the MyCloud.

Naturally, the automounter fails. It sees the partition 1 (1kb linux) and fails to mount it. (really, you dont say…) This leaves the actual raid partitions free though, because the automounter does not touch them. We can then assemble the array on the mycloud by adding an array by echoing to new_array, then assembling it with mdadm, then mount it.

Fox_exe’s wdcrack package is basically a startup script. (see init.sh) The necessary console-fu needed to mount USB software raid devices can be inserted into it, and then the array(s) can be mounted into the normally shared filesystem at mountpoints of your choosing at startup.

To me, this makes the consumer grade mycloud a little more useful, as data you feel needs to be protected can be hosted on such a raid array living on the USB port. Several cheap USB2.0 drives could be slapped on the USB3 port (with a USB3 hub), and if you do sensible raid configurations, can get reasonable speed out of them.

Sometime later: iSCSI on Gen2 :stuck_out_tongue_winking_eye:

1 Like

Hello,

Thank you for sharing this information.