1

I have an external WD 8TB hard drive connected to my Dell Wyse 5070 via USB 3.0. Recently I've done a full Ubuntu Server reinstall (on internal SSD). Now when I'm trying to configure everything as I previously had I'm struggling with the external HDD standby time setup.

Previously I configured it somehow so the HDD went standby about 15 minutes after no activity detected.

Right now I'm not able to setup it in a similar manner. For example sudo hdparm -S 5 /dev/sdb has no effect after 25 seconds. Hence, the hard drive is active all the time and never goes standby.

sudo hdparm -I /dev/sdb gives

ATA device, with non-removable media
        Model Number:       WDC WD80EDAZ-11TA3A0
        Serial Number:      VG00T1YG
        Firmware Revision:  81.00A81
        Transport:          Serial, ATA8-AST, SATA 1.0a, SATA II Extensions, SATA Rev 2.5, SATA Rev 2.6, SATA Rev 3.0; Revision: ATA8-AST T13 Project D1697 Revision 0b
Standards:
        Used: unknown (minor revision code 0x0029)
        Supported: 9 8 7 6 5
        Likely used: 9
Configuration:
        Logical         max     current
        cylinders       16383   16383
        heads           16      16
        sectors/track   63      63
        --
        CHS current addressable sectors:    16514064
        LBA    user addressable sectors:   268435455
        LBA48  user addressable sectors: 15628053168
        Logical  Sector size:                   512 bytes [ Supported: 4096 4160 4224 512 520 528 ]
        Physical Sector size:                  4096 bytes
        Logical Sector-0 offset:                  0 bytes
        device size with M = 1024*1024:     7630885 MBytes
        device size with M = 1000*1000:     8001563 MBytes (8001 GB)
        cache/buffer size  = unknown
        Form Factor: 3.5 inch
        Nominal Media Rotation Rate: 5400
Capabilities:
        LBA, IORDY(can be disabled)
        Queue depth: 32
        Standby timer values: spec'd by Standard, no device specific minimum
        R/W multiple sector transfer: Max = 16  Current = 0
        Advanced power management level: disabled
        DMA: mdma0 mdma1 mdma2 udma0 udma1 udma2 udma3 udma4 udma5 *udma6
             Cycle time: min=120ns recommended=120ns
        PIO: pio0 pio1 pio2 pio3 pio4
             Cycle time: no flow control=120ns  IORDY flow control=120ns
Commands/features:
        Enabled Supported:
           *    SMART feature set
                Security Mode feature set
           *    Power Management feature set
           *    Write cache
           *    Look-ahead
           *    Host Protected Area feature set
           *    WRITE_BUFFER command
           *    READ_BUFFER command
           *    NOP cmd
           *    DOWNLOAD_MICROCODE
                Advanced Power Management feature set
                Power-Up In Standby feature set
           *    SET_FEATURES required to spinup after power up
                SET_MAX security extension
           *    48-bit Address feature set
           *    Device Configuration Overlay feature set
           *    Mandatory FLUSH_CACHE
           *    FLUSH_CACHE_EXT
           *    SMART error logging
           *    SMART self-test
           *    Media Card Pass-Through
           *    General Purpose Logging feature set
           *    WRITE_{DMA|MULTIPLE}_FUA_EXT
           *    64-bit World wide name
           *    URG for READ_STREAM[_DMA]_EXT
           *    URG for WRITE_STREAM[_DMA]_EXT
           *    WRITE_UNCORRECTABLE_EXT command
           *    {READ,WRITE}_DMA_EXT_GPL commands
           *    Segmented DOWNLOAD_MICROCODE
                unknown 119[6]
           *    unknown 119[7]
           *    Gen1 signaling speed (1.5Gb/s)
           *    Gen2 signaling speed (3.0Gb/s)
           *    Gen3 signaling speed (6.0Gb/s)
           *    Native Command Queueing (NCQ)
           *    Host-initiated interface power management
           *    Phy event counters
           *    NCQ priority information
           *    READ_LOG_DMA_EXT equivalent to READ_LOG_EXT
                Non-Zero buffer offsets in DMA Setup FIS
                DMA Setup Auto-Activate optimization
                Device-initiated interface power management
                In-order data delivery
           *    Software settings preservation
                unknown 78[7]
                unknown 78[10]
                unknown 78[11]
           *    SMART Command Transport (SCT) feature set
           *    SCT Write Same (AC2)
           *    SCT Error Recovery Control (AC3)
           *    SCT Features Control (AC4)
           *    SCT Data Tables (AC5)
           *    SANITIZE feature set
           *    CRYPTO_SCRAMBLE_EXT command
           *    OVERWRITE_EXT command
           *    reserved 69[3]
           *    reserved 69[4]
           *    DOWNLOAD MICROCODE DMA command
           *    WRITE BUFFER DMA command
           *    READ BUFFER DMA command
Security:
        Master password revision code = 48059
                supported
        not     enabled
        not     locked
        not     frozen
        not     expired: security count
                supported: enhanced erase
        812min for SECURITY ERASE UNIT. 2min for ENHANCED SECURITY ERASE UNIT.
Logical Unit WWN Device Identifier: 5000cca0bfc05a54
        NAA             : 5
        IEEE OUI        : 000cca
        Unique ID       : 0bfc05a54

I can see that Advanced power management level is disabled. Can this be related to the issue?

What's more, sudo hdparm -y /dev/sdb works as expected. It immediately puts the HDD to sleep.

Any ideas how can I investigate it further?

0

1 Answer 1

2

Hopefully your drive will respond to the -B flag in hdparm, which will allow you to enable/disable the power management feature. From the docs:

-B     Get/set  Advanced  Power  Management feature, if the drive supports it. A low value
       means aggressive power management  and  a  high  value  means  better  performance.
       Possible  settings  range  from  values 1 through 127 (which permit spin-down), and
       values 128 through 254 (which do not permit  spin-down).   The  highest  degree  of
       power  management  is attained with a setting of 1, and the highest I/O performance
       with a setting of 254.  A value of 255  tells  hdparm  to  disable  Advanced  Power
       Management  altogether  on the drive (not all drives support disabling it, but most
       do).

You can check your drive's current value like this:

sudo hdparm -B /dev/sdb

Given the output from -I, I would expect the number to be something like 254, which does not allow auto spin-down.

With this in mind, let's set a value between 1 and 127, which Dows allow spin-down:

sudo hdparm -B 127 /dev/sdb

Note: Based on the documentation, a higher number means better performance. As 127 is the highest one can go while still permitting spin-down, this seems the most logical option.

If no error is reported, you may be able to set a 5-minute spin-down like this:

sudo hdparm -S 60 /dev/sdb
3
  • Thank you! Finally I was able to understand the difference between hdparm options. Right now my APM_level is set to 127 as you suggested and standby mode is applied after 10 minutes without any issues. Thanks a lot!
    – rawinek
    Jan 7, 2022 at 17:21
  • I have tried the same, but unfortunately, it did not have any effect. Previously the HDD went to sleep as intended, but since I replaced the ext4 file system with bcache and ext4 on top of it, the disk just won't go to sleep by itself. Manual interference still works as expected.
    – france1
    May 26, 2023 at 14:47
  • The use of bcache will prevent many of the disk sleep operations from becoming active, as a disk cache needs to be available. If the cache latency is too great (due to re-initialisation processes), then the Linux kernel will begin complaining 😕
    – matigo
    May 26, 2023 at 14:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .