Opened 15 years ago
Closed 15 years ago
#20 closed enhancement (fixed)
weird byte order of "Head Flying Hours"
Reported by: | stlman | Owned by: | Christian Franke |
---|---|---|---|
Priority: | minor | Milestone: | Release 5.40 |
Component: | all | Version: | 5.38 |
Keywords: | Cc: |
Description
I've bought a brand new 1T Seagate drive yesterday.
kotik tmp # dmesg | grep ST31 [ 0.834822] ata1.00: ATA-8: ST31000528AS, CC35, max UDMA/133 [ 0.847168] scsi 0:0:0:0: Direct-Access ATA ST31000528AS CC35 PQ: 0 ANSI: 5
I was quite surprised to see its Head_Flying_Hours to be some n-teen digit number when I first run smartctl on it, however, Power_On_Hours value was sane. To be sure that everything is ok with my eyes I ran smrtctl again. This time the value was completely different although of the same order of magnitude. After quick investigation it became quite obvious that there is something wrong with the byte order of the raw value
kotik tmp # smartctl -d ata -A /dev/sda | grep ^240 240 Head_Flying_Hours 0x0000 100 253 000 Old_age Offline - 102838696935451 kotik tmp # printf "%x\n" 102838696935451 5d880000001b
When I read the values with my programme (see attachment) I found that one of the bytes of the value is stored in the reserv field of the ata_smart_attribute structure. The right order to read the value seems to be
raw[3], raw[2], raw[1], raw[0], reserv, raw[5], raw[4]
However, I am not sure about more significant bytes (raw[1-3]).
The value itself is almost for sure number of milliseconds.
Attachments (1)
Change History (4)
by , 15 years ago
comment:1 by , 15 years ago
Version: | → 5.38 |
---|
comment:2 by , 15 years ago
Milestone: | → Release 5.40 |
---|---|
Owner: | changed from | to
Priority: | major → minor |
Status: | new → accepted |
Type: | defect → enhancement |
comment:3 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | accepted → closed |
It is now possible to specify the byte order by '-v' option. The following should work for this drive:
smartctl -v 240,raw48:3210r54 ...'
The -v option can be put in a drive database entry which can also be read from a file (/etc/smart_drivedb.h).
Decode Head_Flying_Hours from ST31000528AS Seagate drive