Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#758988: hdparm: Spindown setting not applied on resume

111 views
Skip to first unread message

Leonardo Canducci

unread,
Aug 23, 2014, 11:20:02 AM8/23/14
to
Package: hdparm
Version: 9.43-1.1
Severity: normal

Dear Maintainer,

I'm using hdparm.conf to spin down my secondary media HDD when not in
use. Disk spins down after reboots or invoking service hdparm restart
but it does not when resuming from suspend (which I use a lot).

This happens because my disk (Seagate Barracuda ST3500320AS_5QM12E6M)
doesn't support AdvancedPM (APM_level = not supported) even if it can
spin down with no issues via hdparm -y or hdparm -S.

This bug is similar to Ubuntu #1225169: when resuming from suspend
/usr/lib/pm-utils/power.d/95hdparm-apm is executed which checks for
AdvancedPM support before reapplying hdparm.conf options. In my case
this script fails silently and the disk doesn't spin down.

I guess I could comment out the AdvancedPM check to fix things. Is there
a cleaner solution?

Thanks!

-- System Information:
Debian Release: jessie/sid
APT prefers unstable
APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.14-2-amd64 (SMP w/4 CPU cores)
Locale: LANG=it_IT.UTF-8, LC_CTYPE=it_IT.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages hdparm depends on:
ii libc6 2.19-9
ii lsb-base 4.1+Debian13

Versions of packages hdparm recommends:
ii powermgmt-base 1.31+nmu1

Versions of packages hdparm suggests:
pn apmd <none>

-- Configuration Files:
/etc/hdparm.conf changed:
quiet
/dev/sdb {
spindown_time = 2m
}


-- no debconf information


--
To UNSUBSCRIBE, email to debian-bugs-...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org

Alex Mestiashvili

unread,
Dec 29, 2017, 11:40:02 AM12/29/17
to
I believe this problem is fixed in stretch.
hdparm version 9.51+ds-1.
do you have a chance to test it ?


Rainer Dorsch

unread,
May 18, 2018, 4:40:03 PM5/18/18
to
Package: hdparm
Version: 9.56+ds-1
Followup-For: Bug #758988

Dear Maintainer,

I see that behavior also in buster.

What I understand is that

/usr/lib/pm-utils/power.d/95hdparm-apm resume

gets called during resume.

To make it work for me, I had to comment these two if conditions

# if [ -b $dev ] && hdparm_try_apm $dev ; then
# Check for APM support; discard errors since not all
# drives support HDIO_GET_IDENTITY (-i).
# if hdparm -i $dev 2> /dev/null | grep -q 'AdvancedPM=yes'
# then

in resume_hdparm_spindown().

For reference the output of

root@b370:~# hdparm -i /dev/sdb

/dev/sdb:

Model=SAMSUNG HD501LJ, FwRev=CR100-12, SerialNo=S0MUJ1FPB79563
Config={ Fixed }
RawCHS=16383/16/63, TrkSize=34902, SectSize=554, ECCbytes=4
BuffType=DualPortCache, BuffSize=16384kB, MaxMultSect=16, MultSect=off
CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=976773168
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=no WriteCache=enabled
Drive conforms to: unknown: ATA/ATAPI-3,4,5,6,7

* signifies the current active mode

root@b370:~#

and

root@b370:~# udevadm info -n /dev/sdb -q property
DEVLINKS=/dev/disk/by-id/wwn-0x50000f001bb79563 /dev/disk/by-id/ata-SAMSUNG_HD501LJ_S0MUJ1FPB79563 /dev/disk/by-path/pci-0000:00:17.0-ata-4
DEVNAME=/dev/sdb
DEVPATH=/devices/pci0000:00/0000:00:17.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb
DEVTYPE=disk
ID_ATA=1
ID_ATA_DOWNLOAD_MICROCODE=1
ID_ATA_FEATURE_SET_AAM=1
ID_ATA_FEATURE_SET_AAM_CURRENT_VALUE=254
ID_ATA_FEATURE_SET_AAM_ENABLED=1
ID_ATA_FEATURE_SET_AAM_VENDOR_RECOMMENDED_VALUE=254
ID_ATA_FEATURE_SET_HPA=1
ID_ATA_FEATURE_SET_HPA_ENABLED=1
ID_ATA_FEATURE_SET_PM=1
ID_ATA_FEATURE_SET_PM_ENABLED=1
ID_ATA_FEATURE_SET_SECURITY=1
ID_ATA_FEATURE_SET_SECURITY_ENABLED=0
ID_ATA_FEATURE_SET_SECURITY_ENHANCED_ERASE_UNIT_MIN=168
ID_ATA_FEATURE_SET_SECURITY_ERASE_UNIT_MIN=168
ID_ATA_FEATURE_SET_SECURITY_FROZEN=1
ID_ATA_FEATURE_SET_SMART=1
ID_ATA_FEATURE_SET_SMART_ENABLED=1
ID_ATA_SATA=1
ID_ATA_SATA_SIGNAL_RATE_GEN1=1
ID_ATA_SATA_SIGNAL_RATE_GEN2=1
ID_ATA_WRITE_CACHE=1
ID_ATA_WRITE_CACHE_ENABLED=1
ID_BUS=ata
ID_MODEL=SAMSUNG_HD501LJ
ID_MODEL_ENC=SAMSUNG\x20HD501LJ\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
ID_PART_TABLE_TYPE=dos
ID_PART_TABLE_UUID=000916dc
ID_PATH=pci-0000:00:17.0-ata-4
ID_PATH_TAG=pci-0000_00_17_0-ata-4
ID_REVISION=CR100-12
ID_SERIAL=SAMSUNG_HD501LJ_S0MUJ1FPB79563
ID_SERIAL_SHORT=S0MUJ1FPB79563
ID_TYPE=disk
ID_WWN=0x50000f001bb79563
ID_WWN_WITH_EXTENSION=0x50000f001bb79563
MAJOR=8
MINOR=16
SUBSYSTEM=block
TAGS=:systemd:
USEC_INITIALIZED=1689672
root@b370:~#

-- System Information:
Debian Release: buster/sid
APT prefers testing-debug
APT policy: (500, 'testing-debug'), (500, 'testing'), (80, 'unstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.16.0-1-amd64 (SMP w/6 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8), LANGUAGE=de:en_US (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages hdparm depends on:
ii libc6 2.27-3
ii lsb-base 9.20170808

Versions of packages hdparm recommends:
ii powermgmt-base 1.33

Versions of packages hdparm suggests:
pn apmd <none>

-- Configuration Files:
/etc/hdparm.conf changed:
quiet
/dev/disk/by-id/wwn-0x50000f001bb79563 {
spindown_time = 12
}

-- no debconf information

Alex Mestiashvili

unread,
May 23, 2018, 5:00:02 PM5/23/18
to
Thanks for reporting.

The only solution I currently see is to add an option to hdparm.conf to
allow forcibly set spindown time regardless APM support.
/usr/lib/pm-utils/power.d/95hdparm-apm need to be modified to check for
this option in resume_hdparm_spindown().
0 new messages