Saturday, October 5, 2013

Western Digital Green Drives and Linux - They're dying!

The last time I swapped the drives out in my home built NAS, I bought Western Digital Green drives.  They sounded great!  Low power, low heat, low noise...

Unfortunately, they appear to not have been built for this particular application.  They auto park and the timer is set too low for Linux filesystems.  (I believe the default may be 8 seconds!

My drives began to give me trouble (thankfully) even before the warranty ran out.  I found the load cycle count on my drive to be extremely high - 10's or 100's of thousands.  This is way beyond the expected count.

Here's how to query for it:

# smartctl -A /dev/sdX | grep ^193
193 Load_Cycle_Count        0x0032   200   200   000    Old_age   Always       -       XXXXXXX

Luckily there is a solution -- run this tool to either turn off the feature, or set the timeout much higher:

Make sure you follow the instructions closely -- you must power cycle the drives!

Now every time I boot, I run this script as part of the boot, just in case I forget if I put a new WD Green in.

for dev in /dev/sd[a-z]
   if ! hdparm -i $dev | grep Model=.*SSD
       if hdparm -i $dev | grep -q Model=WDC
           echo Disabling western digital 8sec park
           /opt/idle3-tools/sbin/idle3ctl -d $dev
       echo Setting timeout for non SSD drive
       hdparm -S 251 $dev

(WD has been mostly sending me back WD Red Drives, which is great as I believe they are marketed for NAS.)