Ok. Today I spent a great deal of time messing with iSCSI on the gen2. So far, I have gotten it to host a target successfully. (I have connected to the hosted target, created a file system, copied files.)
I have now figured out how to get Virtual Volume manager working (kinda? Needs more testing), as well, and I have added some improvements to the init script hijack to make things work more as you expect them to.
What you need:
-
you need some files from the MyCloud Mirror source package. Namely, some of the contents of the cramfs folder. The MyCloud Gen2 lacks certain administration programs needed for the web interface to function. (It calls iscsi_mgr.cgi, which wraps some console commands. Those commands are missing.)
-
You need Fox_Exeâs WD_Crack package. You will also need to edit it a bit once it is installed. Specifically, you will need to have certain files copied into the root filesystem by its init script, and you will need to change two lines of his define.js file so that your MyCloud reports itself as a MyCloud Mirror. That will turn on the Storage tab, and turn on iSCSI options.
Now, the juicy details.
- either extract the following files from the MyCloudMirror GPL sources yourself, or pull them from here:
https://drive.google.com/open?id=0B0EsuN03YHarMTJtY3RHTjF4d0U
[I have broken it up into subfolders, sorry if that is annoying.]
iscsiadm
iscsictl
iscsid
isnctl
prealloc
vvctl
-
sftp into your mycloud, and create a folder on /mnt/HD/HD_a2 called âextrasâ. Place additional subfolders inside, called âetcâ, âusrâ, âbinâ, and âsbinâ, then create additional subfolders under usr containing âbinâ and âsbinâ. These will contain whatever special goodies we want to get copied back into the ramdisk after a reboot, and are named appropriately.
-
copy the above files into the following folder we just made:
/mnt/HD/HD_a2/extras/usr/sbin -
locate Fox_exe 's WD_Crack package on your hard drive. It is located at /mnt/HD/HD_a2/Nas_Progs/WDCrack . Inside you will find the following files:
define.js
init.sh
In define.js, we need to make the MyCloud think it is a MyCloud Mirror. We do that by changing the top two lines, so that they read as follows:
var DEV_NAME = " [WD My Cloud EX1100 â˘]";
var MODEL_NAME = "BG2Y";
in init.sh, we want to hijack the init script to have it restore our binary payloads, which are needed to turn on iscsi. Change it so that it looks a bit like this:
#!/bin/sh
INSTALL_DIR=$1
ORIGINAL_FILE=/usr/local/model/web/pages/function/define.js
rm $ORIGINAL_FILE
ln -sf $INSTALL_DIR/define.js $ORIGINAL_FILE
ln -sf $INSTALL_DIR/web /var/www/WDCrack
## Begin binary copy hijack
cp -R /mnt/HD/HD_a2/extras/* /
## End binary copy hijack
## Initialize iSCSI stuff
iscsictl --init
## Initialize virtual volume manager stuff
vvctl --init
then reboot the mycloud.
When the mycloud comes back up, you will have access to the [storage] tab, and the iscsi section for creating targets will be active, and functional.
For the curious, the mycloud stores the target LUNs as image files, contained in /mnt/HD/HD_a2/.systemfile/iscsi_images .
It appears to be damned skippy fast too. I copied a 600mb disk image to a 1gb iscsi lun, at over 200mb sec from a windows host. (Configured with iscsi initiator)