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


#21

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.


#22

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)

STILL NOT SLEEPING! - and I GIVE UP!
#23

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:


#24

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


#25

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


#26

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


#27

@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.


#28

@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.


#29

Which method did you use to change the lease time?

RAC


#30

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


#31

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


#32

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.


#33

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


#34

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

RAC


#35

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.


#36

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

#37

Hi. I created a file called “user-start” in the /CacheVolume/ folder, then added execute permissions and it works fine.

My file has got:
mount -o remount,noatime,nodiratime /dev/root /
/etc/init.d/nfs-kernel-server stop
/etc/init.d/nfs-common stop
/etc/init.d/upnp_nas stop
/etc/init.d/mDNSResponder stop
/etc/init.d/wdphotodbmergerd stop
/etc/init.d/wdnotifierd stop
/etc/init.d/wdmcserverd stop
/etc/init.d/restsdk-serverd stop
/etc/rc2.d/S20restsdk-serverd stop


“/etc/rc2.d/S20restsdk-serverd” stopped because of errors: “error: stat /tmp/dynamicconfig.ini: no such file or directory” in logs, but I disabled Remote Access, so I think I don’t need it anyway.
I think I’ll also add “/etc/init.d/cron stop” to “user-start” file, because I noticed that when the cron is enabled the drive still wakes up at random times. Not that often as before, but still.

My recent sleep times:

02 28 05:25:04 17:00:26 41716 11:35:16
02 28 17:20:48 18:00:52 2399 0:39:59
02 28 18:11:03 22:35:09 15840 4:24:00
02 29 22:45:20 00:01:09 4544 1:15:44
02 29 00:11:21 00:30:10 1124 0:18:44
02 29 00:40:21 03:00:10 8384 2:19:44
02 29 03:16:09 03:16:36 22 0:00:22
02 29 03:26:47 06:08:07 9675 2:41:15
02 29 06:18:19 06:23:26 302 0:05:02
02 29 07:41:08 07:41:35 22 0:00:22
02 29 07:51:46 09:01:09 4158 1:09:18
02 29 09:11:21 09:30:10 1124 0:18:44
02 29 09:40:21 09:40:48 22 0:00:22
02 29 09:50:59 10:17:09 1565 0:26:05
02 29 10:33:28 10:33:55 22 0:00:22
02 29 10:44:07 17:13:42 23370 6:29:30
02 29 17:23:53 18:06:50 2571 0:42:51
03 01 18:29:18 02:58:47 30564 8:29:24
03 01 04:05:04 05:01:50 3401 0:56:41
03 01 05:55:46 05:56:14 23 0:00:23
03 01 06:06:25 18:10:50 43460 12:04:20
03 01 18:40:28 18:40:56 23 0:00:23
03 01 18:51:07 18:58:09 417 0:06:57
03 01 19:08:20 20:02:41 3256 0:54:16


#38

Good to know. Figured I’d have to create the file and it’s contents since it didn’t exist, just didn’t know if I was alone in not having the file on their My Cloud.


#39

I wonder how the file was removed. Both of my systems have the user-start file in CacheVolume directory. The /erc/rc2.d/S98-user-start is a symbolic link to /CacheVolume/user-start. As for the 8 second wake up. From what I’ve been able to determine. It is caused by files used by monitorio.sh being flushed and needing to be reloaded.

RAC


#40

No clue, never saw or opened the file before I went looking for it today. I assume it wasn’t created or installed when I unbricked the drive I have in the My Cloud enclosure that the present time. Nor was it created or installed when upgrading to newer firmware.