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

It was running for around 5 minutes. I wanted to first test if the script detects files accessed from SMB shares.

I’ve good news: I think I detected what caused this problem.
It was either:

  • Stopped cron (I resumed yesterday to let it run for a full day)
  • External NAS device with OpenMediaVault. I restarted it before night. Not sure if it was the issue, but I’ll be observing it more.

Seems like it helped:

2019-04-12T07:09:15.645208+02:00 di=H10IhkTgem notice logger: exit standby after 13416 (since 2019-04-12 03:25:39.760101001 +0200)
2019-04-12T08:01:09.496722+02:00 di=H10IhkTgem notice logger: exit standby after 2503 (since 2019-04-12 07:19:26.880101001 +0200)
2019-04-12T08:01:19.212473+02:00 di=H10IhkTgem notice logger: Rotated atop, atop_size=3055062 atop_upload_size=1065
2019-04-12T08:12:11.661327+02:00 di=H10IhkTgem notice logger: exit standby after 51 (since 2019-04-12 08:11:20.670101001 +0200)
2019-04-12T08:26:19.178958+02:00 di=H10IhkTgem notice logger: exit standby after 237 (since 2019-04-12 08:22:22.710101001 +0200)
2019-04-12T11:48:48.555133+02:00 di=H10IhkTgem notice logger: exit standby after 11538 (since 2019-04-12 08:36:30.300101001 +0200)

Thanks for help.

One more question, I know that “chroot” exists, which would prevent those random wake-ups. Does anyone know if it has the “full” WD firmware running on it? Would it lose files/shares after installing? (I have full backups, but still restoring takes a very long time).

chroot is a program. It does not contain any firmware. Using chroot you could mount a USB device with different firmware. Then you chroot to the USB. Now anything you run will use the USB code to run. IF you want to play with chroot google chroot. There are several things you need to setup to be able to have access to your data files from the chroot environment.

Back in the days I suspected OpenVPN which I believe is the link between your cloud and WD Servers, on trying to connect.

After killing that service, by issuing
killall openvpn
(I believe as it has been a year since I last looked at this)

My Cloud seems to settle down.

Alternatively, rebooting the my cloud from time to time seems to settle it down also.

This is all I have from my memories…

Good luck

@rac8006 you should check if whether DHCP renew wakes up the cloud. This is something that is always in the back of my mind but I keep forgetting to mention it as one of the wake up factors.

I have not done much wok on the My Clouds lately. I’m in the process of making an older PC that I have been using to rebuild My Cloud software into a nas. It currently has a 4TB system disk and a 8TB mirror for my data. I.m about ready to take the two 6TB disk from my two clouds and put them in as a 6TB mirror. It has more cpus and memory than the clouds.

Interesting, run that command on my first gen and it indicates “openvpn: no process found”. I have remote access turned off in the Dashboard.

then there won’t be any openvpn :stuck_out_tongue:

I do remember a scenario when the WD servers were going up and down for some strange reason and My Cloud would wake every 30 minutes exactly on the dot.

I had suspected that once you are connected to WD they get to watch all your movies on your drive.

Good luck rac8006.

I had a bunch of Shuttles back in the day and even then they are big in comparison to a tiny Cloud.

A Raspberry Pi would make a great NAS. The problem with a Raspberry Pi would be all the cords dangling from the motherboard to the Hard Drives.

Thus I prefer that all-in-one QNAPs of which mine was only about $350 giving me 24TB raid 6.

The obvious cause is the system pushing something out to swap. These are memory constrained devices with things running, and likely have the swappiness value turned to something lower than defaults. (meaning it prefers to put things into swap)

this means that when something needs to be pulled back from swap, or paged out to swap, the drive will wake to service the system call.

This is one of the major reasons I wish WD had not been tools, and had included zram in the firmware. (also btrfs. ■■■■, btrfs with zstd compression would be glorious on a NAS.)

One of these days I will get around to testing sata port replicators on my EX2…

If the Pi had SATA port(s) then it would make a potentially good NAS assuming those ports didn’t share the USB pipeline. The main drawback with using the Pi is not the bundle of cords, its the hardware that uses the USB lane for both Ethernet and USB hard drives. For example on the Pi 3 B Plus the hard drive and network transfer speeds are capped by the shared use of the USB 2.0 speed. The Pi can be used as an NAS but it has some significant drawbacks for the time being. Currently I use the Pi as a Plex server (and to run other modules). I don’t really use it as an NAS even though I have an old 750 GB USB hard drive hanging off it and have Samba enabled on the Pi.

Right now as a pure NAS, the My Cloud operates better than a Pi when it comes to file transfer performance.

Some speed comparison on a laptop using a USB 3.0 to Ethernet adapter to copy files to a Pi 3 B Plus and to a My Cloud. The My Cloud is significantly faster.

Raspberry Pi:
Pi

My Cloud:
2

Note don’t get me wrong about the Pi. I like them, I run two currently. It has it’s uses but for being a pure NAS it has one or two significant drawbacks.

i use “Odroid XU4” as the second NAS (but there are currently newer models which work even better). It costs more than Pi, but it’s great. It has 2x USB3.0 and 1Gbs Ethernet. After minor tweaks to EXT4 mount settings (copied from MyCloud) I’m getting even better speeds from my external USB3.0 Wd My Book. NTFS speed (another My Book device formatted to this format) with “bigwrites” mount settings works much better than MyCloud, basically allows full speed. What’s beautiful is that external drives never wake up, because the whole system is on a micro-SD card. Not to mention that this device has 8 CPU cores and 2GB RAM, so simultaneous transfers are not a problem like on MyCloud. Also, when needed AES encryption/decryption works pretty fast, so could create protected volumes (however newer Odroid models than XU4 are better for it).

EDIT:
Test Results

MyCloud (internal drive):


(don’t know why read speeds for 4KiB Q8T8 and lower are so low. I repeated the test with same results)

XU4 with external Wd My Book formatted to EXT4:

XU4 with external Wd My Book formatted to NTFS:

ahhh yes you need at minimum of USB 3.0 for a NAS to be more viable but still what you are getting isn’t too bad.

ok this has more CPU cores than my Gaming PC.

I do like the size of the ODROID-XU4 but I hate the huge fan.

The speed isn’t too bad (for what it is) but it’s not enough if you are trying to stream more than one stream. Generally I only get frustrated with Raspberry Pi Samba USB 2.0 speed when transferring several large files. For a small number of small files it’s fine as an NAS.

In my case I run; Plex, Forked-Daapd, COPS (eBook server), Samba and Pi-Hole on that Pi-3B+. The Plex, Forked-Daapd and COPS all access the first gen My Cloud for it’s media storage/use. Works fairly well for individual low usage when streaming but if I try to do transcoding or stream more than one stream or do anything else that taxes the USB 2.0 throughput things typically gets squirly.

1 Like

They have a version without the fan, called “ODROID-XU4Q” (currently $49.00), but there are some negative opinions about throttling. The new one is “ODROID-N2” with 2GB or 4GB of RAM. Benchmarks look amazing. It has a better DC than XU4 (12V/2A vs 5V/4A), 4 USB 3.0 ports. A nice toy to have, which can be used for many more things than just NAS. I have openmediavault, pihole, Plex, Rsync and stuff like this.

1 Like

Hi Mona,

Which version you think the sleep issue can be solved?

Andy

Hi. Stopping unused services solves the problem on all firmware versions I was using. I currently use “WDMyCloud v04.05.00-342” (newest available).
However, this disk is still waking up every X hours. It’s enough if some laptop / smartphone scans for available network devices. Any access / listing of My Cloud results in wake ups.

Hi Mona,

Mine is Gen 1 MyCloud 4.05.00.342. I have taken into account of rac8006 and others in this forum and edit the S98user-start file as follows but the MyCloud still wakes up after 10 minutes.

#!/bin/sh

User startup script

should run automatically after every reboot, and be unaltered by firmware upgrades

so should sort out the mess caused by firmware upgrades

Move Msg.sock to temporary RAM location

/etc/init.d/samba stop
mount -t tmpfs -o mode=0700,noatime,size=2m tmpfs /etc/samba/msg.sock/
/etc/init.d/samba start

Stop and disable indexing services (just stopping the service not disable)

/etc/init.d/wdmcserverd stop
/etc/init.d/wdphotodbmergerd stop

stop RESTSDK server daemon

for OS3 only

#/etc/rc2.d/S01motd
#/etc/rc2.d/S01wdAppEntry
/etc/rc2.d/S03atop stop
#/etc/rc2.d/S04apache2
#/etc/rc2.d/S16ntpdate
#/etc/rc2.d/S16openvpn
#/etc/rc2.d/S16ssh
#/etc/rc2.d/S17monitorTemperature
#/etc/rc2.d/S18monitorio
#/etc/rc2.d/S20minidlna
/etc/rc2.d/S20nfs-common stop
/etc/rc2.d/S20nfs-kernel-server stop
/etc/rc2.d/S20restsdk-serverd stop
#/etc/rc2.d/S20samba
#/etc/rc2.d/S20sysstat
#/etc/rc2.d/S20vsftpd
/etc/rc2.d/S20winbind stop
/etc/rc2.d/S50netatalk stop
/etc/rc2.d/S60mDNSResponder stop
/etc/rc2.d/S61upnp_nas stop
#/etc/rc2.d/S75sudo
#/etc/rc2.d/S84itunes
/etc/rc2.d/S85twonky stop
/etc/rc2.d/S85wdmcserverd stop
#/etc/rc2.d/S86commgrd
/etc/rc2.d/S86wdphotodbmergerd stop
#/etc/rc2.d/S89cron
#/etc/rc2.d/S90lltd
#/etc/rc2.d/S91nspt
/etc/rc2.d/S92wdnotifierd stop
/etc/rc2.d/S95wdAutoMount stop
#/etc/rc2.d/S96onbrdnetloccommd
#/etc/rc2.d/S98user-start
#/etc/rc2.d/S99wdAppFinalize

stop unwanted wakeups

mount -o remount,noatime,nodiratime /dev/root /

Stop Cron

/etc/init.d/cron stop

Would you advise any other steps I can take?

Hi Andy.

The file I edited is: /CacheVolume/user-start
I don’t have “#!/bin/sh” on top of it (I know it’s required for bash scripts executions on Linux, but in this case maybe it’s not needed, or even disallowed?).

The script I currently use is:

# Attempts to fix sleep issue with Samba
/etc/init.d/samba stop
mount -t tmpfs -o mode=0700,noatime,size=2m tmpfs /etc/samba/msg.sock/
/etc/init.d/samba start
# Stop unwanted wakeups
mount -o remount,noatime,nodiratime /dev/root /

# Stop and disable indexing services (just stopping the service not disable)
/etc/init.d/wdmcserverd stop
/etc/init.d/wdphotodbmergerd stop

# For OS3 firmware only - stop RESTSDK server daemon
/etc/rc2.d/S20restsdk-serverd stop

#Mona Additional disables:
/etc/init.d/restsdk-serverd stop
/etc/init.d/cron stop
/etc/init.d/upnp_nas stop
/etc/init.d/mDNSResponder stop

Of course after editing it, My Cloud restart is required to automatically stop services on start.

Hi Mona,

Situation is improved a lot. Here is my log. Would you advise how to eliminate the regular wake up after around 1050 seconds?

2020-05-16T00:02:20.379093+08:00 di=XfPLluxwPH notice logger: exit standby after 1113 (since 2020-05-15 23:43:47.675191000 +0800)
2020-05-16T00:25:07.443003+08:00 di=XfPLluxwPH notice logger: exit standby after 1061 (since 2020-05-16 00:07:26.345191000 +0800)
2020-05-16T00:47:47.473956+08:00 di=XfPLluxwPH notice logger: exit standby after 1054 (since 2020-05-16 00:30:13.945191000 +0800)
2020-05-16T01:10:17.639134+08:00 di=XfPLluxwPH notice logger: exit standby after 1044 (since 2020-05-16 00:52:53.895191000 +0800)
2020-05-16T01:32:48.399571+08:00 di=XfPLluxwPH notice logger: exit standby after 1044 (since 2020-05-16 01:15:24.605191000 +0800)
2020-05-16T01:55:14.414479+08:00 di=XfPLluxwPH notice logger: exit standby after 1040 (since 2020-05-16 01:37:54.455191000 +0800)
2020-05-16T02:17:53.445122+08:00 di=XfPLluxwPH notice logger: exit standby after 1053 (since 2020-05-16 02:00:20.455191000 +0800)
2020-05-16T02:40:27.510291+08:00 di=XfPLluxwPH notice logger: exit standby after 1048 (since 2020-05-16 02:22:59.505191000 +0800)
2020-05-16T03:02:58.483967+08:00 di=XfPLluxwPH notice logger: exit standby after 1045 (since 2020-05-16 02:45:33.845191000 +0800)
2020-05-16T03:25:31.359600+08:00 di=XfPLluxwPH notice logger: exit standby after 1047 (since 2020-05-16 03:08:04.505191000 +0800)
2020-05-16T03:48:01.357751+08:00 di=XfPLluxwPH notice logger: exit standby after 1044 (since 2020-05-16 03:30:37.395191000 +0800)
2020-05-16T04:10:31.483002+08:00 di=XfPLluxwPH notice logger: exit standby after 1044 (since 2020-05-16 03:53:07.405191000 +0800)
2020-05-16T04:32:53.467456+08:00 di=XfPLluxwPH notice logger: exit standby after 1036 (since 2020-05-16 04:15:37.875191000 +0800)
2020-05-16T04:55:28.362724+08:00 di=XfPLluxwPH notice logger: exit standby after 1048 (since 2020-05-16 04:37:59.995191000 +0800)
2020-05-16T05:17:57.402015+08:00 di=XfPLluxwPH notice logger: exit standby after 1043 (since 2020-05-16 05:00:34.455191000 +0800)
2020-05-16T05:40:21.381634+08:00 di=XfPLluxwPH notice logger: exit standby after 1038 (since 2020-05-16 05:23:03.495191000 +0800)
2020-05-16T06:02:48.363746+08:00 di=XfPLluxwPH notice logger: exit standby after 1041 (since 2020-05-16 05:45:27.375191000 +0800)
2020-05-16T06:25:23.409681+08:00 di=XfPLluxwPH notice logger: exit standby after 1049 (since 2020-05-16 06:07:54.375191000 +0800)
2020-05-16T06:47:51.410756+08:00 di=XfPLluxwPH notice logger: exit standby after 1042 (since 2020-05-16 06:30:29.545191000 +0800)
2020-05-16T06:58:40.123021+08:00 di=XfPLluxwPH notice logger: exit standby after 343 (since 2020-05-16 06:52:57.445191000 +0800)
2020-05-16T07:10:32.492241+08:00 di=XfPLluxwPH notice logger: exit standby after 406 (since 2020-05-16 07:03:46.105191000 +0800)
2020-05-16T07:32:46.456922+08:00 di=XfPLluxwPH notice logger: exit standby after 1028 (since 2020-05-16 07:15:38.525191000 +0800)
2020-05-16T07:55:09.392544+08:00 di=XfPLluxwPH notice logger: exit standby after 1037 (since 2020-05-16 07:37:52.475191000 +0800)
2020-05-16T08:17:38.427082+08:00 di=XfPLluxwPH notice logger: exit standby after 1043 (since 2020-05-16 08:00:15.405191000 +0800)
2020-05-16T08:40:04.610442+08:00 di=XfPLluxwPH notice logger: exit standby after 1040 (since 2020-05-16 08:22:44.975191000 +0800)
2020-05-16T09:02:38.511218+08:00 di=XfPLluxwPH notice logger: exit standby after 1048 (since 2020-05-16 08:45:10.635191000 +0800)
2020-05-16T09:25:09.489708+08:00 di=XfPLluxwPH notice logger: exit standby after 1045 (since 2020-05-16 09:07:44.575191000 +0800)
2020-05-16T09:47:42.434461+08:00 di=XfPLluxwPH notice logger: exit standby after 1047 (since 2020-05-16 09:30:15.445191000 +0800)
2020-05-16T10:10:12.386917+08:00 di=XfPLluxwPH notice logger: exit standby after 1044 (since 2020-05-16 09:52:48.395191000 +0800)
2020-05-16T10:32:42.433998+08:00 di=XfPLluxwPH notice logger: exit standby after 1044 (since 2020-05-16 10:15:18.315191000 +0800)
2020-05-16T10:55:19.353539+08:00 di=XfPLluxwPH notice logger: exit standby after 1051 (since 2020-05-16 10:37:48.475191000 +0800)

I think this could be one of your devices accessing My Cloud (for some reasons).
As first I would recommend to turn off Wi-Fi / Ethernet in all devices that access My Cloud and see which one causes the problem. When it’s detected, then stop applications / services on that device to detect which one is contacting My Cloud every ~17 minutes.
I remember I had a similar problem, which is described here: WD My Cloud randomly wakes up the drive when Drive Sleep is enabled - #58 by Mona
@ rac8006 posted file " checkgen1.txt (renamed to .sh) with instructions how to use it.
This could help you to detect what file on your NAS is being accessed.

I know all those wake-ups are annoying. I’m just happy that this device doesn’t wake me up at nights anymore. In my case it can sleep sometimes for over 12 hours. It still has some random wake-ups from time to time, usually when I turn on laptop or Desktop.Windows is scanning for latest used network locations or something.
I hope you’ll also be able to fully fix it.

If you execute this file checkgen1.sh 5 It will wake up every 5 seconds and check for files that have been modified in the last minute. Using the file names you might be able to determine what caused the wake up to happen. You can change the 5 seconds to what ever time you want to use.

checkgen1.txt (940 Bytes)

Thank you for your advice, I will try.