The Reason why your WD Cloud ain't getting no sleep and We Should Petition WD to fix!


#31

Anyone test the latest firmware to see if sleep functionality has been “enhanced” ? lol


#32

Hi all, I have a related question… Is there anyway to tell if the hard drive is sleeping, from a scripting perspective?

I have a script I’m using to engage the fan when the drive temperatures get hot, but I don’t want to inadvertently keep the HD’s awake by polling for their temperatures. If the HD’s have been put to sleep, then I’ll monitor the system’s board temperature until they wake up again.

Thanks!


#33

hdparm -C /dev/sda returns the following:
/dev/sda:
drive state is: active/idle
or
/dev/sda:
drive state is: standby


#34

Thank you. I was digging for an answer myself too and learned that sometimes hdparm -C can inadvertently wake up a sleeping drive. I’m not sure how true or rare that is, but because of this I’m currently trying the following:

smartctl -i -n standby /dev/sda

It’s a bit harder to parse the output, as its formatting differs from active to standby state, but it may be a more ideal option to ensure a drive continues to sleep.

Thanks again!


#35

This is the code used in monitorio.sh script to check if the disk is in standby. Could probably do the same thing with you code just change what you grep.
I have not noticed any time that the hdparm -C /dev/sda woke up the disk.

for i in ${drivelist[@]}; do
        hdparm -C $i | grep -q "standby"
        standby_test=$?
        [ "$standby_test" -eq "1" ] && break
done

#36

Good point. I was also using hdparm last night without any issue, but wasn’t sure given what I had read online in the general case. I may go ahead and just implement hdparm, it’s certainly more elegant to parse that than smartctl.

I’m excited about this fan script (created by another user with my edits to preserve sleeping hard drives), as it will do a world of good to keep the drives cooler than what WD deems necessary.


#37

Actually you can parse the smarctl using the same method. Just grep for ACTIVE or STANDBY. I don’t have the output for a drive in standby. I just tried the smartctl code on my device. When I first logged in and ran the command it responded quick. I then tried the command later and the response was slow. Like it waited for the disk to wake up. So not sure it smartctl would return STANDBY.


#38

I could grep but I’m using a Python script which makes it a bit more cumbersome to execute that command. It’s doable but in the end I think I prefer hdparm since there are apparently no issues with it waking up the drive.


#39

Regarding smartctl, I think you need the right switches set (specified above) to explicitly prevent the drive from waking. I was able to read standby states with it and not have the drive wake up.

In any case, this is the snippet of what I do in Python now using hdparm. It returns active/idle or standby or sleep depending on the drive’s status. There is likely a cleaner way to do this in fewer lines (nested splits perhaps), but I like to be very explicit when I first implement code.

	sda_query = subprocess.check_output(["hdparm", "-C", "/dev/sda"])
	sdb_query = subprocess.check_output(["hdparm", "-C", "/dev/sdb"])

	sda_return = sda_query.split("\n")
	sdb_return = sdb_query.split("\n")

	sda_return2 = str.split(sda_return[-2])
	sdb_return2 = str.split(sdb_return[-2])

	sda_state = sda_return2[-1]
	sdb_state = sdb_return2[-1]

sda_state and sdb_state will then be “active/idle” or “standby” or “sleep” depending on drive state.


#40

On the gen2 there is a program called set_pwm. This is the program that checks if the disk is in standby mode by calling hdparm -C once a minute. It also puts the disk into standby mode. I’ve been doing some work on tracing gen2 disk activity. I just recently found that Both smartctl and hdparm send a command to the disk drive to put it in standby. Not sure why this redundant I/O is being done.


#41

Sheesh, come on WD. I guess the once a minute kind of makes sense, there’s a shell script called hd_standby.sh that seems to work by specifying minutes until standby as well. They do seem to also have a lot of redundancy including some dead code here and there. Now if I could only find out what they do that seems to peg the CPU every once in a while.

If you have any interest I’ll post my script with the recent enhancements I made, in the next couple days. It’s nice to have a script that actually keeps the NAS a bit cooler, whereas WD assumes you have their Red drives in there that can work up to aluminum melting points. :stuck_out_tongue:


#42

I get the impression that WD does not understand the Operating system. They are just interested in the code that they write. Which by viewing this forum. They don’t have a very good handle on there own code. As for the Red drive. They have so much confidence in it that they reduced the warranty by 33% when it is installed in a MY Cloud.

Please post your code. It is always interesting to see what other people are doing.


#43

I’ve completely given up on the hope of having this product go to sleep appropriately. I do have my USB HDD set to sleep after a while and it does so successfully and predictably, but I just set drive sleep to “off” and let the WD MyCloud spin continuously, as the way it was waking and sleeping the disk every few minutes had me worried.


#44

I’d be interested to have you post your script.

Thanks!


#45

Hmm, I did post the script before, but my post isn’t listed anymore. It looks like maybe WD removed that post along with the Google Docs link to it?

EDIT: It is still posted, in the other thread:


#46

That sounds like the twonky service that scans for new media. If you search on here there’s a thread that talks about how to change it from “all the time” to daily, weekly, or less.


#47

I believe during my troubleshooting I tested disabling the twonky service via SSH with no luck. The drive would wake up very shortly after going to sleep almost every time. At times it would get a few hours sleep, but no more than that. This is my second unit as the first one finally went bad after a few years with a bad HDD.


#48

Hello, I’m in contact with WD support about this drive sleep. Mine start sleeping and stop after a while. This is actually increasing the Load Cycle Count of the drive. I have just sent the LOGs required by them to analyse. Lets see what is the feedback.


#49

Good luck with that…


#50

Hi,
I want to set up a log program and trace the accesses to my cloud. My cloud doesn’t sleep as well and it makes too much noise while working at nights in a silent room.
So to track the issue, which software(s) should I use.
Regards,