WD My Cloud randomly wakes up the drive when Drive Sleep is enabled

None of the scripts checks to see if the process is running. They just execute the script. Which is why you see the stopping message.

RAC

PS I prefer to use S98user-start to stop the scripts. This way if WD support wants to look into your system all you have to do is change the user-start script in /CacheVolume back to the original file.

Everything related to linux is scary :slight_smile:

Thanks again for help, it seems that those services are really stopped now:

WDMyCloud:~# /etc/init.d/nfs-kernel-server status; /etc/init.d/nfs-common status; /etc/init.d/upnp_nas status; /etc/init.d/mDNSResponder status; /etc/init.d/wdphotodbmergerd status; /etc/init.d/wdnotifierd status; /etc/init.d/wdmcserverd status; /etc/init.d/restsdk-serverd status
nfsd not running
all daemons running
[FAIL] upnp nas device is not running. … failed!
[FAIL] mDNSResponder is not running. … failed!
[FAIL] wdphotodbmerger is not running. … failed!
[FAIL] wdnotifier is not running. … failed!
[FAIL] wdmcserver is not running. … failed!
restsdk-server is not running

except the “all daemons running” (/etc/init.d/nfs-common status), but I’ll skip it for now.

If I understood correctly, if stopping those services help me with the drive sleeping problem, I can add all those stop commands to file: “/CacheVolume/user-start” (/etc/rc2.d/S98user-start)? Or it’s not very safe?
EDIT: Thanks, I think RAC confirmed it in his previous post.

Give us a feedback about the sleep times. Does it look better now? I have the same problem but my started when i changed my router and none of the sollutions helped in my case. I’m affraid that my new router is somehow generating network pings and wakes wdmycloud. I decided to let mycloud work all the time instead switching on and off every 15 minutes.

Ping does not wake up my MC.

RAC

Hi. There is some progress after stopping services recommended by Ralphael:
02 26 23:44:18 23:50:40 372 0:06:12
02 27 02:20:54 02:21:12 8 0:00:08
02 27 03:15:15 03:15:33 8 0:00:08
02 27 03:40:00 04:17:10 2220 0:37:00
02 27 04:27:21 07:03:15 9344 2:35:44
02 27 07:13:26 07:15:16 100 0:01:40
02 27 07:27:30 07:27:49 9 0:00:09
02 27 07:51:13 07:51:31 18 0:00:18
02 27 08:01:42 08:02:24 42 0:00:42
02 27 08:12:35 08:13:33 58 0:00:58
02 27 08:34:56 08:35:14 18 0:00:18
02 27 08:45:25 09:17:09 1904 0:31:44
02 27 09:27:20 15:02:41 20121 5:35:21
02 27 15:27:12 16:01:10 2038 0:33:58
02 27 16:11:21 16:21:54 633 0:10:33

At 07:03:15 the drive woke up for “no reason”, but I think I found the problem in the daemon.log:
2016-02-27T07:03:15.608072+01:00 di=H10IhkTgem info dhclient: DHCPREQUEST on eth0 to 192.168.1.1 port 67
2016-02-27T07:03:15.611328+01:00 di=H10IhkTgem info dhclient: DHCPACK from 192.168.1.1
2016-02-27T07:03:16.799404+01:00 di=H10IhkTgem info dhclient: bound to 192.168.1.130 – renewal in 14999 seconds.

For now I switched the Network Mode to Static (instead of DHCP), and I’ll see if there is any progress.

I also edited file: /etc/default/cron
and added the following line:
TZ=“America/Los_Angeles”

I’m not sure if it will work, but I wanted cron to do scheduled on 3:00 tasks at 18:00 my time (CET), It’s because I set on my smartphone automatic Camera folder sync, everyday at 18:00, so the drive has to wake up at that time anyway.

Does anybody know if cron does something really useful, or it could be safely disabled? I think it might also be the reason of some wake-ups.

The only thing I’m affraid of, are still those 7-8 seconds wake-ups… I’m worrying about the drive life :frowning:

@tzalewski, check in your router configuration, if DHCP server (or something like this) hasn’t got too short Lease Time, however you might still need to apply some of solutions from this topic to prevent often wake-ups.

This is where rac8006 “Mount” command helps a little. I’m not too sure if it helps a lot, but I’ll give him the credit of it helping “a little”.

I’ve been trying to get rid of that 5-7 second wake up and it has been illusive, but if you are up to it… here it is…

I’ve modified monitor.sh under “/usr/local/sbin”
cd /usr/local/sbin
vi monitorio.sh

at the bottom of the file… it touches files in order to set the date time for counter. This is one of the problems of 5 to 7 seconds wakeups. What happens, I believe, is that the drive is put to sleep and the touches triggers the fact that the drive has more data to write. Back a year ago, I agonized over the fact that it always wait for the 10 minutes is up, drive goes to sleep, then 2 seconds later it wakes up to write again? it made no sense. Thus I put in the syncs… more than enough to flush out the data.

You will have to figure out where I inserted the Syncs.

    ior_datavol=$ior_datavol2
    iow_datavol=$iow_datavol2
    iow_root=$iow_root2
    
    smartTestStatus=`getSmartTestStatus.sh | awk '{print $1}'`
    if [ "$standby_enable" == "enabled" ] && [ "$sleepcount" -eq "$standby_time" ] && [ "$smartTestStatus" != "inprogress" ]; then
        touch /tmp/standby
  sync
  sleep 5
        enterStandbyTime=`date +%s`
        echo "Enter standby"
        if [ "$1" == "debug" ]; then
                echo "`date`: Enter standby "
                dmesg -c > /dev/null
        fi
  sync
  sleep 5
  sync
  sleep 5
  sync
  sleep 5
        for i in ${drivelist[@]}; do
                hdparm -y $i >/dev/null
        done
        # turn on solid blue if applicable
        # ledCtrl.sh LED_EV_DISK_STBY LED_STAT_IN_PROG
  ledCtrl.sh LED_EV_HALT LED_STAT_OK
        sleep 5
        break
    fi
done

fi
done

Yes I have the led set to turn off when it goes to sleep rather than the slow blink.

Last but not least… Yup I also shut down Cron for almost a year except once in awhile I notice that you have to turn it on for a few days to clear out the logs.

/etc/init.d/cron stop

I would not recommend disabling the cron permanently.

I have all the tricks of the trade operating on my ArchiveServer and it sleeps for up to 3 days without waking up. The actual system is still awake, thus pings and other network functions doesn’t wake up the hard drive but yes I still get the occasional 73 second wake ups.

2016-02-17T19:20:39.638313-08:00 di=tHvaf6FVzn notice logger: exit standby after 73 (since 2016-02-17 19:19:21.624665001 -0800)
2016-02-19T09:56:50.731742-08:00 di=tHvaf6FVzn notice logger: exit standby after 138660 (since 2016-02-17 19:25:45.944665001 -0800)
2016-02-23T10:20:03.458390-08:00 di=tHvaf6FVzn notice logger: exit standby after 346681 (since 2016-02-19 10:01:57.094665001 -0800)
2016-02-24T00:18:58.716538-08:00 di=tHvaf6FVzn notice logger: exit standby after 50024 (since 2016-02-23 10:25:09.834665001 -0800)
2016-02-25T21:01:42.642397-08:00 di=tHvaf6FVzn notice logger: exit standby after 160652 (since 2016-02-24 00:24:04.974665001 -0800)
2016-02-26T10:23:35.816007-08:00 di=tHvaf6FVzn notice logger: exit standby after 47617 (since 2016-02-25 21:09:53.044665001 -0800)
2016-02-27T08:03:09.988500-08:00 di=tHvaf6FVzn notice logger: exit standby after 76438 (since 2016-02-26 10:49:06.604665001 -0800)

Thanks. I was using your old modification with just:
sync
sync
sleep 10

And the 7 sec problem was still present.

I’ll give a try to the new one, and I’ll also stop the corn for tests. I’ll write how it works tomorrow or in 2 days :slight_smile:

My DHCP lease time is set to 3600 seconds. Is that ok?

That seems very short. 3600 seconds is one hour. If you are using windows you can do ipconfig /all and look for lease obtained and lease expires. On my system it was Feb 23 and Feb 29

RAC

I changed it to 82600. I’l let you know if that helped.

@tzalewski, please note that if you didn’t do any modifications presented in this topic - your system will be still waking-up very often.
My recent sleep times:
02 27 09:27:20 15:02:41 20121 5:35:21
02 27 15:27:12 16:01:10 2038 0:33:58
02 27 16:11:21 16:21:54 633 0:10:33
02 27 16:59:49 17:00:07 18 0:00:18
02 27 17:10:18 17:17:09 411 0:06:51
02 27 17:27:20 17:28:16 56 0:00:56
02 28 17:41:24 00:10:36 23347 6:29:07
02 28 01:29:12 01:29:39 22 0:00:22
02 28 01:46:58 02:53:00 3957 1:05:57
02 28 03:22:37 05:14:53 6730 1:52:10
02 28 05:25:04 17:00:26 41716 11:35:16

I think it would sleep even longer if I didn’t wake it up. Once again, I’d like to thank RAC and Ralphael for help.

Currently I disabled the cron. I’ll enable it and test for another few days to check if it affect sleep times.

@mona @rac8006 thank you for your help. I changed DHCP lease time to 2 days and my drive begun to sleep normaly as it used to before i changed the router !!!. Thank you once again :slightly_smiling:

I also discovered a lot of DHCPREQUEST and DHCPACK entries in daemon.log file every ~1500 seconds probably causing Mycloud wakeups.

Which method did you use to change the lease time?

RAC

I loged into my router and changed router settings (not mycloud)

That is what I did. But spent some time trying to see if it could be done on the my cloud. Was confused because windows lease time was different than on the router.

RAC

Is there one particular post or thread that has all this information in one place for others to refer too? It would make it easier if there was as one could simply post a link to such a post or thread, because these sleep threads seem to come up fairly regularly these days.

Right now the information on how to disable the various services, and or configure the startup files to disable the services, are scattered across numerous posts and threads. It is a bit confusing for the novice users, which makes it very difficult for others to know exactly what a person should do to try and fix these sleep issues.

I also restarted the router and mycloud after i changed the DHCP lease time. I don’t know if that’s important but may help

I didn’t reboot either. But the lease time changed.

RAC

Well, I had this in the log file:
2016-02-27T07:03:15.608072+01:00 di=H10IhkTgem info dhclient: DHCPREQUEST on eth0 to 192.168.1.1 port 67
2016-02-27T07:03:15.611328+01:00 di=H10IhkTgem info dhclient: DHCPACK from 192.168.1.1
2016-02-27T07:03:16.799404+01:00 di=H10IhkTgem info dhclient: bound to 192.168.1.130 – renewal in 14999 seconds.

While my router had dhcp lease time set to 2 days. Seems like My Cloud wants to renew every ~4 hours? For now I just set STATIC instead of DHCP.

It appears per other posts by either you or others indicate that one can use the /etc/rc2.d/S98user-start file to have the commands run at boot. However for some reason I get an error (message below) trying to open the S98user-start file on a v04.04.02-105 single bay My Cloud. Further while I have a to /CacheVolume/ folder I don’t have a folder or file called user-start in that CacheVolume folder.

WinSCP error opening S98user-start file:

No such file or directory.
Error code: 2
Error message from server: No such file

Currently have the commands below in a .sh file that I run after booting the my Cloud along with an edited monitorio.sh file to try and fix the stupid 7-8 second wake up issue. Hopefully will allow the My Cloud to sleep longer than 7-8 second or longer than every 10 minutes.

/etc/rc2.d/S20restsdk-serverd stop
mount -o remount,noatime,nodiratime /dev/root /
/etc/init.d/wdmcserverd stop
/etc/init.d/wdphotodbmergerd stop
/etc/init.d/openvpn stop
/etc/rc2.d/S85wdmcserverd stop
/etc/rc2.d/S86wdphotodbmergerd stop