You are not logged in.

#1 2022-11-18 09:46:01

faded.solivagant
Member
Registered: 2022-11-18
Posts: 15

Laptop HDD standby after 10s, for any hdparm -S and -B value below 127

Hi.
Today I noticed my Hard Disk APM level is set to 1 by default It can make it wear out after some time! So I want to change it to a higher value. Something like 30min. Whenever I start my laptop, it's the output of 

$ sudo hdparm -B /dev/sda
/dev/sda:
 APM_level      = 1

It keep reseting to 1!
So I tried to change the values, but for every -B below 128, Disk goes to standby after 10 seconds

$ sudo hdparm -B 127 -S 180 /dev/sda
$ sudo hdparm -B 127 -S 0 /dev/sda

By this value, it goes to standby after 5 minutes

$ sudo hdparm -B 127 -S 1 /dev/sda

and for every -B value 128 and above, disk never goes to standby!
(I check it with

$ sudo hdparm -C /dev/sda

)

What is this weird behavior?! It seems APM has only two values, 10s or never!!

Last edited by faded.solivagant (2022-11-18 09:59:39)

Offline

#2 2022-11-18 09:50:29

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,206

Re: Laptop HDD standby after 10s, for any hdparm -S and -B value below 127

How this is implemented in your actual harddisk will be relevant, so which actual disk is this? And yes this can very much be the case.

Offline

#3 2022-11-18 09:53:37

faded.solivagant
Member
Registered: 2022-11-18
Posts: 15

Re: Laptop HDD standby after 10s, for any hdparm -S and -B value below 127

This is the full information of my HDD (after setting  -B 127 -S 180):

$ sudo hdparm -I /dev/sda

/dev/sda:

ATA device, with non-removable media
        Model Number:       TOSHIBA MQ04ABF100                      
        Serial Number:      58QAPWL2T
        Firmware Revision:  JU000J  
        Transport:          Serial, ATA8-AST, SATA 1.0a, SATA II Extensions, SATA Rev 2.5, SATA Rev 2.6, SATA Rev 3.0
Standards:
        Used: unknown (minor revision code 0x006d) 
        Supported: 10 9 8 7 6 5 
        Likely used: 10
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:  1953525168
        Logical  Sector size:                   512 bytes
        Physical Sector size:                  4096 bytes
        Logical Sector-0 offset:                  0 bytes
        device size with M = 1024*1024:      953869 MBytes
        device size with M = 1000*1000:     1000204 MBytes (1000 GB)
        cache/buffer size  = unknown
        Form Factor: 2.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 = 16
        Advanced power management level: 127
        DMA: sdma0 sdma1 sdma2 mdma0 mdma1 mdma2 udma0 udma1 udma2 udma3 udma4 *udma5 
             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
           *    General Purpose Logging feature set
           *    WRITE_{DMA|MULTIPLE}_FUA_EXT
           *    64-bit World wide name
           *    IDLE_IMMEDIATE with UNLOAD
                Write-Read-Verify feature set
           *    WRITE_UNCORRECTABLE_EXT command
           *    {READ,WRITE}_DMA_EXT_GPL commands
           *    Segmented DOWNLOAD_MICROCODE
           *    unknown 119[6]
                unknown 119[9]
           *    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
           *    Idle-Unload when NCQ is active
           *    Host automatic Partial to Slumber transitions
           *    Device automatic Partial to Slumber transitions
           *    READ_LOG_DMA_EXT equivalent to READ_LOG_EXT
           *    DMA Setup Auto-Activate optimization
           *    Device-initiated interface power management
           *    Software settings preservation
           *    SMART Command Transport (SCT) feature set
           *    SCT Write Same (AC2)
           *    SCT Error Recovery Control (AC3)
           *    SCT Features Control (AC4)
           *    SCT Data Tables (AC5)
           *    SANITIZE_ANTIFREEZE_LOCK_EXT command
           *    SANITIZE feature set
           *    OVERWRITE_EXT command
           *    reserved 69[1]
           *    Extended number of user addressable sectors 
           *    DOWNLOAD MICROCODE DMA command
Security: 
        Master password revision code = 65534
                supported
        not     enabled
        not     locked
                frozen
        not     expired: security count
                supported: enhanced erase
        186min for SECURITY ERASE UNIT. 186min for ENHANCED SECURITY ERASE UNIT.
Logical Unit WWN Device Identifier: 5000039882607e16
        NAA             : 5
        IEEE OUI        : 000039
        Unique ID       : 882607e16
Checksum: correct

Last edited by faded.solivagant (2022-11-18 09:55:13)

Offline

#4 2022-11-18 09:56:44

d.ALT
Member
Registered: 2019-05-10
Posts: 959

Re: Laptop HDD standby after 10s, for any hdparm -S and -B value below 127

Go with this:

# hdparm -S 1 /dev/sda

<49,17,III,I>    Fama di loro il mondo esser non lassa;
<50,17,III,I>    misericordia e giustizia li sdegna:
<51,17,III,I>    non ragioniam di lor, ma guarda e passa.

Offline

#5 2022-11-18 09:58:14

faded.solivagant
Member
Registered: 2022-11-18
Posts: 15

Re: Laptop HDD standby after 10s, for any hdparm -S and -B value below 127

d.ALT wrote:

Go with this:

# hdparm -S 1 /dev/sda

It makes my disk goes to standby after 5s. I want it to go to standby after 30 minutes or so.

Offline

#6 2022-11-18 09:59:59

d.ALT
Member
Registered: 2019-05-10
Posts: 959

Re: Laptop HDD standby after 10s, for any hdparm -S and -B value below 127

faded.solivagant wrote:
d.ALT wrote:

Go with this:

# hdparm -S 1 /dev/sda

It makes my disk goes to standby after 5s. I want it to go to standby after 30 minutes or so.

Yes, it's working.

Values from 1 to 240 specify multiples of 5 seconds, yielding timeouts from 5 seconds to 20 minutes.
Values from 241 to 251 specify from 1 to 11 units of 30 minutes, yielding timeouts from 30 minutes to 5.5 hours.
A value of 252 signifies a timeout of 21 minutes.
A value of 253 sets a vendor-defined timeout period between 8 and 12 hours, and the value 254 is reserved.
255 is interpreted as 21 minutes plus 15 seconds.
Note that some older drives may have very different interpretations of these values.

(https://www.man7.org/linux/man-pages/man8/hdparm.8.html)

Last edited by d.ALT (2022-11-18 10:02:04)


<49,17,III,I>    Fama di loro il mondo esser non lassa;
<50,17,III,I>    misericordia e giustizia li sdegna:
<51,17,III,I>    non ragioniam di lor, ma guarda e passa.

Offline

#7 2022-11-18 10:12:48

faded.solivagant
Member
Registered: 2022-11-18
Posts: 15

Re: Laptop HDD standby after 10s, for any hdparm -S and -B value below 127

d.ALT wrote:
faded.solivagant wrote:
d.ALT wrote:

Go with this:

# hdparm -S 1 /dev/sda

It makes my disk goes to standby after 5s. I want it to go to standby after 30 minutes or so.

Yes, it's working.

Yes, this one seems working. But for higher value, it goes to standby in 10s regardless to it.

Offline

#8 2022-11-18 10:30:24

d.ALT
Member
Registered: 2019-05-10
Posts: 959

Re: Laptop HDD standby after 10s, for any hdparm -S and -B value below 127

Try adding udev rule and then poweroff (NOT reboot).

/etc/udev/rules.d/69-hdparm.rules

ACTION=="add", SUBSYSTEM=="block", KERNEL=="sda", RUN+="/usr/bin/hdparm -S 241 /dev/sda"

<49,17,III,I>    Fama di loro il mondo esser non lassa;
<50,17,III,I>    misericordia e giustizia li sdegna:
<51,17,III,I>    non ragioniam di lor, ma guarda e passa.

Offline

#9 2022-11-18 13:27:36

faded.solivagant
Member
Registered: 2022-11-18
Posts: 15

Re: Laptop HDD standby after 10s, for any hdparm -S and -B value below 127

No, that udev rule didn't help, too.

I think I've investigated the problem. Based on This post , and also as This discussion says:

Only when I set -B to 128 is the -S value respected.

It seems for every -B value 127 and below, it's considered 10s and for every value 128 and above, it's considered never! (or maybe a long time)
So almost only for -B higher than 128, spindown/standby time can be modified by -S.
I'm not sure where the problem is, but sounds mine and some disks are working like this.

Offline

Board footer

Powered by FluxBB