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

OK, did that and it worked.
At OS upgrade i had to choose a few times if i would like to use my old settings/scripts or new ones, i went for the default answer and used the old ones.

Sambaspeed almost doubled (from 45 to almost 80 for upload, download is ~105MB/s)
I can see my usb storage know, big THX

So far everything works, except one thing:
i can access the sambashares from libreelec/kodi and my androiddevices, but from ubuntu 16.04 it stopped working. I can’t figure out why, the only thing that changed is the upgrade on myclud.

on “sudo mount -a” i get:
mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)

i googled that, but couldn’t find anything helpfull to my situation

This is my old and still everywhere els except ubunt working line in fstab:
//192.168.178.77/media /mnt/media cifs credentials=/home/z/.smbcredentialsc,uid=1000,iocharset=utf8,sec=ntlm 0 0

my .smbcredentialsc :
username=myusername
password=mypassword

any idea?

I found the problem:
//192.168.178.77/media /mnt/media cifs credentials=/home/z/.smbcredentialsc,uid=1000,iocharset=utf8 ,sec=ntlm 0 0

,sec=ntlm ntlm seems to be an old security mode that is no longer supported after upgrade to stretch. I have to leave that out!

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:

3 Likes

Hello all! I need your help
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.
Is it possible to upgrade and if yes anyone got a guide on how to upgrade from Jessie to Stretch

with autoinstall.sh ? Can you ping the device? whats the LED color?

I successfully install Clean Jessie. Can SSH etc but when I do apt-get update, upgrade and dist-upgrade the OS upgrades. It tells me to reboot, I reboot and can no longer access it. LED is green, ethernet lights are on but it doesn’t get an IP. Probably it doesn’t even finish the booting sequence. Tried creating a 70-persistent-net.rules, assigned my interface to the MAC Address. Tried with no 70-persistent-net.rules file and always the same result. Can’t get an IP and access it after upgrading to Debian Stretch(9)

Hi, the kernel is too old to work with stretch, look in my old post, you will have answers about it.

So only Jessie? Some guys updated successfully to Stretch(4pda thread)

Give me the link where you read that?

There are a lot of different models, and my cloud GEN 1 can not go above jessie, not to my knowledge at least.

Watch the logs.

Care to show me how you got the logs?
I upgraded it. Runned Stretch 9.4 before I did a mistake and I’m back to the beginning but overall I installed OMV 4 but didn’t test it. Web GUI opened everything seemed to run fine at a first glance

On Jessie :

apt install rsyslog

Upgrade to Stretch

Disassemble the disk, plug it on a pc (with Gnu/Linux) and chroot on it with qemu:

http://anionix.ddns.net/WDMyCloud/WDMyCloud-Gen1/Developing/Howto%20-%20New%20kernel%20and%20system.txt

I have a EX4100, and looks to me that it’s not booting from TFTP or with the usb-recovery.
Anyone can hit me in the right direction to get Debian and OMV on it or DSM?

Would like to use it with Debian/OMV or DSM due a better interface then the WD gui…

Thanks.

I tried installing this on my new EX2 Ultra and followed this instruction txt: http://anionix.ddns.net/WDMyCloud/WDMyCloud-Ex2-Ultra/Debian-linux_4.14.4/_info_EN.txt

But after uploading the firmware .bin file and rebooting it doesn’t come back up again, it also got no new DHCP lease. What can I do?

Hello I have a problem with wd my cloud gen 2 and debian stretch + omv 4. I have also uptaded my kernel with the latest version 4.15.

After the installation and a sync && reboot command I cannot connect again to my cloud via ssh or ftp. I get econnrefused error. (ERR_CONNECTION_REFUSED)

How can I solve my problem ?

Thank you.

Hi, I seem to find a lot of info about installing OMV but not really for “MyCloud Home” (unless I missed it). Could someone point me to the correct OMV image to install as well as some instructions ?

Many thanks.

1 Like

@fjld61, sorry, “Home” series is not supported because have different hardware. (Realteck CPU insted of Marvell in previous models)

Please dont forget my cloud home dude

1 Like

hey :slight_smile:
today I installed jessie and upgraded the kernel, then upgraded to stretch. now I can’t login via ssh anymore. I think the ssh-config does not allow root to ssh. any idea what i can do?

other problem: mycloud isn’t booting from usb anymore (usbrecovery.tar.gz) after debian is installed

greetings

benjamin

edit: re-install successful, works great now

1 Like

What did you re-install successful? The usbrecovery? I did the same Mistake…
Edit: do i have to push the Reset Button?

Hi! Thanks a lot for your work, @Fox_exe, I love running OMV on my 2TB My Cloud Gen 2. Has anyone tried to overclock the MyCloud yet? Looking at the marvell datasheet, the frequency can be set via pull-up/pull-down resistors up to 1.5GHz. I know it wouldn’t make a huge difference, but I would love to try that, if anyone has any suggestions.