Summary: Re: Spin down HDD after disk sync or before power off

Tijl Coosemans tijl at coosemans.org
Fri Oct 22 10:07:46 UTC 2010


On Friday 22 October 2010 00:32:54 Paul Wootton wrote:
> Actually, the green series does spin all the way down, well at least
> the drive I have does.
> Here is the output from one of my drives, that I do not think has
> long left to live.
> 
> === START OF INFORMATION SECTION ===
> Model Family:     Western Digital Caviar Green family
> Device Model:     WDC WD5000AADS-00M2B0
> Serial Number:    WD-WMAV51882791
> Firmware Version: 01.00A01
> User Capacity:    500,107,862,016 bytes
> Device is:        In smartctl database [for details use: -P show]
> ATA Version is:   8
> ATA Standard is:  Exact ATA specification draft version not indicated
> Local Time is:    Thu Oct 21 23:31:35 2010 BST
> SMART support is: Available - device has SMART capability.
> SMART support is: Enabled
> ....
> SMART Attributes Data Structure revision number: 16
> Vendor Specific SMART Attributes with Thresholds:
> ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      
> UPDATED  WHEN_FAILED RAW_VALUE
>    1 Raw_Read_Error_Rate     0x002f   200   200   051    Pre-fail  
> Always       -       0
>    3 Spin_Up_Time            0x0027   111   104   021    Pre-fail  
> Always       -       7425
>    4 Start_Stop_Count        0x0032   100   100   000    Old_age   
> Always       -       98
>    5 Reallocated_Sector_Ct   0x0033   200   200   140    Pre-fail  
> Always       -       0
>    7 Seek_Error_Rate         0x002e   100   253   000    Old_age   
> Always       -       0
>    9 Power_On_Hours          0x0032   093   093   000    Old_age   
> Always       -       5295
>   10 Spin_Retry_Count        0x0032   100   253   000    Old_age   
> Always       -       0
>   11 Calibration_Retry_Count 0x0032   100   253   000    Old_age   
> Always       -       0
>   12 Power_Cycle_Count       0x0032   100   100   000    Old_age   
> Always       -       96
> 192 Power-Off_Retract_Count 0x0032   200   200   000    Old_age   
> Always       -       95
> 193 Load_Cycle_Count        0x0032   001   001   000    Old_age   
> Always       -       781014
> 194 Temperature_Celsius     0x0022   120   102   000    Old_age   
> Always       -       27
> 196 Reallocated_Event_Count 0x0032   200   200   000    Old_age   
> Always       -       0
> 197 Current_Pending_Sector  0x0032   200   200   000    Old_age   
> Always       -       0
> 198 Offline_Uncorrectable   0x0030   200   200   000    Old_age   
> Offline      -       0
> 199 UDMA_CRC_Error_Count    0x0032   200   200   000    Old_age   
> Always       -       0
> 200 Multi_Zone_Error_Rate   0x0008   200   200   000    Old_age   
> Offline      -       0
> 
> 
> The datasheet for these drive 
> <http://www.wdc.com/wdproducts/library/SpecSheet/ENG/2879-701229.pdf>http://www.wdc.com/wdproducts/library/SpecSheet/ENG/2879-701229.pdf 
> says
> "Reliability/Data Integrity
> Load/unload cycles (3)         300,000
> Limited Warranty (years) (4)
> (3) Controlled unload at ambient condition
> (4) The term of the limited warranty my vary by region"
> 
> Also 
> http://wdc.custhelp.com/cgi-bin/wdc.cfg/php/enduser/std_adp.php?p_faqid=5357
> "(drive has been validated to 1 million load/unload cycles without issue)"
> 
> Im already at 781014 load cycles, yet the drive is only about 7 months 
> old. Doing the math, I am getting a load/unload cycle about every 24.5 
> seconds
> Another 2 months and I will be knocking on for 1 million load/unload 
> cycles....
> 
> As DES has already said, for most people the extra load/unload cycles 
> when rebooting a computer will not be an issue at all and is far more 
> desirable than an emergency park when powering down

FreeBSD frequently accesses hard disks (log files, flushing dirty
memory pages every 30s,...) and laptop drives tend to have aggressive
power saving settings by default. That's why your load cycle is so high.

To deal with this you should consider installing sysutils/ataidle and
adding these lines to /etc/rc.conf:

ataidle_enable="YES"
ataidle_devices="ad0"
ataidle_ad0="-P 0"

An alternative is to use atacontrol(8).

If you don't mind the spin down when rebooting you can solve the
emergency park at shutdown with a simple patch like this:

--- sys/dev/ata/ata-disk.c
+++ sys/dev/ata/ata-disk.c
@@ -193,6 +193,8 @@
 
     if (atadev->param.support.command2 & ATA_SUPPORT_FLUSHCACHE)
         ata_controlcmd(dev, ATA_FLUSHCACHE, 0, 0, 0);
+    if (atadev->param.support.command1 & ATA_SUPPORT_POWERMGT)
+        ata_controlcmd(dev, ATA_STANDBY_IMMEDIATE, 0, 0, 0);
     return 0;
 }
 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 228 bytes
Desc: This is a digitally signed message part.
Url : http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20101022/f941c8e8/attachment.pgp


More information about the freebsd-hackers mailing list