Explicit APM values in hdparm-functions cause Load Cycle Count hell

Bug #913050 reported by Macil
36
This bug affects 6 people
Affects Status Importance Assigned to Milestone
hdparm (Ubuntu)
Fix Committed
Undecided
Unassigned

Bug Description

Release: 12.04 (development) maybe 11.10 is affected too?
Hard drive:
Model Family: Seagate Momentus 5400.6
Device Model: ST9250315AS

In recent hdparm version explicit APM values are set in /lib/hdparm/hdparm-functions. "On AC" value = 254, "on battery value" = 127. This causes load cycle hell on my disk drive. Even 128 causes the same thing, so 11.10 seems to be affected too.

Lines in question:

hdparm_options()
{
    local WANTED_DISK="$1"

    local DISC= DEFAULT= DEF_QUIET= COMMAND_LINE=
    # if the below is guaranteed to spawn a subshell, then this next line is
    # unnecessary
    local OPTIONS OPT_QUIET KEY SEP VALUE

    egrep -v '^[[:space:]]*(#|$)' /etc/hdparm.conf |
    {
        # set our default global apm policy here.
        if hdparm_try_apm "$WANTED_DISK"; then
            if hdparm_is_on_battery; then
                hdparm_set_option -B127
            else
                hdparm_set_option -B254
            fi
        fi

There obviously must be some workarounds by setting right values in /etc/hdparm.conf but I can not elaborate any further.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in hdparm (Ubuntu):
status: New → Confirmed
Revision history for this message
Daniel Swarbrick (pressureman) wrote :

My SAMSUNG HM251JJ also suffers this problem.

If hdparm sets -B128, it sticks:

sudo hdparm -B128 /dev/sda

/dev/sda:
 setting Advanced Power Management level to 0x80 (128)
 APM_level = 128

And as per the hdparm manpage, it does not spin down. Ever.

But if it sets -B127, the hard disk assumes a value of 1:

sudo hdparm -B127 /dev/sda

/dev/sda:
 setting Advanced Power Management level to 0x7f (127)
 APM_level = 1

And it starts to spin down a lot more than it should, sometimes even during disk reads!

hdparm -i shows:

/dev/sda:

 Model=SAMSUNG HM251JJ, FwRev=2AA00_00, SerialNo=xxxx
 Config={ HardSect NotMFM HdSw>15uSec Fixed DTR>10Mbs }
 RawCHS=16383/16/63, TrkSize=34902, SectSize=554, ECCbytes=4
 BuffType=DualPortCache, BuffSize=16384kB, MaxMultSect=16, MultSect=16
 CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=488397168
 IORDY=on/off, tPIO={min:120,w/IORDY:120}, tDMA={min:120,rec:120}
 PIO modes: pio0 pio1 pio2 pio3 pio4
 DMA modes: mdma0 mdma1 mdma2
 UDMA modes: udma0 udma1 udma2 udma3 udma4 udma5 *udma6
 AdvancedPM=yes: disabled (255) WriteCache=enabled
 Drive conforms to: ATA/ATAPI-7 T13 1532D revision 0: ATA/ATAPI-1,2,3,4,5,6,7

Revision history for this message
Gerhard Aigner (gerhard-aigner) wrote :

I'm affected by this too (Same Notebook: Thinkpad T500, different HD SAMSUNG HN-M101MBB):

hdparm -B127 /dev/sda
/dev/sda:
 setting Advanced Power Management level to 0x7f (127)
 APM_level = 127

so in my case it sticks to 127, but it spins down way to often (i.e. after a couple of seconds ~30? reading a web page)

hdparm -i /dev/sda

/dev/sda:

 Model=SAMSUNG HN-M101MBB, FwRev=2AR10001, SerialNo=S2R8J9HB908804
 Config={ Fixed }
 RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=4
 BuffType=unknown, BuffSize=8192kB, MaxMultSect=16, MultSect=16
 CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=1953525168
 IORDY=on/off, tPIO={min:120,w/IORDY:120}, tDMA={min:120,rec:120}
 PIO modes: pio0 pio1 pio2 pio3 pio4
 DMA modes: mdma0 mdma1 mdma2
 UDMA modes: udma0 udma1 udma2 udma3 udma4 udma5 *udma6
 AdvancedPM=yes: disabled (255) WriteCache=enabled
 Drive conforms to: unknown: ATA/ATAPI-0,1,2,3,4,5,6,7

Revision history for this message
Najam Safar (najam-s) wrote :

Changing the value to 127 in 12.04 is causing heavy spin downs for me. Everything was fine with me on 11.10 where the battery default setting was 128

Revision history for this message
Jost Menke (jmenke) wrote :

Excessive spindowns here aswell with default value of 127 (FUJITSU MHV2100BH PL). I suggest the following fix which worked for me:

- Change line 82 in /lib/hdparm/hdparm-functions to "hdparm_set_option -B128"

- Adjust the global spindown time in /etc/hdparm.conf to your needs. (E.g. "spindown_time = 120" will make the drive spin down after 10 minutes)

Changed in hdparm (Ubuntu):
status: Confirmed → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.