15-Feb-2017: Updated linux command examples
This post is part of a short series on NAS technology:
- Make your WD Greens NAS ready
- A comparison of different RAID and Union file systems
- How I configured Snapraid and AUFS
- Incremental backups to object storage using rclone and zbackup
I recently needed more storage space in my home NAS and decided to add a few disks. Because my NAS is mostly used as a media server, I don’t need any high RPM drives: 5400 RPM drives will suffice. After some googling I settled on buying Western Digital drives. They have good and bad reviews like any other brand, but they never seem to score below average in any of them.
There is now just one choice left to be made: the cheaper WD Greens or “server ready” WD Reds? It turns out that these drives are physically identical, with just a firmware parameter and the warranty period setting them apart.
Difference between WD Green and WD Red disks
In order to minimize energy usage, WD Green disks are configured to very aggressively park the head of the disk: this happens after 3 seconds. That setting is OK if you’re using this as your OS disk, because disk usage tends to be grouped in peaks. This setting is fatal for a disk if it gets used in a server. Disk usage on file servers is much wider spread, causing the disk heads to move a lot. So much so that some bits of plastic will wear out in the first year. WD Reds wait much longer to park the disk head, eliminating this issue.
Fortunately for us, there is a tool that allows you to set this value yourself. On windows this a tool released by WD themselves: wdidle3.exe
On Linux some folks reversed engineered this and released it as idle3-tools.
Change the idle time on Windows
The first thing you need to is get the wdidle3.exe
program. You can get it from Western Digital or via a simple google search.
Once you have it on your machine, you’ll need the command prompt to use it. The following command will read the current value of the parking speed:
wdidle3.exe /R
Using the tool you can set the parking speed to a maximum of 300 seconds:
wdidle3.exe /S 50
Or you can disable it completely:
wdidle3.exe /D
The settings are only applied the next time the disk starts. So after the next machine reboot your green drives will be perfectly safe to use in a server.
Change the idle time on Linux
WD doesn’t offer a tool to change the parking speed on linux, but a few folks reverse engineered it. It is available on sourceforge and in the idle3-tools
package on ubuntu:
sudo apt-get install idle3-tools
You can check the current setting for /dev/sda
with this command:
sudo idle3ctl -g /dev/sda
You can change the setting to 300 seconds as follows:
sudo idle3ctl -s 138 /dev/sda
The man page for idle3ctl
states that values between 1 and 128 add 0.1 seconds, values between 129 and 256 add 30s: 128 * 0.1 + (138 - 128) * 30 = 312.8 seconds
You can disable disk parking entirely using:
sudo idle3ctl -d /dev/sda
As with the Windows tool, the settings are only applied the next time the disk starts up. The easiest way is to reboot your machine to have the changes take effect.
If you want to check how much the head of your disk has already been parked, you can check the Load_Cycle_Count
outputted by smartctl
. Asuming your drive is /dev/sda
, the command looks as follows:
smartctl -A /dev/sda | grep Load_Cycle_Count
WD drives are rated for up to 250 000 parking cycles. The Load_Cycle_Count
should be well below that number (a couple 1000 maximum if the drive has been in operation for some time).