Re: POWER MODE and sat,12 again
Alfred Ganz <[email protected]>
| Newsgroups | gmane.linux.utilities.smartmontools |
|---|---|
| Message-ID | <[email protected]> |
Christian,
With the attached patch, a bogus sense key is ignored if the returned
ATA status register indicates success. No extra -d sat flag is needed
for now.
Thanks very much for the patch.
If possible, please test this patch with smartmontools-6.4 or current SVN.
As a first test I have manually applied the patch against smartmontools-5.43
because this was more convenient for the moment (the context is slightly
different but clearly identifiable). The results are as I had hoped for,
there is no Warning for -H, -n standby reports the POWER MODE, and smartd
no longer spins up the disk. Here are the results:
-----------------------------------------------------------------------
# smartctl -r ioctl -H -d sat,12 /dev/sdb
smartctl 5.43 2012-06-30 r3573 [i686-linux-2.6.32-573.1.1.el6.i686] (local build)
Copyright (C) 2002-12 by Bruce Allen, http://smartmontools.sourceforge.net
.....
REPORT-IOCTL: Device=/dev/sdb Command=SMART STATUS CHECK
Input: FR=0xda, SC=...., LL=...., LM=0x4f, LH=0xc2, DEV=...., CMD=0xb0
[ata pass-through(12): a1 06 2c da 00 00 4f c2 00 b0 00 00 ]
scsi_status=0x0, host_status=0x7, driver_status=0x8
info=0x1 duration=56 milliseconds resid=0
status=2: [desc] sense_key=4 asc=0 ascq=0
ATA status (0x50) indicates success, ignoring SCSI sense key
[Duration: 0.057s]
Output: ERR=0x00, SC=0x00, LL=0x00, LM=0x4f, LH=0xc2, DEV=0x00, STS=0x50
REPORT-IOCTL: Device=/dev/sdb Command=SMART STATUS CHECK returned 0
SMART overall-health self-assessment test result: PASSED
Please note the following marginal Attributes:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
190 Airflow_Temperature_Cel 0x0022 054 041 045 Old_age Always In_the_past 46 (0 13 46 42 0)
-----------------------------------------------------------------------
# smartctl -r ioctl,2 -n standby -d sat,12 /dev/sdb
smartctl 5.43 2012-06-30 r3573 [i686-linux-2.6.32-573.1.1.el6.i686] (local build)
Copyright (C) 2002-12 by Bruce Allen, http://smartmontools.sourceforge.net
REPORT-IOCTL: Device=/dev/sdb Command=CHECK POWER MODE
Input: FR=...., SC=...., LL=...., LM=...., LH=...., DEV=...., CMD=0xe5
[ata pass-through(12): a1 06 2c 00 00 00 00 00 00 e5 00 00 ]
scsi_status=0x0, host_status=0x7, driver_status=0x8
info=0x1 duration=2 milliseconds resid=0
>>> Sense buffer, len=22:
00 72 04 00 00 00 00 00 0e 09 0c 00 00 50 00 00 00
10 00 00 00 00 00 50
status=2: [desc] sense_key=4 asc=0 ascq=0
ATA status (0x50) indicates success, ignoring SCSI sense key
Values from ATA Return Descriptor are:
00 09 0c 00 00 50 00 00 00 00 00 00 00 00 50
[Duration: 0.002s]
Output: ERR=0x00, SC=0x00, LL=0x00, LM=0x00, LH=0x00, DEV=0x00, STS=0x50
REPORT-IOCTL: Device=/dev/sdb Command=CHECK POWER MODE returned 0
Sector Count Register (BASE-16): 00
Device is in STANDBY mode, exit(2)
-----------------------------------------------------------------------
Unfortunately it will take some time before I have a chance to apply the
patch to a 6.4 version. If it is important please let me know, I might
be able to push it.
Thanks again for working on smartmontools and for your help, AG
--
----------------------------------------------------------------------
Alfred Ganz alfred-ganz:at:agci.com
AG Consulting (203) 624-9667
440 Prospect Street # 11
New Haven, CT 06511
----------------------------------------------------------------------
------------------------------------------------------------------------------