How to determine disc spindown time

21,815

Solution 1

There does not seem to be a way to query that value with hdparm, however you can see if the drive is in a standby or active state...

> sudo hdparm -C /dev/sdb

/dev/sdb:
 drive state is:  standby

> sudo hdparm -C /dev/sda

/dev/sda:
 drive state is:  active/idle

Solution 2

The option -B 128 inhibits spindown, so your -S option is useless. Have a look at man hdparm. Spindown is only possible with -B parameters of 127 and less.

Solution 3

If you have a Seagate disk which support Extended Power Controls (EPC), I assume mostly enterprise class, you can use the tool SeaChest
First get the Seagate disk handle:

 SeaChest_PowerControl -v 0 --scan --scanFlags sgtosd

Result:

 Vendor   Handle       Model Number            Serial      Number          FwRev
 ATA      sg0<->sda    ST1000LM049-2GH172      WN90H8BT               SDM1
 ATA      sg1<->sdb    ST1000LM049-2GH172      WN90HACK               SDM1
 ATA      sg2<->sdc    ST1000LM049-2GH172      WGS3M35X               SDM1
 ATA      sg3<->sdd    ST1000LM049-2GH172      WGS65M4X               SDM1
 ATA      sg4<->sde    ST1000NX0303            S470WNPT               NN02
 NVMe     /dev/nvme0n1 Force MP510             184282050001276960F1   ECFM11.0

Then get the standby time:

 SeaChest_PowerControl -v 0 -d /dev/sg4 --showEPCSettings

Result:

 ===EPC Settings===
    * = timer is enabled
    C column = Changeable
    S column = Saveable
    All times are in 100 milliseconds

 Name       Current Timer Default Timer Saved Timer   Recovery Time C S
 Idle A     *200          *10           *200          150           Y Y
 Idle B      1200         *2400          1200         650           Y Y
 Idle C      1300          6000          1300         4000          Y Y
 Standby Z  *1200          36000        *1200         15000         Y Y

(Don't mind my experimental Idle_C and Standby_Z values which is very low)

You can get the tool from Seagate

The above example is from a Seagate Enterprise Capacity 2.5" 1TB SATA (ST1000NX0343). Tried the same on a Seagate BarraCuda Pro 2.5" 1TB SATA (ST1000LM049) and it didn't work, as it apparently doesn't support EPC.

Share:
21,815

Related videos on Youtube

lzap
Author by

lzap

Red Hat Satellite group

Updated on September 18, 2022

Comments

  • lzap
    lzap almost 2 years

    I am able to set both APM and spindown times using the command:

    hdparm -S 246 -B 128 /dev/sda
    

    Unfortunately I can only find the APM value in the information output:

    hdparm -I /dev/sda | grep Advanced
    

    How can I see the spindown time value? I suspect my disc it is ignoring my value. I would like to see it. Tried smartctl but with no luck, help.

    Update: It turned out tuned is very aggressive. When I turned it down, my discs does not spin down. It was setting something there.

  • Benjamin Peter
    Benjamin Peter about 8 years
    Yes. But additionally on my Samsung drive "-B 127" did a spin down before the with -S configured time of 15 minutes. This means you might want to set it even higher to allow the spin down time setting to work. I also found this information here askubuntu.com/a/733242/397064 which suggest a setting of "-B 150" which works for me too. The disc will then spin down after the specified time.
  • 比尔盖子
    比尔盖子 over 3 years
    This answer is wrong. The Standby timer (-S) and APM (-B) can coexist. Even if APM is 128, the Standby timer may still spin down the HDD. For more information, please read the actual technical standard, ATA/ATAPI Command Set - 2 (ACS-2), see page 19, "If both APM and the Standby timer are set, then the device shall go to the Standby state when the timer expires or the device’s APM algorithm indicates that the Standby state should be entered."
  • 比尔盖子
    比尔盖子 over 3 years
    @BenjaminPeter You're totally right.