Alternative Firmware (Debian Jessie, Synology DSM6)

I mounted the drive in my debian environment and deleted rules.d* and all ipv6 from /etc/network/interfaces.
The drive now boots again, super!

PermitRootLogin was already set to yes, but I still can’t SSH as root.
I foresaw this happening so I made a custom user with sudo privileges before rebooting. :slight_smile:

Thank you, @Fox_exe!

Notes: https://fox-exe.ru/WDMyCloud/WDMyCloud-Gen2/Debian/Dev/_Update_Kernel_and_os_EN.txt

I am on your website http://fox-exe.ru/WDMyCloud/WDMyCloud-Mirror-Gen2/Debian/
Download the BIN file.
The use of the discovery must be set to raid mode, otherwise the system can not start, can not find / dev/md1.
I would like to ask, can we not use raid mode, let it start from /dev/sda1?
Thanks. @Fox_exe

@Fox_exe
I corrected your howto:
_HowTo_EN.txt

I’m also planning to write all infos of this forum into howtos. For example howto recover WDMyCloudEx2Ultra with a USB stick. Maybe you can host this files?!

@Q-Fireball, no problem.
Maybe i need host a Wiki page for all of this… But im too lazy for do that :stuck_out_tongue:

Maybe someone could help me. I have compiled some kernels, but every time I add CONFIG_CGROUP_FREEZER or CONFIG_POSIX_MQUEUE (I have not figured out what it is) the device does not want to boot. I do not have a serial connection, so I do not know what the problem is. So far the following works::

Generally Necessary:

  • cgroup hierarchy: properly mounted [/sys/fs/cgroup]
  • CONFIG_NAMESPACES: enabled
  • CONFIG_NET_NS: enabled
  • CONFIG_PID_NS: enabled
  • CONFIG_IPC_NS: enabled
  • CONFIG_UTS_NS: enabled
  • CONFIG_CGROUPS: enabled
  • CONFIG_CGROUP_CPUACCT: enabled
  • CONFIG_CGROUP_DEVICE: enabled
  • CONFIG_CGROUP_FREEZER: missing
  • CONFIG_CGROUP_SCHED: enabled
  • CONFIG_CPUSETS: enabled
  • CONFIG_MEMCG: enabled
  • CONFIG_KEYS: enabled
  • CONFIG_VETH: enabled (as module)
  • CONFIG_BRIDGE: enabled
  • CONFIG_BRIDGE_NETFILTER: enabled
  • CONFIG_NF_NAT_IPV4: enabled (as module)
  • CONFIG_IP_NF_FILTER: enabled (as module)
  • CONFIG_IP_NF_TARGET_MASQUERADE: enabled (as module)
  • CONFIG_NETFILTER_XT_MATCH_ADDRTYPE: enabled (as module)
  • CONFIG_NETFILTER_XT_MATCH_CONNTRACK: enabled (as module)
  • CONFIG_NETFILTER_XT_MATCH_IPVS: enabled (as module)
  • CONFIG_IP_NF_NAT: enabled (as module)
  • CONFIG_NF_NAT: enabled (as module)
  • CONFIG_NF_NAT_NEEDED: enabled
  • CONFIG_POSIX_MQUEUE: missing

Hello Fox! First of all, thank you for your drive and curiosity to create different OS options to install on these WD NAS. I have both the EX2 and EX2 Ultra. The stock WD OS ■■■■■ to be sure, so I am eager for a better, more viable option.

I am actually currently using Synology boxes, and very happy with the stability and robustness of the OS. So logically I would tend to gravitate to that as an option on these WD boxes, but my impression here is that it’s the least stable, most troublesome of the OS options being worked on here…and correct me if I am wrong, likely even once it’s installed, can’t just apply the stock updates when the OS presents them, right?

Full Debian install is cool, but overall, feeling it might be overkill…

So that brings me to the OMV, seems like it might be the current optimal choice, an official NAS OS (based on Debian Kernel), but more lightweight then the full Debian, or so I am thinking, great number of 3rd party plug-ins.

So my question here is, once OMV is installed, what are the current things NOT WORKING, still yet to be resolved?

Once the base OMV is installed, can it be successfully updated with little to no issues to future updates?

Thank You,
Greg

@gericb, All Armada-based devices (Gen2, both Mirror’s and few others) have official support in mainline kernel tree (Need only dts file for full hardware support - available on my website).

So, possible to upgrade kernel to latest version, that allows update OS too.
For now - Update from Jessie to Stretch or SID (Unstable/Next) works w/o any problems (Only my mistakle in configs - read warnings/notes in instruction).
Upgrade OMV possible too.

Also you can install Ajenti or Webmin as web-admin-panel. Or almost any other package, that supports ARM cpu (All what works on Raspberry PI can work on our device too).

@gericb

I think you do not have the right view of things yet. Everything is C or C ++ program code. Because Fox_exe is only one person, he can not program a kernel or a OS in lifetime. So he uses C code from others. And that is e.g. the DSM operating system that he has to adapt to this NAS device over and over again because Synology understandably does not do that.

But Linux or Unix OS has a big advantage over other operating systems because it is very modular and versatile. Everything depends on the kernel and communication with it. If a Linux kernel is running, you can actually run all programs or an entire operating system with GUI like Debian or other derivatives on the NAS.

That’s all good, as long as the desired program itself does not need special drivers or other programs. Everyone knows that when the music program is not running because the sound card drivers are missing. Or as with me, Docker does not want to run. Or if a Windows user is annoyed about a missing DLL (which are actually small programs / program snippets).

What I mean by that is that operating system is more than the kernel, these are the many other programs. So OVM is just a program that you can swap and just because Fox_exe uses and delivers Debian programs, there is not a whole bloated OS running GUI.

And currently, a program or part of a program in the DSM causes stability problems and Fox_exe has not yet been able to find and solve this problem. Therefore, Debian seems to be stable with OVM, but no one can assure you that a plugin may not make it all that unstable or that you can use your desired plugin at all.

Can somebody help? I followed the instructions to install clean Debian for mycloud mirror gen2 12tb (flashed wd-to-debian.bin), but there are several problems…

  1. if I execute the third mdadm command, I get the error "mdadm: devices too large for RAID level 1 , so for third command I excluded the parameter “–metadata=0.90”
  2. If I try “mkdir /mnt/root” it says “already exists”?
  3. I cannot mount /dev/md1 - it always says “mount: mounting /dev/md1 on /mnt/root failed: Invalid argument”.

Any help is really needed. Thanks.

Ok, executing “mkfs.ex4 /dev/md1” before the mount command, then everything works

@FoxFAN
I dont known if you solved your problem? But your NAS should have two 6TB drives. /dev/sda and dev/sdb so you have partition your drive with

parted /dev/sda …

AND

parted /dev/sdb …

exactly same if you want to use mdadm.

@Q-Fireball
Thank you for your answer! After I manually reformatted them with gparted and started the process again, everything went fine this time and is running very well!

Thanks again!

Just wanted to ask how it is possible to control the fan in debian?

Yes, with for example

/usr/sbin/mcu_ctl fan_set_50

Just replace 50 with 0, 100. I dont know if the values 25 and 75 are possible.

1 Like

mcu_ctl 2 0 80 0 0 - Where 80 - fan speed, 0…255.

After many days and reading through half of the internet I finally figured out how to put the HDD’s of MyCloud (Mirror) completely to sleep on Debian / OMV. Things I did:

  • activate in OMV under “Disks” for all your disks you want to sleep your prefered spindown time and activate Write Cache.
  • In OMV in Section “S.M.A.R.T.” → under general section set the switch to disable, set check interval to 86400 and Power Mode to Standby (even though if smart was disabled before!)
  • edit fstab: nano /etc/fstab and add following options to root and data partition: nodiratime,noatime,commit=60
  • move everything from cron.hourly to cron.daily:
    mv /etc/cron.hourly/* /etc/cron.daily/
  • increase dirty_writeback: nano /etc/rc.local and add following line at the end (before exit 0!): echo 6000 > /proc/sys/vm/dirty_writeback_centisecs

After doing this, install the plugin “Flashmemory” available in OMV-Extras in OMV (no need to comment out the swap partition, but feel free if you like to). After successful installation and a reboot, output of df -h should list various tmpfs mounts like:

folder2ram 249M 5.8M 243M 3% /var/log
folder2ram 249M 0 249M 0% /var/tmp
folder2ram 249M 516K 249M 1% /var/lib/openmediavault/rrd
folder2ram 249M 20K 249M 1% /var/spool
folder2ram 249M 12M 237M 5% /var/lib/rrdcached
folder2ram 249M 8.0K 249M 1% /var/lib/monit
folder2ram 249M 0 249M 0% /var/lib/php
folder2ram 249M 4.0K 249M 1% /var/lib/netatalk/CNID
folder2ram 249M 2.6M 247M 2% /var/cache/samba
tmpfs 50M 0 50M 0% /run/user/0

  • continue editing: change crontab : nano /etc/crontab. change the first two jobs to run once at time X (for example 4.00 a.m.) so that it looks like this

00 4 * * * root cd / && run-parts --report /etc/cron.hourly
00 4 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )

  • do the same for the following files:
    /etc/cron.d/anacron
    /etc/cron.d/php
  • systemd casually triggers some .timer-files, so we change them too. To see which timers are active: systemctl list-timers . For me there are 5 timers active, so we have to change the corresponding units. My active timers are :
    phpsessionclean.timer
    anacron.timer
    apt-daily-upgrade.timer
    systemd-tmpfiles-clean.timer
    apt-daily.timer
    So to modify those : cd /lib/systemd/system and nano phpsessionclean.timer: There under [Timer] remove the original line OnCalendar=..... with OnCalendar=*-*-* 04:00:00
  • Finally the HDD’s went to sleep by themself, but as soon as I activated Samba… they woke up again after 30 mins. With this script ff_changed I saw that the only file not covered by Folder2Ram was /var/lib/samba/private/msg.sock, a Directory used by samba. We can see those with: smbd -b | egrep "LOCKDIR|STATEDIR|CACHEDIR|PRIVATE_DIR"
  • So we need to move the STATEDIR and the PRIVATEDIR: mkdir /var/cache/samba/lib and copy everything from the old to the new dirs: cp -r /var/lib/samba/* /var/cache/samba/lib/.
  • Finally we have to tell smb to use this new location: If you are in OMV then access the webinterface and change to SMB/CIFS, at the bottom in the field “Extra Options” add:

private dir = /var/cache/samba/lib/private
state directory = /var/cache/samba/lib
usershare path = /var/cache/samba/lib/usershares

  • Above this field turn off the option “Local Master Browser”
  • In OMV web interface go to “Scheduled Jobs” and add a job for every night at 4 a.m. to run : folder2ram -syncall &>/dev/null. This syncs all those folders mounted as tmpfs to disk.
  • Last step: In OMV in “Time and Date” disable “Use NTP Servers”, then in terminal : update-rc.d ntp disable
    apt-get install ntpdate and back in OMV in “Scheduled Jobs” add a job for 4 a.m. to run /usr/sbin/ntpdate pool.ntp.org &>/dev/null
  • After a successful restart check again with df -h if the flashmemory plugin is running.
    After all steps done MyCloud with OMV finally sleeps for hours and doesn’t wake up after just one hour or less…(of course wakeup at 4.a.m. due to our scheduling, you can change this like you want).

(If you like to protocol the sleep behaviour of your device you can use the script I found at disk_spindown2.sh, what you have to do is listed in the file itself at the top (you have to add “a” for example for the variable diskvolumes_spindown, you can heavily modify it so that the leds are turned off if the hdds are asleep and so on… but this step isn’t necessary at all - just fine tuning)

Enjoy your MyCloud with OMV and sleeping HDDs… :slight_smile:

1 Like

Hello all! First of all thank you for your efforts @Fox_exe !
I got a WD My Cloud Gen 1. Installed Clean Jessie fine but when I try to upgrade to Stretch i think it boots but I can’t access it.
Anyone got a working guide on how to upgrade to stretch?

@bumbolicious, Try this:

# Remove old network controller records:
rm /etc/udev/rules.d/70-persistent-net.rules
# Remove all "ipv6" records (lines of code) from /etc/network/interfaces
sed '/ipv6/d' /etc/network/interfaces -i
sed '/inet6/d' /etc/network/interfaces -i

Then - upgrade kernel and OS.

@Fox_exe thank you for your response.
There was no /etc/udev/rules.d/70-persistent-net.rules before and after upgrading. I created one to see if I can get it to ping since Stretch has this “Predictable Network Interface Names”.

If I recall correctly there was no “ipv6/inet6” in /etc/network/interfaces although I’ll check it again.

Do I need to compile a kernel or something? Cause all I did was to install Jessie from your imgs and then - update, -upgrade, -dist-upgrade.

There was a prompt although can’t remember now that told me to replace something. I pressed Yes maybe that’s the problem