Clean OS (Debian), OpenMediaVault and other "firmwares"


I finally get iscsitarget to work.
You have to crosscompile the kernel module. I used the mc2kernel archiv and downloaded the iscsitarget trunk from svn

svn checkout svn:// iscsitarget-code

Now the mc2kernel directory looks like

Within the iscsitarget directory you compile the kernel via

make CROSS_COMPILE=/home/florian/DevWDMyCloud/framework/mc2kernel/toolchain/bin/arm-marvell-linux-gnueabi- ARCH=arm KSRC=/home/florian/DevWDMyCloud/framework/mc2kernel/ kernel
Important: Use the absolute path!

This process will create the ./iscsitarget-root/kernel/iscsi_trgt.ko

Copy this kernel module to your WDMyCloud. In my case the destination is
/lib/modules/3.10.70+/kernel/iscsi and do chmod 644

After that you must install userland tools (ietd, ietadm). The easiest way is to install iscsitarget.
apt-get install iscsitarget

Via insmod command, i loaded the iscsi_trgt.ko into kernel
insmod /lib/modules/3.10.70+/kernel/iscsi/iscsi_trgt.ko

Now you can try to restart the iscsitarget service

To get openmediavault-iscsitarget installed, you must use force. I did it this way

apt-get download openmediavault-iscsitarget
dpkg --ignore-depends=linux-headers-armhf -i openmediavault-iscsitarget_3.1.6_all.deb

That’s all. My iSCSI Target is now running.

Next step is to provide a single partition as an iscsi target.


Good work!
it worked well with me but i run up with 502 Bad Gateway error (nginx) when i restart my cloud, but i can visit my files through smb in windows and ssh.

I did clear cache but that didn’t work. so could you please help me figure out what’s the problem?


Hi Fox_exe,

many thanks for your work on giving the mycloud a useful system instead of the outdated and insecure firmware.
But how to install clean debian on EX4100? Is it possible? I found files on your google drive but no explanation.
I cant find “Autoinstall” folder and “Recovery” folder mentioned in the first post on google drive.
And is it possible to have the debian running from an usb pen drive without touching the firmware?


to bad this could not be combined into a simple .deb update file.

personally with all the failures with wd updates i am thinking about doing this. i just wish a better step by step english guide existed my linux skills are nowhere near up to snuff


All is possible, but hard for me alone (Need many time for teach/research/develop thins)…


all is understood. just to risky for myself to undertake.
my windows environment did not like the latest official firmware downgrade to the first v4 and got better speeds again…
could you perhaps clean up your english instal instructions for a total linux starter.


Hello Fox_exe and lordmage,

i found this thread,34103 where there are people preparing the EX4100 for debian boot.
Maybe a good place to join forces and not have to do all on your own.


alas i’m sitting on a gen 1 x4 firmware mycloud. that i can ssh into and work with just would prefer a better guide to install and use alternatives with it., but since they are provided for free i am not rushing anyone in doing so… i sit behind a double nat using the my cloud as a back-up rather than as a cloud devices


Hi. Maybe you will skip the last step with openmediavault-iscsitarget.deb. I got also trouble with this package. so i removed it finally. furthermore the openmediavault iscsi webplugin isn’t able to map partitions. so i must use the config files.
good luck



Very good performance with samba debian Jessie-4K in reading, less good in writing, but not really important to me, just to dismount the disk to copy.

Read :

Write :

Just :
apt-get install samba
cd /etc/samba/
mv smb.conf smb.conf.back
nano smb.conf
follow :
cd /data
mkdir Data Public
chmod 777 /data/Public
service smbd restart

And recover any place of the root file system (3.8GB) :

add raspberry repository :
nano /etc/apt/sources.list
deb jessie main contrib non-free rpi

Goodbye 64k, welcome 4k, Thanks @Fox_exe


If you could detail the procedure in one post, I would be really interested in your method. Thank you in advance.

Edit: To set the samba cache in tmpfs (/var/run) :

service nmbd stop
service smbd stop

mv /var/cache/samba /var/cache/samba.bak
mkdir /var/run/samba-cache
ln -s /var/run/samba-cache /var/cache/samba

The tip to add in /etc/init/smbd.conf install -o root -g root -m 755 -d /var/run/samba-cache does not work on reboot, so a @reboot to recreate the samba-cache folder.

crontab -e
and add
@reboot mkdir /var/run/samba-cache

service nmbd start
service smbd start

rm -rf /var/cache/samba.bak (If everything works)

I go to hdparm now see what it will give.

Thx @jpflouret

Edit1 :

On Linux, the traditional way to control disk standby (and power management) is to use hdparm; however, hdparm will not work with WD Red drives, because the firmware of the disks doesn’t support that. Instead, we can use the third-party hd-idle utility to accomplish this.

I tested hdparm with an old laptop drive, works perfectly. But if you want to do it with a WD RED, read the article.


#WDMycloud GEN1 Debian Jessie-4K : Preserve your hard drive

#1.Edit :
/etc/fstab, add mount options to /dev/sda4 (Data partition) and
/dev/md0 (root):noatime,nodiratime,commit=60
#2.Install log2ram :
git clone
cd log2ram
chmod +x
#3.Disable unusual cron jobs:
crontab -e
Move fake-hwclock to “daily” folder:
mv /etc/cron.hourly/fake-hwclock /etc/cron.daily
#4.Set the samba cache in tmpfs (/var/run) :
service nmbd stop
service smbd stop
mv /var/cache/samba /var/cache/samba.bak
mkdir /var/run/samba-cache
ln -s /var/run/samba-cache /var/cache/samba
crontab -e
and add the line :
@reboot mkdir /var/run/samba-cache
service nmbd start
service smbd start
rm -rf /var/cache/samba.bak (If everything works)
#5. Install hd-idle (Spin Down and Manage Hard Drive Power)
apt-get install build-essential fakeroot debhelper -y
tar -xvf hd-idle-1.05.tgz && cd hd-idle
dpkg-buildpackage -rfakeroot
dpkg -i …/hd-idle_*.deb
cd …
dpkg -i hd-idle_1.05_armhf.deb
Open the hd-idle configuration file to enable the service to automatically start and spin down drives :
nano /etc/default/hd-idle
Change this line to enable hd-idle :
Adjust this line to enable sleeping on the drive every 10 minutes (60 seconds * 10) :
HD_IDLE_OPTS="-i 0 -a sda -i 600"


#Bonus : Fix your WD Red drives (valid for all old WdRed hdd)
I did the manipulation yesterday under a Windows PC, no problem to report. Obligation to open the WDMycloud case to remove the disc.
Any command lines depending on your operating system are in the article :



I wanted to know if you had intentionally left this command “debug initcall_debug” and that it serves to keep it in the configuration of the bootconfig in /dev/sda7 ?

The default system cmdline includes some debug clauses in the cmdline: debug initcall_debug. This cause systemd and kernel to throw lots of unneeded messages. The only way to fix it is writing a new configuration partition. This is how I did it.

I followed the instructions and install the new bootconfig , temp on boot up is impressive.
To see if it does not pose a problem later.

For those who want to test, the file is already ready :

dd if=/dev/zero of=/dev/sd7
dd if=new-config.img of=/dev/sd


Please can show me which file I need to down load for my mycloud version 2 and how do I install it to replace the useless WD software
thank you


All is here for GEN2 :


Thank you, there is a load of folders there which one is the correct one?


Do you want exactly, dsm, debian, just some software?
You have the choice.


Tony to be honest I dont know, what I want if possible is to replace the supplied software.which I find to be very poor.
I am a photographer and bought the NAS drive to store images on and to be able to send clients a link to folder with their images. As these images are often 40+ mp each to use drop box is expensive and takes hours to upload to.
I find the supplied sharing software is very unfriendly to the receiver with no obvious instructions supplied and a tiny download arrow in the top right corner .
if I can get other software that is more user friendly I will be very happy.


See my reply on your thread; using a MyCloud to share images will multiply your broadband use many times over, as each user will require the images to be uploaded from your MyCloud, via your broadband link.


Indeed. Professional hosting is the way to go. MyClouds are really best used as ordinary NAS boxes.