# hddtemp/SMART with SATA drive on scsi emulation

## torklingberg

With the 2.6.7 kernel my SATA drive was /dev/hde and hddtemp worked fine. Now in 2.6.8 it is /dev/sda, and hddtemp outputs:

/dev/sda: ATA     SAMSUNG SP1614C : /dev/sda: ATA     SAMSUNG SP1614C :  S.M.A.R.T. not available

What's wrong? Anything I can do about it?

----------

## LordHelmchen

no 'before' here, but same question...

*bump*

----------

## Xaid

The newer kernels use libata for SATA support since its better, but libata doesnt support reading SMART info yet from the drive (or am I wrong?).

its going to get there eventually, its just a matter of time.

----------

## Ycarus

You're right. I quote from  http://linux.yyz.us/sata/software-status.html :

 *Quote:*   

> 
> 
> SMART support
> 
> Soon. Requires the capability to directly submit ATA commands from userspace to the low-level device, which must be added with care. The smartmontools developers have committed to adding a new device type '-d sata' to utilize this passthrough, once it is ready.
> ...

 

----------

## R!tman

Is there any progress with this issue? I could not achieve reading the hd temp of my sata drives with neither hddtemp nor smartmontools.

----------

## tnt

There is development patch for lib-data and I've was able to read temperatures with it. Ofcorse, I don't use that patch everyday - just tested.

I guess it will in stable kernel tree soon...

----------

## R!tman

 *tnt wrote:*   

> There is development patch for lib-data and I've was able to read temperatures with it. Ofcorse, I don't use that patch everyday - just tested.
> 
> I guess it will in stable kernel tree soon...

 

I search the web, but I could not find a working link to a patch like that. Could you maybe post one?

----------

## tnt

Well, I've forgot original link, but here's my copy:

http://www.aaen.edu.yu/~tnt/temp/2.6.11-libata-dev1.patch.bz2

It should be used against vanilla kernel source !!!

----------

## R!tman

 *tnt wrote:*   

> Well, I've forgot original link, but here's my copy:
> 
> http://www.aaen.edu.yu/~tnt/temp/2.6.11-libata-dev1.patch.bz2
> 
> It should be used against vanilla kernel source !!!

 

That patch works, thank you tnt!

But I seem to have another problem.

This happens with a patched kernel: 

```
# hddtemp /dev/sda

/dev/sda: SAMSUNG SP1614C SW10: drive is sleeping
```

Although this looks better than without the patch, it does not really work.

This is what I get without the patch and gentoo-sources-2.6.11-r3:

```
# hddtemp /dev/sda

/dev/sda: ATA     SAMSUNG SP1614C : /dev/sda: ATA     SAMSUNG SP1614C :  S.M.A.R.T. not available

```

'smartmontools' does not work at all. With a patched kernel or without, both times I get this

```
# smartctl -a /dev/sda

smartctl version 5.30 Copyright (C) 2002-4 Bruce Allen

Home page is http://smartmontools.sourceforge.net/

Device: ATA      SAMSUNG SP1614C  Version: SW10

Serial number: S01XJ20Y203896      

Device type: disk

Local Time is: Thu Mar 31 16:33:29 2005 CEST

Device does not support SMART

Device does not support Error Counter logging

[GLTSD (Global Logging Target Save Disable) set. Enable Save with '-S on']

Device does not support Self Test logging
```

Any suggestions? BTW, I am on an AMD64.

----------

## tnt

You should try something like this:

```
smartctl -i -d ata /dev/sda
```

or 

```
smartctl -a -d ata /dev/sda
```

BTW:

http://smartmontools.sourceforge.net/#testinghelp

And I am on amd64, too.

 :Wink: 

----------

## R!tman

 *tnt wrote:*   

> 
> 
> ```
> smartctl -a -d ata /dev/sda
> ```
> ...

 

That worked very well and gave me quite some output including the temperature. Thank you tnt  :Smile: !

When this patch is included in the standart kernels I hope hddtemp will work again, and I'll be able to monitor hd temperatures with gkrellm.

----------

## tnt

 *R!tman wrote:*   

> That worked very well and gave me quite some output including the temperature. Thank you tnt Smile!

 

You're welcome!  :Smile: 

 *R!tman wrote:*   

> When this patch is included in the standart kernels I hope hddtemp will work again, and I'll be able to monitor hd temperatures with gkrellm.

 

We are all looking forward that...

 :Very Happy: 

----------

## R!tman

Together with hddtemp-0.3-beta13, my ebuild is here, and the libata-dev patch, which can be found here, hddtemp works now for sata drives.

I can finally use gkrellm to monitor my hd-temps  :Very Happy: !

----------

## tnt

Is it stable for you?

Any ideas when it will be in the upstream?

----------

## R!tman

 *tnt wrote:*   

> Is it stable for you?

 

I had no issues at all so far. 

 *tnt wrote:*   

> Any ideas when it will be in the upstream?

 

hddtemp-0.3-beta13 will be in portage very soon, I believe. The ebuild is identical to beta12, except for the name  :Smile: . It will most probably be masked, but this should not be a problem. I already requested an official ebuild here.

But the llibata-dev patch.... no idea. I will write the dev what he thinks and post back.

----------

## tnt

Are there any chances to see this new version of libdata in 2.6.12 kernel?

 :Question: 

----------

## R!tman

 *tnt wrote:*   

> Are there any chances to see this new version of libdata in 2.6.12 kernel?
> 
> 

 

I am not using 2.6.12 yet, as I patch gentoo-sources last time and these are still 2.6.11-r9. This has been working with no problems all that time. As far as I know the libata-dev patch, allowing SMART readout for sata drives, is  not used in any sources yet. Not even mm-sources.

So, the patch you mentioned is probably not what you are looking for. But I could of course be wrong.

BTW, I never got an email back from the dev I wrote an email to, regarding when the patch will be in official kernel trees.

----------

## tnt

I've tried path on my desktop but I need it for my server and I'm not going to use anything but "stable" kernel release on it...  :Sad: 

So, I guess I have to wait...

----------

## tnt

That libdata patch (2.6.11-libata-dev1.patch) works for me for two weeks without a single problem

```
master src # uname -a

Linux master 2.6.11-gentoo-r7 #2 Thu May 26 11:49:05 CEST 2005 x86_64 AMD Athlon(tm) 64 Processor 3000+ AuthenticAMD GNU/Linux

master src # lspci

0000:00:00.0 Host bridge: nVidia Corporation nForce3 250Gb Host Bridge (rev a1)

0000:00:01.0 ISA bridge: nVidia Corporation: Unknown device 00e0 (rev a2)

0000:00:01.1 SMBus: nVidia Corporation nForce 250Gb PCI System Management (rev a1)

0000:00:02.0 USB Controller: nVidia Corporation CK8S USB Controller (rev a1)

0000:00:02.1 USB Controller: nVidia Corporation CK8S USB Controller (rev a1)

0000:00:02.2 USB Controller: nVidia Corporation CK8S USB Controller (rev a2)

0000:00:08.0 IDE interface: nVidia Corporation CK8S Parallel ATA Controller (v2.5) (rev a2)

0000:00:0a.0 IDE interface: nVidia Corporation CK8S Serial ATA Controller (v2.5) (rev a2)

0000:00:0b.0 PCI bridge: nVidia Corporation nForce3 250Gb AGP Host to PCI Bridge (rev a2)

0000:00:0e.0 PCI bridge: nVidia Corporation nForce3 250Gb PCI-to-PCI Bridge (rev a2)

0000:00:18.0 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] HyperTransport Technology Configuration

0000:00:18.1 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Address Map

0000:00:18.2 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] DRAM Controller

0000:00:18.3 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Miscellaneous Control

0000:01:00.0 VGA compatible controller: nVidia Corporation NV28 [GeForce4 Ti 4200 AGP 8x] (rev a1)

0000:02:08.0 Multimedia audio controller: Ensoniq 5880 AudioPCI (rev 02)

0000:02:09.0 Multimedia video controller: Brooktree Corporation Bt878 Video Capture (rev 11)

0000:02:09.1 Multimedia controller: Brooktree Corporation Bt878 Audio Capture (rev 11)

0000:02:0d.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 10)

master src # smartctl -a --device=ata /dev/sda

smartctl version 5.33 [x86_64-pc-linux-gnu] Copyright (C) 2002-4 Bruce Allen

Home page is http://smartmontools.sourceforge.net/

=== START OF INFORMATION SECTION ===

Device Model:     ST3160827AS

Serial Number:    3MT04D6W

Firmware Version: 3.42

User Capacity:    160,041,885,696 bytes

Device is:        Not in smartctl database [for details use: -P showall]

ATA Version is:   6

ATA Standard is:  ATA/ATAPI-6 T13 1410D revision 2

Local Time is:    Tue Jun  7 16:10:28 2005 CEST

SMART support is: Available - device has SMART capability.

SMART support is: Enabled

=== START OF READ SMART DATA SECTION ===

SMART overall-health self-assessment test result: PASSED

General SMART Values:

Offline data collection status:  (0x82) Offline data collection activity

                                        was completed without error.

                                        Auto Offline Data Collection: Enabled.

Self-test execution status:      (   0) The previous self-test routine completed

                                        without error or no self-test has ever

                                        been run.

Total time to complete Offline

data collection:                 ( 430) seconds.

Offline data collection

capabilities:                    (0x5b) SMART execute Offline immediate.

                                        Auto Offline data collection on/off support.

                                        Suspend Offline collection upon new

                                        command.

                                        Offline surface scan supported.

                                        Self-test supported.

                                        No Conveyance Self-test supported.

                                        Selective Self-test supported.

SMART capabilities:            (0x0003) Saves SMART data before entering

                                        power-saving mode.

                                        Supports SMART auto save timer.

Error logging capability:        (0x01) Error logging supported.

                                        No General Purpose Logging support.

Short self-test routine

recommended polling time:        (   1) minutes.

Extended self-test routine

recommended polling time:        (  94) minutes.

SMART Attributes Data Structure revision number: 10

Vendor Specific SMART Attributes with Thresholds:

ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE

  1 Raw_Read_Error_Rate     0x000f   062   049   006    Pre-fail  Always       -       51016817

  3 Spin_Up_Time            0x0003   097   096   000    Pre-fail  Always       -       0

  4 Start_Stop_Count        0x0032   100   100   020    Old_age   Always       -       177

  5 Reallocated_Sector_Ct   0x0033   100   100   036    Pre-fail  Always       -       0

  7 Seek_Error_Rate         0x000f   083   060   030    Pre-fail  Always       -       204089933

  9 Power_On_Hours          0x0032   097   097   000    Old_age   Always       -       2990

 10 Spin_Retry_Count        0x0013   100   100   097    Pre-fail  Always       -       0

 12 Power_Cycle_Count       0x0032   100   100   020    Old_age   Always       -       213

194 Temperature_Celsius     0x0022   037   044   000    Old_age   Always       -       37 (Lifetime Min/Max 0/15)

195 Hardware_ECC_Recovered  0x001a   062   049   000    Old_age   Always       -       51016817

197 Current_Pending_Sector  0x0012   100   100   000    Old_age   Always       -       0

198 Offline_Uncorrectable   0x0010   100   100   000    Old_age   Offline      -       0

199 UDMA_CRC_Error_Count    0x003e   200   200   000    Old_age   Always       -       0

200 Multi_Zone_Error_Rate   0x0000   100   253   000    Old_age   Offline      -       0

202 TA_Increase_Count       0x0032   100   253   000    Old_age   Always       -       0

SMART Error Log Version: 1

No Errors Logged

SMART Self-test log structure revision number 1

Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error

# 1  Extended offline    Completed without error       00%      2761         -

# 2  Short offline       Completed without error       00%      2758         -

SMART Selective self-test log data structure revision number 1

 SPAN  MIN_LBA  MAX_LBA  CURRENT_TEST_STATUS

    1        0        0  Not_testing

    2        0        0  Not_testing

    3        0        0  Not_testing

    4        0        0  Not_testing

    5        0        0  Not_testing

Selective self-test flags (0x0):

  After scanning selected spans, do NOT read-scan remainder of disk.

If Selective self-test is pending on power-up, resume after 0 minute delay.

master src #
```

The interesting thing I've noticed is that there were files in my gentoo-sources that already were patched and some of files that patch should create already existed. So, I guess part of that libdata patch is already in gentoo-sources patch-set.

Could we ask gentoo developers to consider testing and eventual adding of rest of the libdata patch in the gentoo-sources patch-set?

It would really add great functionality, especialy for gentoo servers I have to monitor remotely.

 :Question: 

----------

## R!tman

 *tnt wrote:*   

> That libdata patch (2.6.11-libata-dev1.patch) works for me for two weeks without a single problem

 

No problems for my either. I really like the temps shown in gkrellm  :Smile: .

 *tnt wrote:*   

> The interesting thing I've noticed is that there were files in my gentoo-sources that already were patched and some of files that patch should create already existed. So, I guess part of that libdata patch is already in gentoo-sources patch-set.

 

I also noticed that, but I think the patch does not only include s.m.a.r.t. pass through, but also other stuff, which might be the reason for gentoo-devs to include these certain parts.

 *tnt wrote:*   

> Could we ask gentoo developers to consider testing and eventual adding of rest of the libdata patch in the gentoo-sources patch-set?
> 
> It would really add great functionality, especialy for gentoo servers I have to monitor remotely.

 

Indeed, Gentoo would benefit from that, at least sata-users. I have not changed my kernel in some time now, but last time I checked, the patch was not included in vanilla- and not even in mm-sources. So, the chances are not good for the patch to be included, yet. 

But we could ask of course. Should we do that on Gentoo's bugzilla?

----------

## tnt

Well we could fill the bug report, bug I know that gentoo devlopers are in very bad mood quite often, and especially if you ask for a new feature.  :Wink: 

So, I thought that this way would be more "polite": just to talk about that and see if some of developers would came across this topic.  :Smile: 

Let's wait for a few days to see if that happens, and if not, we will be forced to be unpolite and fill a bug report...  :Confused: 

----------

## tnt

OK, we definitely should fill a bug report!  :Laughing: 

Any suggestions for text of it?

Let's construct that bug report here and then fill it in bugs.gentoo.org...

----------

## R!tman

 *tnt wrote:*   

> OK, we definitely should fill a bug report! 
> 
> Any suggestions for text of it?
> 
> Let's construct that bug report here and then fill it in bugs.gentoo.org...

 

```
Product: Gentoo Linux

Component: Core system

Hardware Platform: All

Operating System: Linux

Build Identifier (User Agent): Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050515 Firefox/1.0.4

URL: http://

Summary: S.M.A.R.T. capability for SATA-harddrives

Details: At the moement gentoo-sources (2.6.x) do not support S.M.A.R.T. There is a patch that enables this for sata drives. It can be found at http://www.kernel.org/pub/linux/kernel/people/jgarzik/libata/. Parts of the patch seem to have been included in gentoo-sources already, as some instances of the patch did not apply 100% clean.

Reproducibility: always

Steps to reproduce: apply the patch mentioned above.

Actual Results: S.M.A.R.T. works, together with >=hddtemp-0.3-beta13 temperatures of sata drives can be monitored.

Expected Results: 

Additional Information: I have tested this with gentoo-sources-2.6.11-r7 (for about 4 weeks) and gentoo-sources-2.6.11-r11 (since 1 week) on amd64. No problems of any kind occured during that time. I have a software raid 5, if that might be of interest.

Severity: Enhancement: Request for new feature or enhancement.
```

Please correct things you do not agree with.

----------

## tnt

Your bug report is great!

I just wonder if we should put link to this thread in the "URL: http://..." section of bug report?

 :Question: 

----------

## R!tman

 *tnt wrote:*   

> Your bug report is great!
> 
> I just wonder if we should put link to this thread in the "URL: http://..." section of bug report?
> 
> 

 

I included the url (good idea, thanks) and changed some parts a little. The bug is here. Maybe you can include you own experiences there, too.

----------

## tnt

I guess we have to contact libdata maintainer.  :Sad: 

Do you have some working mail of his (her)?

 :Rolling Eyes: 

----------

## perry

http://marc.theaimsgroup.com/?l=linux-ide&m=111791283717030&w=2

I think that what we need is on the way for inclusion in the main kernel tree, but not quite ready for prime-time yet.

http://marc.theaimsgroup.com/?l=linux-ide&m=111816694621872&w=2 - won't be seeing any more patches like we saw for 2.6.11, unfortunately  :Sad: 

I guess it's possible to check out the latest patches, but I haven't a clue how to do that.

http://lkml.org/lkml/2005/5/26/11 - some directions, but I'm not exactly sure how to get a file similar to what was used for 2.6.11.

----------

## R!tman

 *tnt wrote:*   

> I guess we have to contact libdata maintainer. 
> 
> Do you have some working mail of his (her)?
> 
> 

 

I wrote an email to Jeff Garzik some time ago. He did not answer. 

 *perry wrote:*   

> http://marc.theaimsgroup.com/?l=linux-ide&m=111791283717030&w=2
> 
> I think that what we need is on the way for inclusion in the main kernel tree, but not quite ready for prime-time yet.
> 
> http://marc.theaimsgroup.com/?l=linux-ide&m=111816694621872&w=2 - won't be seeing any more patches like we saw for 2.6.11, unfortunately 
> ...

 

Having read these, I believe the patch is not far from being merged into the official kernel tree. 

Maybe we should just wait....

----------

## tnt

 *R!tman wrote:*   

> I wrote an email to Jeff Garzik some time ago. He did not answer. 

 

I've wrote him, too:

 *Quote:*   

> Hello.
> 
> I just want to report another successful story about SMART working
> 
> with SATA drives:
> ...

 

----------

## perry

http://marc.theaimsgroup.com/?l=linux-ide&m=111947267304151&w=2

I'll try that patch this weekend sometime... Guess he gave in to peer pressure  :Smile: 

----------

## perry

Working here:

```

perry@slappy ~ $ /usr/sbin/hddtemp /dev/sda

/dev/sda: Maxtor 6B200M0: 34°C

perry@slappy ~ $ uname -a

Linux slappy 2.6.12-gentoo-r1 #1 Sat Jun 25 03:00:50 EST 2005 x86_64 AMD Athlon(tm) 64 Processor 3000+ AuthenticAMD GNU/Linux

```

----------

## tnt

Works for me, too:

```
master ~ # smartctl -a --device=ata /dev/sda

smartctl version 5.33 [x86_64-pc-linux-gnu] Copyright (C) 2002-4 Bruce Allen

Home page is http://smartmontools.sourceforge.net/

=== START OF INFORMATION SECTION ===

Device Model:     ST3160827AS

Serial Number:    3MT04D6W

Firmware Version: 3.42

User Capacity:    160,041,885,696 bytes

Device is:        Not in smartctl database [for details use: -P showall]

ATA Version is:   6

ATA Standard is:  ATA/ATAPI-6 T13 1410D revision 2

Local Time is:    Sun Jun 26 14:52:29 2005 CEST

SMART support is: Available - device has SMART capability.

SMART support is: Enabled

=== START OF READ SMART DATA SECTION ===

SMART overall-health self-assessment test result: PASSED

General SMART Values:

Offline data collection status:  (0x82) Offline data collection activity

                                        was completed without error.

                                        Auto Offline Data Collection: Enabled.

Self-test execution status:      (   0) The previous self-test routine completed

                                        without error or no self-test has ever

                                        been run.

Total time to complete Offline

data collection:                 ( 430) seconds.

Offline data collection

capabilities:                    (0x5b) SMART execute Offline immediate.

                                        Auto Offline data collection on/off support.

                                        Suspend Offline collection upon new

                                        command.

                                        Offline surface scan supported.

                                        Self-test supported.

                                        No Conveyance Self-test supported.

                                        Selective Self-test supported.

SMART capabilities:            (0x0003) Saves SMART data before entering

                                        power-saving mode.

                                        Supports SMART auto save timer.

Error logging capability:        (0x01) Error logging supported.

                                        No General Purpose Logging support.

Short self-test routine

recommended polling time:        (   1) minutes.

Extended self-test routine

recommended polling time:        (  94) minutes.

SMART Attributes Data Structure revision number: 10

Vendor Specific SMART Attributes with Thresholds:

ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE

  1 Raw_Read_Error_Rate     0x000f   059   049   006    Pre-fail  Always       -       140085088

  3 Spin_Up_Time            0x0003   096   096   000    Pre-fail  Always       -       0

  4 Start_Stop_Count        0x0032   100   100   020    Old_age   Always       -       191

  5 Reallocated_Sector_Ct   0x0033   100   100   036    Pre-fail  Always       -       0

  7 Seek_Error_Rate         0x000f   083   060   030    Pre-fail  Always       -       222391148

  9 Power_On_Hours          0x0032   097   097   000    Old_age   Always       -       3373

 10 Spin_Retry_Count        0x0013   100   100   097    Pre-fail  Always       -       0

 12 Power_Cycle_Count       0x0032   100   100   020    Old_age   Always       -       227

194 Temperature_Celsius     0x0022   041   044   000    Old_age   Always       -       41 (Lifetime Min/Max 0/15)

195 Hardware_ECC_Recovered  0x001a   059   049   000    Old_age   Always       -       140085088

197 Current_Pending_Sector  0x0012   100   100   000    Old_age   Always       -       0

198 Offline_Uncorrectable   0x0010   100   100   000    Old_age   Offline      -       0

199 UDMA_CRC_Error_Count    0x003e   200   200   000    Old_age   Always       -       0

200 Multi_Zone_Error_Rate   0x0000   100   253   000    Old_age   Offline      -       0

202 TA_Increase_Count       0x0032   100   253   000    Old_age   Always       -       0

SMART Error Log Version: 1

No Errors Logged

SMART Self-test log structure revision number 1

Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error

# 1  Extended offline    Completed without error       00%      2761         -

# 2  Short offline       Completed without error       00%      2758         -

SMART Selective self-test log data structure revision number 1

 SPAN  MIN_LBA  MAX_LBA  CURRENT_TEST_STATUS

    1        0        0  Not_testing

    2        0        0  Not_testing

    3        0        0  Not_testing

    4        0        0  Not_testing

    5        0        0  Not_testing

Selective self-test flags (0x0):

  After scanning selected spans, do NOT read-scan remainder of disk.

If Selective self-test is pending on power-up, resume after 0 minute delay.

master ~ #

master ~ # emerge info

Portage 2.0.51.19 (default-linux/amd64/2005.0, gcc-3.4.3-20050110, glibc-2.3.4.20041102-r1, 2.6.12-gentoo-r1 x86_64)

=================================================================

System uname: 2.6.12-gentoo-r1 x86_64 AMD Athlon(tm) 64 Processor 3000+

Gentoo Base System version 1.6.12

Python:              dev-lang/python-2.3.5 [2.3.5 (#1, May 12 2005, 02:04:30)]

distcc 2.18.3 x86_64-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]

dev-lang/python:     2.3.5

sys-apps/sandbox:    [Not Present]

sys-devel/autoconf:  2.59-r6, 2.13

sys-devel/automake:  1.7.9-r1, 1.8.5-r3, 1.5, 1.4_p6, 1.6.3, 1.9.5

sys-devel/binutils:  2.15.92.0.2-r10

sys-devel/libtool:   1.5.16

virtual/os-headers:  2.6.8.1-r4

ACCEPT_KEYWORDS="amd64"

AUTOCLEAN="yes"

CFLAGS="-O2 -march=athlon64 -pipe -frename-registers -fweb -fomit-frame-pointer"

CHOST="x86_64-pc-linux-gnu"

CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/lib/mozilla/defaults/pref /usr/share/config /var/qmail/control"

CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"

CXXFLAGS="-O2 -pipe"

DISTDIR="/main/distfiles"

FEATURES="autoaddcvs autoconfig ccache distlocks sandbox sfperms strict"

GENTOO_MIRRORS="ftp://mirror.etf.bg.ac.yu/gentoo/ http://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/ http://gd.tuwien.ac.at/opsys/linux/gentoo/"

LDFLAGS="-Wl,-O1"

MAKEOPTS="-j2"

PKGDIR="/usr/portage/packages"

PORTAGE_TMPDIR="/var/tmp"

PORTDIR="/usr/portage"

PORTDIR_OVERLAY="/usr/local/portage"

SYNC="rsync://rsync.gentoo.org/gentoo-portage"

USE="amd64 X aac acpi alsa apache2 arts avi berkdb bitmap-fonts bzlib cddb cdparanoia cdr crypt cups curl dga dvd dvdr encode exif fam flac font-server fortran gcj gd gdbm gif gphoto2 graphviz gtk2 icq imagemagick imlib innodb jabber java jbig jp2 jpeg junit kde libclamav libwww lm_sensors lzw lzw-tiff mad motif mozilla mp3 mpeg mtqt mulitlib mysql nas ncurses nls nptl nptlonly nvidia oav ogg oggvorbis opengl pam pdflib perl php png python qt quicktime readline real ruby samba sdl slang snmp speex ssl tcpd tiff truetype truetype-fonts type1-fonts unicode usb userlocales videos vorbis wmf xine xml xml2 xmms xpm xrandr xv xvid zlib userland_GNU kernel_linux elibc_glibc"

Unset:  ASFLAGS, CBUILD, CTARGET, LANG, LC_ALL, LINGUAS

master ~ #
```

 :Wink: 

----------

## R!tman

 *perry wrote:*   

> http://marc.theaimsgroup.com/?l=linux-ide&m=111947267304151&w=2
> 
> I'll try that patch this weekend sometime... Guess he gave in to peer pressure 

 

I was not able to test it, yet. Does the patch apply 100% clean? If yes, which kernel do you use?

----------

## tnt

Patch is very small and applies cleanly on gentoo-sources-2.6.12-r1

----------

## augury

I had tried this patch once but I couldn't do it (too stupid).  Tell me how you do it so I can have smart sata too.

----------

## perry

 *augury wrote:*   

> I had tried this patch once but I couldn't do it (too stupid).  Tell me how you do it so I can have smart sata too.

 

Put the patch in /usr/src/linux.. patch -p1 <filename

----------

## perry

Anyone getting stuff like this:

```
Jun 28 03:58:03 slappy ata2: translated ATA stat/err 0xec/00 to SCSI SK/ASC/ASCQ 0xb/47/00

Jun 28 03:58:03 slappy ata2: translated ATA stat/err 0xec/00 to SCSI SK/ASC/ASCQ 0xb/47/00

Jun 28 03:58:03 slappy ata2: translated ATA stat/err 0xb0/00 to SCSI SK/ASC/ASCQ 0xb/47/00

Jun 28 03:58:03 slappy ata2: translated ATA stat/err 0xb0/00 to SCSI SK/ASC/ASCQ 0xb/47/00
```

in their dmesg?  I have hddtemp going through the init script and gkrellm showing me /dev/sda's temp.  When I shutdown gkrellm and hddtemp, the errors stop.  Manually running hddtemp causes the errors to appear.  Running smartctl on the drive does not cause the error.  Who should I tell about the problem -- hddtemp folks, Jeff the patch author, someone else...?

Heh, only noticed it because I was trying to grep dmesg for something that I knew should be there but wasn't popping up.

----------

## R!tman

 *tnt wrote:*   

> Patch is very small and applies cleanly on gentoo-sources-2.6.12-r1

 

I also applies cleanly on gentoo-sources-2.6.12-r4  :Smile: , I have just switch to 2.6.12.x. The patch is VERY tiny, indeed. I like that!

With this kernel and the latest nvidia-drivers I can even monitor the temperatures of the gpu and the graphics board. Neat  :Very Happy: .

Did Jeff Garzic write anything back? If yes, did he mention something about when it will be in the official kernel tree?

----------

## tnt

 *R!tman wrote:*   

> Did Jeff Garzic write anything back? If yes, did he mention something about when it will be in the official kernel tree?

 

Unfortunately, I haven't got any answer...  :Sad: 

----------

## R!tman

 *tnt wrote:*   

>  *R!tman wrote:*   Did Jeff Garzic write anything back? If yes, did he mention something about when it will be in the official kernel tree? 
> 
> Unfortunately, I haven't got any answer... 

 

Sounds familiar...

----------

## augury

it looks like it is in mm-sources.

----------

## assaf

At last! Got both the passthru patch and hddtemp beta13 and it works great... I was waiting for this for a long time but didn't want to take a chance with the libata dev patch

 :Very Happy: 

----------

## assaf

 *perry wrote:*   

> Anyone getting stuff like this:
> 
> ```
> Jun 28 03:58:03 slappy ata2: translated ATA stat/err 0xec/00 to SCSI SK/ASC/ASCQ 0xb/47/00
> 
> ...

 

Yeah, this stuff is filling my log too...

----------

## R!tman

 *assaf wrote:*   

>  *perry wrote:*   Anyone getting stuff like this:
> 
> ```
> Jun 28 03:58:03 slappy ata2: translated ATA stat/err 0xec/00 to SCSI SK/ASC/ASCQ 0xb/47/00
> 
> ...

 

My log is filled, too. I use gentoo-sources with the patch. Did anyone try mm-sources where is patch is natively included?

----------

## widan

 *perry wrote:*   

> Anyone getting stuff like this:
> 
> ```
> Jun 28 03:58:03 slappy ata2: translated ATA stat/err 0xec/00 to SCSI SK/ASC/ASCQ 0xb/47/00
> 
> ...

 

Also have them if I run hddtemp. Interestingly hddtemp triggers them, but smartctl does not.

----------

## R!tman

 *augury wrote:*   

> it looks like it is in mm-sources.

 

With mm-sources, do you also have your dmesg flooded?

----------

## perry

"Good" to see I'm not the only one w/ flooded logs.  I've stopped using gkrellm2 for now.  I emailed Jeff when I first posted about the problem but didn't get a response.

----------

## assaf

It looks like debugging messages, i think it can be safely ignored/filtered out

----------

## augury

no but w/ AHCI and ADMA in the kernel it consistantly panic'd w/ scsi errors and such particularly while writing to to disk.  I guess this could be ADMA? but i dont know.  this is with p4c800 and WD1200JD-00G (western digital 120 cavilier) and a ST3200822AS (older seagate), both on the intel.  i couldn't get a read out from theses.  On a P5AD2 w/ two newer seagates on the intel i read the harddrive temperature and it told me other things.  this didn't have the problem w/ the panics at all.  the only real difference between the these was the kernel build (P5AD2 was a clone, which left today)  :Sad:   the western digital can't take higher pci clocks like the seagates.  wd all around eats it and prob said it was spinning backwards or something.

EDIT

the smart might be disabled in my bios.  ill try it again when i get it enabled.

EDIT 

i don't have to. hehehe ignore me.  both disks passed!!!

EDIT

ill still have to wait for my bios unless hddtemp can turn it on too, or if i can figure a way to keep it on w/ smartctl, before i can check dmesg.Last edited by augury on Thu Jul 14, 2005 8:18 am; edited 3 times in total

----------

## augury

ironicly the P5AD2 doesnt know what kind of moose it has on it and the wheel doesnt work unless i use a special logitech mouse.

this patch and mm-sources differ in about 3 lines and placement in ahci.c. (mm-sources is less)

----------

## augury

is there smart for the regular scsi disks too?

----------

## assaf

BTW, is anyone else getting this?

```
hdparm -C /dev/sda
```

returns 

```
drive state is: standby
```

although the drive is definately spinning

----------

## R!tman

 *assaf wrote:*   

> BTW, is anyone else getting this?
> 
> ```
> hdparm -C /dev/sda
> ```
> ...

 

Yes, I get this too. 

Another question: Has anyone found a patch where dmesg is not flooded by hddtemp?

----------

## gregp01

With the libata passthru patch (here), both hddtemp and smartctl work successfully for me. However, hddtemp causes lots and lots (several for each SATA port) of these error messages to appear in the kernel log:

```
ata1: translated ATA stat/err 0xec/00 to SCSI SK/ASC/ASCQ 0xb/47/00

ata1: translated ATA stat/err 0xec/00 to SCSI SK/ASC/ASCQ 0xb/47/00

ata1: translated ATA stat/err 0xb0/00 to SCSI SK/ASC/ASCQ 0xb/47/00

ata1: translated ATA stat/err 0xb0/00 to SCSI SK/ASC/ASCQ 0xb/47/00

ata2: translated ATA stat/err 0xec/00 to SCSI SK/ASC/ASCQ 0xb/47/00

ata2: translated ATA stat/err 0xec/00 to SCSI SK/ASC/ASCQ 0xb/47/00

ata2: translated ATA stat/err 0xb0/00 to SCSI SK/ASC/ASCQ 0xb/47/00

ata2: translated ATA stat/err 0xb0/00 to SCSI SK/ASC/ASCQ 0xb/47/00

ata3: translated ATA stat/err 0xec/00 to SCSI SK/ASC/ASCQ 0xb/47/00

ata3: translated ATA stat/err 0xec/00 to SCSI SK/ASC/ASCQ 0xb/47/00

ata3: translated ATA stat/err 0xb0/00 to SCSI SK/ASC/ASCQ 0xb/47/00

ata3: translated ATA stat/err 0xb0/00 to SCSI SK/ASC/ASCQ 0xb/47/00

ata4: translated ATA stat/err 0xec/00 to SCSI SK/ASC/ASCQ 0xb/47/00

ata4: translated ATA stat/err 0xec/00 to SCSI SK/ASC/ASCQ 0xb/47/00

ata4: translated ATA stat/err 0xb0/00 to SCSI SK/ASC/ASCQ 0xb/47/00

ata4: translated ATA stat/err 0xb0/00 to SCSI SK/ASC/ASCQ 0xb/47/00
```

They seem to be harmless, in that everything keeps running and no data appears to be corrupted. Does anyone know what these mean? A Google search seems to imply that they're merely notifications of ATA to SCSI command translation. Would it be safe to hack the libata code to suppress these?

----------

## golloza

Could anyone of you who has the git-libata-passthru.patch applied (or is running a recent -mm kernel) and has a SATA disk try the following:

```

tail -f /var/log/messages &

smartctl -d ata -o on /dev/sdX

and/or

smartctl -d ata -S on /dev/sdX

```

These are the only SMART features that don't work with my setup (Samsung disk attached to a Sil3112a, afromentioned patch), it gives me these errors:

```
Aug 20 12:28:44 elbarton ata2: PIO error, drv_stat 0x51

Aug 20 12:28:44 elbarton ata2: translated ATA stat/err 0xb0/00 to SCSI SK/ASC/ASCQ 0xb/47/00

Aug 20 12:28:44 elbarton ata2: status=0xb0 { Busy }

Aug 20 12:28:44 elbarton ata2: PIO error, drv_stat 0x51

Aug 20 12:28:44 elbarton ata2: translated ATA stat/err 0xb0/00 to SCSI SK/ASC/ASCQ 0xb/47/00

Aug 20 12:28:44 elbarton ata2: status=0xb0 { Busy }

Aug 20 12:28:44 elbarton ata2: PIO error, drv_stat 0x51

Aug 20 12:28:44 elbarton ata2: translated ATA stat/err 0xb0/00 to SCSI SK/ASC/ASCQ 0xb/47/00

Aug 20 12:28:44 elbarton ata2: status=0xb0 { Busy }

Aug 20 12:28:44 elbarton : Current [descriptor]: sense key: Aborted Command

Aug 20 12:28:44 elbarton Additional sense: Scsi parity error

Aug 20 12:28:44 elbarton Descriptor sense data with sense descriptors (in hex):

Aug 20 12:28:44 elbarton 72 0b 47 00 00 00 00 0e 09 0e 00 db 00 f8 00 00

Aug 20 12:28:44 elbarton 00 4f 00 c2 00 b0
```

Thanks.

----------

## tnt

Is there any patch that could be used with 2.6.13 sources ?

 :Rolling Eyes: 

----------

## R!tman

 *tnt wrote:*   

> Is there any patch that could be used with 2.6.13 sources ?
> 
> 

 

I guess when you ask, it is not in the official kernel tree, right? I had hoped that...

----------

## tnt

Me, too, but as far as I can see, smartctl doesn't give anything usefull with gentoo-sources-2.6.13

```
master rrd # smartctl -A --device=ata /dev/sda

smartctl version 5.33 [x86_64-pc-linux-gnu] Copyright (C) 2002-4 Bruce Allen

Home page is http://smartmontools.sourceforge.net/

Smartctl: Device Read Identity Failed (not an ATA/ATAPI device)

A mandatory SMART command failed: exiting. To continue, add one or more '-T permissive' options.

master rrd # smartctl -T permissive -A --device=ata /dev/sda

smartctl version 5.33 [x86_64-pc-linux-gnu] Copyright (C) 2002-4 Bruce Allen

Home page is http://smartmontools.sourceforge.net/

Smartctl: Device Read Identity Failed (not an ATA/ATAPI device)

SMART support is: Ambiguous - ATA IDENTIFY DEVICE words 82-83 don't show if SMART supported.

A mandatory SMART command failed: exiting. To continue, add one or more '-T permissive' options.

master rrd #
```

And it has been working great with patched 2.6.12-r6...  :Sad: 

----------

## tnt

got smartctl working again with 

http://www.kernel.org/pub/linux/kernel/people/jgarzik/libata/2.6.13-rc7-libata1.patch.bz2

and gentoo-sources 2.6.13-r3, but it doesn't apply cleanly (some things are already applied in gentoo-sources)

----------

## R!tman

I works for me, too. Unfortunately, dmesg is still filled with error messages.

@tnt: Did Jeff Garzik ever answer to your email?

----------

## tnt

 *R!tman wrote:*   

> @tnt: Did Jeff Garzik ever answer to your email?

 

nope   :Sad: 

----------

## gringo

The passthru + other libata related stuff have been in the -mm patches for a a while now; so, the latest patch im aware of is:

http://www.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.14-rc2/2.6.14-rc2-mm2/broken-out/git-libata-all.patch

Try this one, maybe that helps a bit, i dont have much crap in my dmesg  :Wink: 

cheers

----------

## tnt

What does this "broken-out" part in the link means?  :Very Happy: 

----------

## gringo

 *tnt wrote:*   

> What does this "broken-out" part in the link means? 

 

all patches in that directory are the splitted patches for -mm2  :Wink: 

cheers

----------

## R!tman

 *gringo wrote:*   

> The passthru + other libata related stuff have been in the -mm patches for a a while now; so, the latest patch im aware of is:
> 
> http://www.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.14-rc2/2.6.14-rc2-mm2/broken-out/git-libata-all.patch
> 
> Try this one, maybe that helps a bit, i dont have much crap in my dmesg 
> ...

 

The patch applies cleanly, but the kernel does not compile then, at least for me. But anyway, thanks  :Wink: .

----------

## gringo

 *Quote:*   

> The patch applies cleanly, but the kernel does not compile then, at least for me. But anyway, thanks 

 

then you should report upstream, -mm is the test arena for mainline ! Never had a similiar problem BTW;  it always compiled at least   :Wink: 

cheers

----------

## El_Presidente_Pufferfish

 *gregp01 wrote:*   

> With the libata passthru patch (here), both hddtemp and smartctl work successfully for me. However, hddtemp causes lots and lots (several for each SATA port) of these error messages to appear in the kernel log:
> 
> ```
> ata1: translated ATA stat/err 0xec/00 to SCSI SK/ASC/ASCQ 0xb/47/00
> 
> ...

 

Was this ever fixed?  Is it safe to just change the code so it doesn't output this?

It sucks not being able to use dmesg since this spams it pretty quickly after booting

----------

## tnt

Has anyone tried 2.6.14 kernel?

----------

## R!tman

 *El_Presidente_Pufferfish wrote:*   

>  *gregp01 wrote:*   With the libata passthru patch (here), both hddtemp and smartctl work successfully for me. However, hddtemp causes lots and lots (several for each SATA port) of these error messages to appear in the kernel log:
> 
> ```
> ata1: translated ATA stat/err 0xec/00 to SCSI SK/ASC/ASCQ 0xb/47/00
> 
> ...

 

I still have this. Quite annoying. 

Do you know how to change the code? I would appreciate it.

 *tnt wrote:*   

> Has anyone tried 2.6.14 kernel?

 

Nope, I'm waiting for the gentoo-sources to arrive at 2.6.14.

----------

## El_Presidente_Pufferfish

 *tnt wrote:*   

> Has anyone tried 2.6.14 kernel?

 

I'm running 2.6.14 with the broken out patch from -mm 2.6.14_rc4 i think

----------

## El_Presidente_Pufferfish

 *R!tman wrote:*   

> Do you know how to change the code? I would appreciate it.

 

I imagine you just comment out this printk line in the patch

```
+ translate_done:

+       printk(KERN_ERR "ata%u: translated ATA stat/err 0x%02x/%02x to "

+              "SCSI SK/ASC/ASCQ 0x%x/%02x/%02x\n", id, drv_stat, drv_err,

+              *sk, *asc, *ascq);

+       return;

```

----------

## R!tman

 *El_Presidente_Pufferfish wrote:*   

>  *R!tman wrote:*   Do you know how to change the code? I would appreciate it. 
> 
> I imagine you just comment out this printk line in the patch
> 
> ```
> ...

 

I tried to delete these lines out, but I got this when I applied the patch:

```
# patch -p1 <../test-libata.patch 

patching file drivers/scsi/Kconfig

patching file drivers/scsi/Makefile

patching file drivers/scsi/ahci.c

patching file drivers/scsi/ata_adma.c

patching file drivers/scsi/ata_piix.c

patching file drivers/scsi/libata-core.c

Hunk #24 FAILED at 3987.

1 out of 24 hunks FAILED -- saving rejects to file drivers/scsi/libata-core.c.rej

patching file drivers/scsi/libata-scsi.c

patch: **** malformed patch at line 2092: @@ -392,6 +674,60 @@ int ata_scsi_error(struct Scsi_Host *hos

```

----------

## El_Presidente_Pufferfish

did you delete all of them?  I just meant to comment out the printk line

I really have no idea if even that would work though  :Very Happy: 

edit - yeah, commenting out the printk line with /* */ compiles at least.

I'll see if it works/destroys my system when i reboot

----------

## gringo

good news guys  :Very Happy: 

 *Jeff Garzik wrote:*   

> With the integration of ATA passthru in kernel 2.6.15, SMART is fully supported in the standard libata driver.

 

http://linux.yyz.us/sata/software-status.html

cheers

----------

## R!tman

 *gringo wrote:*   

> good news guys 
> 
>  *Jeff Garzik wrote:*   With the integration of ATA passthru in kernel 2.6.15, SMART is fully supported in the standard libata driver. 
> 
> http://linux.yyz.us/sata/software-status.html
> ...

 

Yeah, thanks for the info. That's good new! Althought it will take some time for gentoo-sources to jump to 2.6.15. Maybe next year.

----------

## tnt

And maybe soon enough we will see SATA NCQ support in the official tree...  :Very Happy: 

----------

## assaf

 *gringo wrote:*   

> good news guys 
> 
>  *Jeff Garzik wrote:*   With the integration of ATA passthru in kernel 2.6.15, SMART is fully supported in the standard libata driver. 
> 
> http://linux.yyz.us/sata/software-status.html
> ...

 

Yay! It's about time

----------

## Pandor

Anyone got this to work on gentoo-sources-2.6.14-r5?

since i couldn't find a patch for 2.6.14 at http://www.kernel.org/pub/linux/kernel/people/jgarzik/libata/ i downloaded the mm2 patch from http://www.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.14/2.6.14-mm2/broken-out/git-libata-all.patch .

i copied it to /usr/src/linux/git-libata-all.patch and ran

```
# patch -p1 < git-libata-all.patch
```

 but this didn't work.

I got a lot of "Hunk #x FAILED at xxx" errors and got some "can't find file to patch at input line xx"

any help would be apreciated.

----------

## R!tman

 *Pandor wrote:*   

> Anyone got this to work on gentoo-sources-2.6.14-r5?
> 
> since i couldn't find a patch for 2.6.14 at http://www.kernel.org/pub/linux/kernel/people/jgarzik/libata/ i downloaded the mm2 patch from http://www.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.14/2.6.14-mm2/broken-out/git-libata-all.patch .
> 
> i copied it to /usr/src/linux/git-libata-all.patch and ran
> ...

 

Why don't you try gentoo-sources-2.6.15? They're marked ~x86, ~amd64, ... but with them all the smart stuff should work.

----------

## tnt

smart on sata works "out-of-the-box" with 2.6.15   :Wink: 

----------

## R!tman

 *tnt wrote:*   

> smart on sata works "out-of-the-box" with 2.6.15  

 

I can confirm that. This post has been solved then, finally!

But maybe not completely...

There are still issues with SATA. eg, on a thinkpad t43(p) (and probably other sata notebooks) you will need this patch to be able to resume from suspend to ram. This is iirc a smart issue and has to do with powermanagement. Also see here or here.

EDIT: The sata-resume-from-suspend-issue has been solved since 2.6.15-r1.

----------

