Package: hddtemp
Version: 0.3-beta15-52
Severity: normal

Dear Maintainer,

we have a server with the following disk:

=== START OF INFORMATION SECTION ===
Model Family:     Seagate Constellation ES (SATA 6Gb/s)
Device Model:     ST500NM0011
Serial Number:    Z1M0BZRA
LU WWN Device Id: 5 000c50 0404c7128
Firmware Version: SN02
User Capacity:    500,107,862,016 bytes [500 GB]
Sector Size:      512 bytes logical/physical
Rotation Rate:    7202 rpm
Form Factor:      3.5 inches
Device is:        In smartctl database [for details use: -P show]
ATA Version is:   ATA8-ACS T13/1699-D revision 4
SATA Version is:  SATA 3.0, 6.0 Gb/s (current: 3.0 Gb/s)
Local Time is:    Mon Aug  1 13:17:08 2016 CEST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

When trying to read the temperature of this disk with hddtemp, it sometimes
reports the correct temperature, and sometimes erroneously reports that the
disk is sleeping:

server ~ # hddtemp -uC /dev/sda
/dev/sda: ST500NM0011: drive is sleeping
server ~ # hddtemp -uC /dev/sda
/dev/sda: ST500NM0011: 27 C

Apparently it misdetects the power mode, and so does hdparm -C:

server ~ # hdparm -C /dev/sda
/dev/sda:
 drive state is:  active/idle

server ~ # hdparm -C /dev/sda
/dev/sda:
 drive state is:  unknown

I figured out what exactly was going on with hdparm --verbose -C:

server ~ # hdparm --verbose -C /dev/sda

/dev/sda:
outgoing cdb:  85 06 20 00 00 00 00 00 00 00 00 00 00 40 e5 00
SG_IO: ATA_16 status=0x2, host_status=0x0, driver_status=0x8
SG_IO: sb[]:  72 01 00 1d 00 00 00 0e 09 0c 00 00 00 ff 00 00 00 00 00 00 40 50 
00 00 00 00 00 00 00 00 00 00
SG_IO: desc[]:  09 0c 00 00 00 ff 00 00 00 00 00 00 40 50
      ATA_16 stat=50 err=00 nsect=ff lbal=00 lbam=00 lbah=00 dev=40
 drive state is:  active/idle

server ~ # hdparm --verbose -C /dev/sda

/dev/sda:
outgoing cdb:  85 06 20 00 00 00 00 00 00 00 00 00 00 40 e5 00
SG_IO: ATA_16 status=0x2, host_status=0x0, driver_status=0x8
SG_IO: sb[]:  72 01 00 1d 00 00 00 0e 09 0c 00 00 00 81 00 00 00 00 00 00 40 50 
00 00 00 00 00 00 00 00 00 00
SG_IO: desc[]:  09 0c 00 00 00 81 00 00 00 00 00 00 40 50
      ATA_16 stat=50 err=00 nsect=81 lbal=00 lbam=00 lbah=00 dev=40
 drive state is:  unknown

Note the 0xFF in the output where hdparm reports active/idle, and the 0x81 in
the output where it reports unknown.

I looked into the source code of hdparm and hddtemp and figured out that both
seem to be using the ATA command CHECK POWER MODE (0xE5), which probably
corresponds to the 0xE5 0x00 bytes and the end of "outgoing cdb". I've found a
spec PDF (though I don't know whether this is the correct one, I'm pretty new
to ATA specs), and it documents 0x81 as follows:

http://www.t13.org/Documents/UploadedDocuments/docs2013/d2161r5-ATAATAPI_Command_Set_-_3.pdf

page 344

81h Device is in the PM1:Idle state, the EPC feature set is enable, and the 
device is in the
Idle_a power condition (see 4.9.2).

hddtemp (and hdparm too, but that is a different bug report) should probably be
adapted so they'll understand these new output codes.

-- System Information:
Debian Release: 8.5
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: i386 (x86_64)
Foreign Architectures: amd64

Kernel: Linux 4.6.0-0.bpo.1-amd64 (SMP w/8 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages hddtemp depends on:
ii  debconf [debconf-2.0]  1.5.56
ii  libc6                  2.19-18+deb8u4
ii  lsb-base               4.1+Debian13+nmu1

hddtemp recommends no packages.

Versions of packages hddtemp suggests:
pn  ksensors  <none>

-- debconf information excluded

Reply via email to