linux - How to set the spin down timeout on WD Green HDDs

07
2014-07
  • ManuelSchneid3r

    My internal WD20EARS disk does not spin down autoamtically. I tried hdparm -S 1 (5 seconds), but nothing happens. I disabled the IntelliPower headparking with wdidle3 from the Ultimate Boot CD. hdparm -y spins down the disk.

    Setup is Archlinux on a i5-4590 CPU with a MSI B85I motherboard (UEFI). The HDD is not the system disk. AHCI is set in UEFI. I followed journalctl -f | grep /dev/sdb, the disk is not used somehow.

    Are there any possibilities to enable the automatic spindown?

    smartctl -a output:

    smartctl 6.2 2013-07-26 r3841 [x86_64-linux-3.15.1-1-ARCH] (local build)
    Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org
    
    === START OF INFORMATION SECTION ===
    Model Family:     Western Digital Caviar Green (AF)
    Device Model:     WDC WD20EARS-00J2GB0
    Serial Number:    WD-WCAYY0226656
    LU WWN Device Id: 5 0014ee 25a25795a
    Firmware Version: 80.00A80
    User Capacity:    2.000.398.934.016 bytes [2,00 TB]
    Sector Size:      512 bytes logical/physical
    Device is:        In smartctl database [for details use: -P show]
    ATA Version is:   ATA8-ACS (minor revision not indicated)
    SATA Version is:  SATA 2.6, 3.0 Gb/s
    Local Time is:    Sat Jun 21 15:04:37 2014 CEST
    SMART support is: Available - device has SMART capability.
    SMART support is: Enabled
    
    === START OF READ SMART DATA SECTION ===
    SMART overall-health self-assessment test result: PASSED
    
    General SMART Values:
    Offline data collection status:  (0x84) Offline data collection activity
                                            was suspended by an interrupting command from host.
                                            Auto Offline Data Collection: Enabled.
    Self-test execution status:      (   0) The previous self-test routine completed
                                            without error or no self-test has ever
                                            been run.
    Total time to complete Offline
    data collection:                (38760) seconds.
    Offline data collection
    capabilities:                    (0x7b) SMART execute Offline immediate.
                                            Auto Offline data collection on/off support.
                                            Suspend Offline collection upon new
                                            command.
                                            Offline surface scan supported.
                                            Self-test supported.
                                            Conveyance Self-test supported.
                                            Selective Self-test supported.
    SMART capabilities:            (0x0003) Saves SMART data before entering
                                            power-saving mode.
                                            Supports SMART auto save timer.
    Error logging capability:        (0x01) Error logging supported.
                                            General Purpose Logging supported.
    Short self-test routine
    recommended polling time:        (   2) minutes.
    Extended self-test routine
    recommended polling time:        ( 442) minutes.
    Conveyance self-test routine
    recommended polling time:        (   5) minutes.
    SCT capabilities:              (0x3031) SCT Status supported.
                                            SCT Feature Control supported.
                                            SCT Data Table supported.
    
    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   196   161   021    Pre-fail  Always       -       7175
      4 Start_Stop_Count        0x0032   099   099   000    Old_age   Always       -       1441
      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   094   094   000    Old_age   Always       -       4723
     10 Spin_Retry_Count        0x0032   100   100   000    Old_age   Always       -       0
     11 Calibration_Retry_Count 0x0032   100   100   000    Old_age   Always       -       0
     12 Power_Cycle_Count       0x0032   100   100   000    Old_age   Always       -       911
    192 Power-Off_Retract_Count 0x0032   200   200   000    Old_age   Always       -       245
    193 Load_Cycle_Count        0x0032   176   176   000    Old_age   Always       -       74456
    194 Temperature_Celsius     0x0022   110   094   000    Old_age   Always       -       42
    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
    
    SMART Error Log Version: 1
    No Errors Logged
    
    SMART Self-test log structure revision number 1
    Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error
    # 1  Extended offline    Completed without error       00%      4187         -
    
    SMART Selective self-test log data structure revision number 1
     SPAN  MIN_LBA  MAX_LBA  CURRENT_TEST_STATUS
        1        0        0  Not_testing
        2        0        0  Not_testing
        3        0        0  Not_testing
        4        0        0  Not_testing
        5        0        0  Not_testing
    Selective self-test flags (0x0):
      After scanning selected spans, do NOT read-scan remainder of disk.
    If Selective self-test is pending on power-up, resume after 0 minute delay.
    
  • Answers
  • Seasoned Advice (cooking)

    This HDD for some reason interprets hdparm -S setting differently than expected.

    Normally if you specify hdparm -S value in 1-240 range, it results in 5s times the value spindown timeout. There is no guarantee though that it will work exactly same way for all HDDs and WD20EARS happens to be one of the exceptions.

    I was able to make it spindown in 10min by specifying hdparm -S 3. I found the fix in this post.


  • Related Question

    hard drive - Diagnosing Windows / HDD / RAID0 failure
  • user54361

    My machine is as follows:

    • Pair of hard disks in RAID0, ATA Hitachi HDT72505
    • nVidia motherboard, "M51"?

    Windows XP refused to boot:

    • Booting normally results in hanging during the Windows loading screen
    • Booting in safe mode, it is able to reach the login screen. Logging in results in hanging.

    Using the Windows XP installation CD:

    • Does not detect any of the hard disks
    • If an external HD is plugged in, then the CD will mount that HD while using the Recovery Console

    Luckily, I have a DVD of Kubuntu 9.10.

    fdisk -l shows this output:

    Disk /dev/sda: 500.1 GB, 500107862016 bytes
    255 heads, 63 sectors/track, 60801 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Disk identifier: 0xc0cfc0cf
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1   *           1       60801   488384001    7  HPFS/NTFS
    
    Disk /dev/sdb: 500.1 GB, 500107862016 bytes
    255 heads, 63 sectors/track, 60801 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Disk identifier: 0xfff7fff7
    
       Device Boot      Start         End      Blocks   Id  System
    Note: sector size is 4096 (not 512)
    

    Note that there is no device shown under /dev/sdb. Kubuntu did not automatically mount the hard disk.

    Trying to do: mount -t ntfs-3g /dev/sda1 /mnt/windows results in mount complaining that ntfs-3g: Failed to access volume '/dev/sda1': No such file or directory

    The Kubuntu installer cannot determine how much of the hard disk is used by the NTFS partition, either.

    I am currently running: smartctl --test=long /dev/sda but am not sure what the output will mean

    Update:

    This is the output of dmraid -ay -vvvv -dddd

    WARN: locking /var/lock/dmraid/.lock 
    ERROR: unsupported sector size 4096 on /dev/sdc.
    NOTICE: skipping removable device /dev/sdd      
    NOTICE: skipping removable device /dev/sde      
    NOTICE: skipping removable device /dev/sdf      
    NOTICE: skipping removable device /dev/sdg      
    NOTICE: /dev/sdh: asr     discovering           
    NOTICE: /dev/sdh: ddf1    discovering           
    NOTICE: /dev/sdh: hpt37x  discovering           
    NOTICE: /dev/sdh: hpt45x  discovering           
    NOTICE: /dev/sdh: isw     discovering           
    DEBUG: not isw at -522494976                    
    DEBUG: isw trying hard coded -2115 offset.
    DEBUG: not isw at -523576832
    NOTICE: /dev/sdh: jmicron discovering
    NOTICE: /dev/sdh: lsi     discovering
    NOTICE: /dev/sdh: nvidia  discovering
    NOTICE: /dev/sdh: pdc     discovering
    NOTICE: /dev/sdh: sil     discovering
    NOTICE: /dev/sdh: via     discovering
    NOTICE: /dev/sdb: asr     discovering
    NOTICE: /dev/sdb: ddf1    discovering
    NOTICE: /dev/sdb: hpt37x  discovering
    NOTICE: /dev/sdb: hpt45x  discovering
    NOTICE: /dev/sdb: isw     discovering
    DEBUG: not isw at 1891654656
    DEBUG: isw trying hard coded -2115 offset.
    DEBUG: not isw at 1890572800
    NOTICE: /dev/sdb: jmicron discovering
    NOTICE: /dev/sdb: lsi     discovering
    NOTICE: /dev/sdb: nvidia  discovering
    NOTICE: /dev/sdb: nvidia metadata discovered
    NOTICE: /dev/sdb: pdc     discovering
    NOTICE: /dev/sdb: sil     discovering
    NOTICE: /dev/sdb: via     discovering
    NOTICE: /dev/sda: asr     discovering
    NOTICE: /dev/sda: ddf1    discovering
    NOTICE: /dev/sda: hpt37x  discovering
    NOTICE: /dev/sda: hpt45x  discovering
    NOTICE: /dev/sda: isw     discovering
    DEBUG: not isw at 1891654656
    DEBUG: isw trying hard coded -2115 offset.
    DEBUG: not isw at 1890572800
    NOTICE: /dev/sda: jmicron discovering
    NOTICE: /dev/sda: lsi     discovering
    NOTICE: /dev/sda: nvidia  discovering
    NOTICE: /dev/sda: nvidia metadata discovered
    NOTICE: /dev/sda: pdc     discovering
    NOTICE: /dev/sda: sil     discovering
    NOTICE: /dev/sda: via     discovering
    DEBUG: _find_set: searching nvidia_ijdbffag
    DEBUG: _find_set: not found nvidia_ijdbffag
    DEBUG: _find_set: searching nvidia_ijdbffag
    DEBUG: _find_set: not found nvidia_ijdbffag
    NOTICE: added /dev/sdb to RAID set "nvidia_ijdbffag"
    DEBUG: _find_set: searching nvidia_dacifgcg
    DEBUG: _find_set: searching nvidia_dacifgcg
    DEBUG: _find_set: not found nvidia_dacifgcg
    DEBUG: _find_set: not found nvidia_dacifgcg
    DEBUG: _find_set: searching nvidia_dacifgcg
    DEBUG: _find_set: not found nvidia_dacifgcg
    NOTICE: added /dev/sda to RAID set "nvidia_dacifgcg"
    DEBUG: checking nvidia device "/dev/sdb"
    DEBUG: set status of set "nvidia_ijdbffag" to 16
    DEBUG: checking nvidia device "/dev/sda"
    DEBUG: set status of set "nvidia_dacifgcg" to 16
    RAID set "nvidia_ijdbffag" already active
    INFO: Activating linear raid set "nvidia_ijdbffag"
    RAID set "nvidia_dacifgcg" already active
    INFO: Activating linear raid set "nvidia_dacifgcg"
    NOTICE: discovering partitions on "nvidia_ijdbffag"
    NOTICE: /dev/mapper/nvidia_ijdbffag: dos     discovering
    NOTICE: /dev/mapper/nvidia_ijdbffag: dos metadata discovered
    NOTICE: created partitioned RAID set(s) for /dev/mapper/nvidia_ijdbffag
    NOTICE: discovering partitions on "nvidia_dacifgcg"
    NOTICE: /dev/mapper/nvidia_dacifgcg: dos     discovering
    NOTICE: /dev/mapper/nvidia_dacifgcg: dos metadata discovered
    DEBUG: _find_set: searching nvidia_dacifgcg1
    DEBUG: _find_set: not found nvidia_dacifgcg1
    NOTICE: created partitioned RAID set(s) for /dev/mapper/nvidia_dacifgcg
    RAID set "nvidia_dacifgcg1" already active
    INFO: Activating partition raid set "nvidia_dacifgcg1"
    WARN: unlocking /var/lock/dmraid/.lock
    DEBUG: freeing devices of RAID set "nvidia_ijdbffag"
    DEBUG: freeing device "nvidia_ijdbffag", path "/dev/sdb"
    DEBUG: freeing devices of RAID set "nvidia_dacifgcg"
    DEBUG: freeing device "nvidia_dacifgcg", path "/dev/sda"
    DEBUG: freeing devices of RAID set "nvidia_dacifgcg1"
    DEBUG: freeing device "nvidia_dacifgcg1", path "/dev/mapper/nvidia_dacifgcg"
    

    This is the output of dmraid -r

    /dev/sdb: nvidia, "nvidia_ijdbffag", linear, ok, 976773166 sectors, data@ 0
    /dev/sda: nvidia, "nvidia_dacifgcg", linear, ok, 976773166 sectors, data@ 0
    

    This is the output of smartctl -a /dev/sda

    smartctl version 5.38 [i686-pc-linux-gnu] Copyright (C) 2002-8 Bruce Allen
    Home page is http://smartmontools.sourceforge.net/                        
    
    Smartctl open device: /dev/sda1 failed: No such file or directory
    root@ubuntu:~# smartctl --all /dev/sda
    smartctl version 5.38 [i686-pc-linux-gnu] Copyright (C) 2002-8 Bruce Allen
    Home page is http://smartmontools.sourceforge.net/                        
    
    === START OF INFORMATION SECTION ===
    Model Family:     Hitachi Deskstar T7K500
    Device Model:     Hitachi HDT725050VLA360
    Serial Number:    VFK401R424LAJK         
    Firmware Version: V56OA7EA               
    User Capacity:    500,107,862,016 bytes  
    Device is:        In smartctl database [for details use: -P show]
    ATA Version is:   7                                              
    ATA Standard is:  ATA/ATAPI-7 T13 1532D revision 1               
    Local Time is:    Tue Nov  2 02:39:57 2010 UTC                   
    SMART support is: Available - device has SMART capability.
    SMART support is: Enabled
    
    === START OF READ SMART DATA SECTION ===
    SMART overall-health self-assessment test result: FAILED!
    Drive failure expected in less than 24 hours. SAVE ALL DATA.
    See vendor-specific Attribute list for failed Attributes.
    
    General SMART Values:
    Offline data collection status:  (0x00) Offline data collection activity
                                            was never started.
                                            Auto Offline Data Collection: Disabled.
    Self-test execution status:      ( 117) The previous self-test completed having
                                            the read element of the test failed.
    Total time to complete Offline
    data collection:                 (8389) seconds.
    Offline data collection
    capabilities:                    (0x5b) SMART execute Offline immediate.
                                            Auto Offline data collection on/off support.
                                            Suspend Offline collection upon new
                                            command.
                                            Offline surface scan supported.
                                            Self-test supported.
                                            No Conveyance Self-test supported.
                                            Selective Self-test supported.
    SMART capabilities:            (0x0003) Saves SMART data before entering
                                            power-saving mode.
                                            Supports SMART auto save timer.
    Error logging capability:        (0x01) Error logging supported.
                                            General Purpose Logging supported.
    Short self-test routine
    recommended polling time:        (   1) minutes.
    Extended self-test routine
    recommended polling time:        ( 140) minutes.
    SCT capabilities:              (0x003f) SCT Status supported.
                                            SCT Feature Control supported.
                                            SCT Data Table supported.
    
    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     0x000b   097   097   016    Pre-fail  Always       -       196612
      2 Throughput_Performance  0x0005   100   100   050    Pre-fail  Offline      -       0
      3 Spin_Up_Time            0x0007   137   137   024    Pre-fail  Always       -       287 (Average 441)
      4 Start_Stop_Count        0x0012   100   100   000    Old_age   Always       -       1086
      5 Reallocated_Sector_Ct   0x0033   001   001   005    Pre-fail  Always   FAILING_NOW 1885
      7 Seek_Error_Rate         0x000b   099   099   067    Pre-fail  Always       -       1
      8 Seek_Time_Performance   0x0005   100   100   020    Pre-fail  Offline      -       0
      9 Power_On_Hours          0x0012   099   099   000    Old_age   Always       -       12937
     10 Spin_Retry_Count        0x0013   100   100   060    Pre-fail  Always       -       0
     12 Power_Cycle_Count       0x0032   100   100   000    Old_age   Always       -       1075
    192 Power-Off_Retract_Count 0x0032   099   099   000    Old_age   Always       -       1797
    193 Load_Cycle_Count        0x0012   099   099   000    Old_age   Always       -       1797
    194 Temperature_Celsius     0x0002   187   187   000    Old_age   Always       -       32 (Lifetime Min/Max 18/43)
    196 Reallocated_Event_Count 0x0032   100   100   000    Old_age   Always       -       2120
    197 Current_Pending_Sector  0x0022   100   100   000    Old_age   Always       -       2
    198 Offline_Uncorrectable   0x0008   100   100   000    Old_age   Offline      -       0
    199 UDMA_CRC_Error_Count    0x000a   200   253   000    Old_age   Always       -       0
    
    SMART Error Log Version: 1
    No Errors Logged
    
    SMART Self-test log structure revision number 1
    Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error
    # 1  Extended offline    Completed: read failure       50%     12937         621063894
    
    SMART Selective self-test log data structure revision number 1
     SPAN  MIN_LBA  MAX_LBA  CURRENT_TEST_STATUS
        1        0        0  Not_testing
        2        0        0  Not_testing
        3        0        0  Not_testing
        4        0        0  Not_testing
        5        0        0  Not_testing
    Selective self-test flags (0x0):
      After scanning selected spans, do NOT read-scan remainder of disk.
    If Selective self-test is pending on power-up, resume after 0 minute delay.
    

    This is the output of smartctl -a /dev/sdb

    smartctl version 5.38 [i686-pc-linux-gnu] Copyright (C) 2002-8 Bruce Allen
    Home page is http://smartmontools.sourceforge.net/                        
    
    === START OF INFORMATION SECTION ===
    Device Model:     Hitachi HDP725050GLA360
    Serial Number:    GEB531RE00M21B         
    Firmware Version: GM4OA50E               
    User Capacity:    500,107,862,016 bytes  
    Device is:        Not in smartctl database [for details use: -P showall]
    ATA Version is:   8                                                     
    ATA Standard is:  ATA-8-ACS revision 4                                  
    Local Time is:    Tue Nov  2 02:41:11 2010 UTC
    SMART support is: Available - device has SMART capability.
    SMART support is: Enabled
    
    === START OF READ SMART DATA SECTION ===
    SMART overall-health self-assessment test result: PASSED
    
    General SMART Values:
    Offline data collection status:  (0x80) Offline data collection activity
                                            was never started.
                                            Auto Offline Data Collection: Enabled.
    Self-test execution status:      (   0) The previous self-test routine completed
                                            without error or no self-test has ever
                                            been run.
    Total time to complete Offline
    data collection:                 (7854) seconds.
    Offline data collection
    capabilities:                    (0x5b) SMART execute Offline immediate.
                                            Auto Offline data collection on/off support.
                                            Suspend Offline collection upon new
                                            command.
                                            Offline surface scan supported.
                                            Self-test supported.
                                            No Conveyance Self-test supported.
                                            Selective Self-test supported.
    SMART capabilities:            (0x0003) Saves SMART data before entering
                                            power-saving mode.
                                            Supports SMART auto save timer.
    Error logging capability:        (0x01) Error logging supported.
                                            General Purpose Logging supported.
    Short self-test routine
    recommended polling time:        (   1) minutes.
    Extended self-test routine
    recommended polling time:        ( 131) minutes.
    SCT capabilities:              (0x003d) SCT Status supported.
                                            SCT Feature Control supported.
                                            SCT Data Table supported.
    
    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     0x000b   100   100   016    Pre-fail  Always       -       0
      2 Throughput_Performance  0x0005   131   131   054    Pre-fail  Offline      -       147
      3 Spin_Up_Time            0x0007   161   161   024    Pre-fail  Always       -       222 (Average 256)
      4 Start_Stop_Count        0x0012   100   100   000    Old_age   Always       -       1011
      5 Reallocated_Sector_Ct   0x0033   100   100   005    Pre-fail  Always       -       0
      7 Seek_Error_Rate         0x000b   100   100   067    Pre-fail  Always       -       0
      8 Seek_Time_Performance   0x0005   131   131   020    Pre-fail  Offline      -       29
      9 Power_On_Hours          0x0012   099   099   000    Old_age   Always       -       12930
     10 Spin_Retry_Count        0x0013   100   100   060    Pre-fail  Always       -       0
     12 Power_Cycle_Count       0x0032   100   100   000    Old_age   Always       -       1008
    192 Power-Off_Retract_Count 0x0032   099   099   000    Old_age   Always       -       1747
    193 Load_Cycle_Count        0x0012   099   099   000    Old_age   Always       -       1747
    194 Temperature_Celsius     0x0002   214   214   000    Old_age   Always       -       28 (Lifetime Min/Max 17/39)
    196 Reallocated_Event_Count 0x0032   100   100   000    Old_age   Always       -       0
    197 Current_Pending_Sector  0x0022   100   100   000    Old_age   Always       -       0
    198 Offline_Uncorrectable   0x0008   100   100   000    Old_age   Offline      -       0
    199 UDMA_CRC_Error_Count    0x000a   200   200   000    Old_age   Always       -       0
    
    SMART Error Log Version: 1
    No Errors Logged
    
    SMART Self-test log structure revision number 1
    No self-tests have been logged.  [To run self-tests, use: smartctl -t]
    
    
    SMART Selective self-test log data structure revision number 1
     SPAN  MIN_LBA  MAX_LBA  CURRENT_TEST_STATUS
        1        0        0  Not_testing
        2        0        0  Not_testing
        3        0        0  Not_testing
        4        0        0  Not_testing
        5        0        0  Not_testing
    Selective self-test flags (0x0):
      After scanning selected spans, do NOT read-scan remainder of disk.
    If Selective self-test is pending on power-up, resume after 0 minute delay.
    

  • Related Answers
  • Moab

    Being able to almost login to windowsXP does not sound like a failed drive in a raid0. When I have seen failed raid0 arrays there is no booting (hardware).

    For the liveCD of Kubuntu, the proper driver (module) is not being loaded for the raid0 and Kubuntu is trying to read sda and sdb as separate drives. Sda is "working" since it has a MBR and sdb is failing since it does not. Your not able to mount /dev/sda1 since half of the data for your NTFS volume is on sdb which, is not being read.

    How is the Raid0 being done? (software or hardware)

  • psusi

    Clearly one of the drives is failing. You can't mount just one of the drives since it only contains part of the data; you have to mount the whole array, which is /dev/mapper/nvidia_ijdbffag1.