kasbert / OS-X-SAT-SMART-Driver

Max OS X kernel driver for providing access to external drive SMART data
578 stars 74 forks source link

Not exposing full SMART featuresets. #2

Closed mfisch closed 12 years ago

mfisch commented 12 years ago

This driver is a great idea, still need some work.

Apple doesn't pay much attention to SMART -- as can be seen by the lack of any periodic SMART polling (with limited interface via disk utility).

I use SMART Utility to periodically poll my internal drives, and while I can issue -T verypermissive to smartctl (the command line tool underpinning SMART Utility) I can't get back any data on my USB drives using this driver except "SMART Verified". Disk utility does pick up on the SMART Verified variable as well.

I can apparently turn SMART on and off using smartctl, but I have no exposure to the rest of the disk variables or feature sets. No runtime hours, no SMART testing, etc.

Is this a limitation of the driver (which understandably isn't complete) or the enclosures I'm using?

One of my enclosures is a WD MyBook (the kind with two drives and hardware RAID). I guess it isn't surprising I don't have visibility to full SMART there since the drives are abstracted.

Second enclosure is a StarTech.com 2-drive USB3.0 dock. Each drive shows up independently.

Thoughts/comments? README wasn't very fleshed, so expectedly there are people like me who need to ask inane questions about the driver.

Would it be helpful for me to track down chipsets?

kasbert commented 12 years ago

As the DiskUtility reports smart capability, it should work. I have 3 different disk enclosures and all of them work just fine. I don't use the smartctl command directly, instead I use SmartReporter application to monitor the statuses (select disk in prefences and "Check S.M.A.R.T attributes" from disk right button menu). I have no problems in getting the attributes:

$ smartctl -a disk1 smartctl 5.42 2011-10-20 r3458 [i386-apple-darwin10.8.0](local build) Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net

=== START OF INFORMATION SECTION === Model Family: Western Digital Caviar Green Device Model: WDC WD10EAVS-00D7B1 Serial Number: WD-XXX LU WWN Device Id: 5 0014ee 156f6b95b Firmware Version: 01.01A01 User Capacity: 1.000.204.886.016 bytes [1,00 TB] Sector Size: 512 bytes logical/physical Device is: In smartctl database [for details use: -P show] ATA Version is: 8 ATA Standard is: Exact ATA specification draft version not indicated Local Time is: Sun Apr 29 20:11:15 2012 EEST 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: (0x84) Offline data collection activity was suspended by an interrupting command from host. 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: (22800) seconds. Offline data collection capabilities: (0x7b) SMART execute Offline immediate. Auto Offline data collection on/off support. Suspend Offline collection upon new command. Offline surface scan supported. Self-test supported. 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. General Purpose Logging supported. Short self-test routine recommended polling time: ( 2) minutes. Extended self-test routine recommended polling time: ( 255) minutes. Conveyance self-test routine recommended polling time: ( 5) minutes. SCT capabilities: (0x303f) SCT Status supported. SCT Error Recovery Control supported. SCT Feature Control supported. SCT Data Table supported.

SMART Attributes Data Structure revision number: 16 Vendor Specific SMART Attributes with Thresholds: ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE 1 Raw_Read_Error_Rate 0x002f 200 200 051 Pre-fail Always - 0 3 Spin_Up_Time 0x0027 158 152 021 Pre-fail Always - 7058 4 Start_Stop_Count 0x0032 098 098 000 Old_age Always - 2359 5 Reallocated_Sector_Ct 0x0033 200 200 140 Pre-fail Always - 0 7 Seek_Error_Rate 0x002e 100 253 000 Old_age Always - 0 9 Power_On_Hours 0x0032 097 097 000 Old_age Always - 2631 10 Spin_Retry_Count 0x0032 100 100 000 Old_age Always - 0 11 Calibration_Retry_Count 0x0032 100 253 000 Old_age Always - 0 12 Power_Cycle_Count 0x0032 100 100 000 Old_age Always - 34 192 Power-Off_Retract_Count 0x0032 200 200 000 Old_age Always - 3 193 Load_Cycle_Count 0x0032 200 200 000 Old_age Always - 2359 194 Temperature_Celsius 0x0022 098 088 000 Old_age Always - 52 196 Reallocated_Event_Count 0x0032 200 200 000 Old_age Always - 0 197 Current_Pending_Sector 0x0032 200 200 000 Old_age Always - 0 198 Offline_Uncorrectable 0x0030 200 200 000 Old_age Offline - 0 199 UDMA_CRC_Error_Count 0x0032 200 200 000 Old_age Always - 0 200 Multi_Zone_Error_Rate 0x0008 200 200 000 Old_age Offline - 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% 1094 -

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.

killerovsky commented 12 years ago

Read SMART attributes doesn't work on 64-bit kernels (Lion).

Also your 32-bit kext (32-bit kernel) doesn't work with 64-bit apps, identify device fails with kIOReturnBadArgument error code (0xe00002c2).

killerovsky commented 12 years ago

About case with "32-bit-kext <--> 64 bit app" - imho most probable reason is that ATAGetIdentifyDataStruct in 32-bit kernel space and in 64-bit user space have quite different size.

mfisch commented 12 years ago

Can you help me refine the technical summary of this issue for future development in case kasbert or someone else continues development?

My internal drives work fine on lion, so I assume this needs additional work. (not just being compiled 64 for lion).

Matt On Apr 29, 2012 2:24 PM, "killerovsky" < reply@reply.github.com> wrote:

Read SMART attributes doesn't work on 64-bit kernels (Lion).

Also your 32-bit kext (32-bit kernel) doesn't work with 64-bit apps, identify device fails with kIOReturnBadArgument error code (0xe00002c2).


Reply to this email directly or view it on GitHub:

https://github.com/kasbert/OS-X-SAT-SMART-Driver/issues/2#issuecomment-5407292

kasbert commented 12 years ago

I guess you are right, killerovsky. I'll try refining IOConnectCallStructMethod calls. Maybe one should use the output argument for buffer, instead of giving a pointer in input argument.

kasbert commented 12 years ago

Please try version 0.3. There is some issue with file permissions and installer will complain. Try installing twice.

killerovsky commented 12 years ago

Thanks for new version. Unfortunately new installation doesn't work. Even on second or third installation try. On first try I get error message, on any next try - installation completes silently without errors, but kext doesn't work after restart - on external USB-drive connection - system always shows this message box: https://img.skitch.com/20120501-pg8q1ge5q317hsgspetbebyr2.png.

My system info: MacBookPro 5,5 Mac OS X 10.6.8 (10K549) 32-bit kernel

P.S. I will try (later today or tomorrow) to build new version from sources and install it manually and report the results.

kasbert commented 12 years ago

Try as root: kextutil -t /System/Library/Extensions/SATSMARTDriver.kext/ If it complains about file permissions, fix them manually: chmod -R go-w /System/Library/Extensions/SATSMART* Then run again: kextutil -t /System/Library/Extensions/SATSMARTDriver.kext/

I don't know why the PackageMaker won't set the permissions correctly. The configuration should be correct and it used to work earlier.

killerovsky commented 12 years ago

I have build new version from sources and successfully installed it manually. And I can say that 'identify device' issue is fixed (32-bit kernel <-> 64-bit app). But SMARTReadData doesn't work for 64-bit clients. I already reported this issue for Lion (64-bit kernel). But now it looks like that bug is somewhere in 64-bit user space client library.

Here is debug log: smartctl 5.42 (build date Mar 11 2012) [x86_64-apple-darwin10.8.0](local build) Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net

SATSMARTLibFactory called SATSMARTClient::alloc called SATSMARTClient : QueryInterface called kIOCFPlugInInterfaceID requested SATSMARTClient::Probe called SATSMARTClient::Probe called 0 SATSMARTClient : Start SATSMARTClient : IOServiceOpen status = 0x00000000, connection = 5135 SATSMARTClient : QueryInterface called kIOATASMARTInterfaceID requested SATSMARTClient::GetATAIdentifyData 0x200 SATSMARTClient::GetATAIdentifyData status = 0 SATSMARTClient::SMARTReadData called SATSMARTClient::SMARTReadData status = -536870178 Error SMART Values Read failed: Unknown error: 0 Smartctl: SMART Read Values failed.

Kernel debug log: May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: IOSATServices[0x1bfd2100]::newUserClient type 12 May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: IOSATServices[0x1bfd2100]::newUserClient client class 0x1c464780 May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: IOSATServices[0x1bfd2100]::newUserClient client 0x30004 May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: SATSMARTUserClient[0x1bd10100]::initWithTask task = 0xf4aabb8 May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: SATSMARTUserClient[0x1bd10100]::start May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: IOSATServices[0x1bfd2100]::handleOpen May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: IOSATServices[0x1bfd2100]::handleOpen result 1 May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: IOSATServices[0x1bfd2100]::newUserClient result 0 May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: SATSMARTUserClient[0x1bd10100]::getTargetAndMethodForIndex index 8 May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: SATSMARTUserClient[0x1bd10100]::GetIdentifyData 0x974cae3c(-1756582796) May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: SATSMARTUserClient[0x1bd10100]::AllocateCommand May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: SATSMARTUserClient[0x1bd10100]::SendSMARTCommand May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: IOSATServices[0x1bfd2100]::sendSMARTCommand May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: IOSATDriver[0x1c5d4a00]::sendSMARTCommand May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: buffer 0x1bfcdd80 May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: bytecount 512 May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: features 0 May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: opcode 1 May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: timeout 30000 May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: sector count 0 May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: sector num 0 May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: cyllo 0 May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: cylhi 0 May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: device 0 May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: command ec May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: flags 2000 May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: IOSATDriver[0x1c5d4a00]::sendSMARTCommand direction 1, count 1, protocol 4 May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: IOSATDriver[0x1c5d4a00]::PASS_THROUGH_12 May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: IOSATDriver[0x1c5d4a00]::PASS_THROUGH_12 result 1 May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: IOSATDriver[0x1c5d4a00]::sendSMARTCommand success, service response 2, task status 0 May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: SATSMARTUserClient::sCommandCallback command 0x1c455f00 May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: IOSATDriver[0x1c5d4a00]::sendSMARTCommand result 0 0 success May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: IOSATServices[0x1bfd2100]::sendSMARTCommand result 0 May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: SATSMARTUserClient[0x1bd10100]::GatedWaitForCommand May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: SATSMARTUserClient[0x1bd10100]::GatedWaitForCommand result 0 May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: SATSMARTUserClient[0x1bd10100]::SendSMARTCommand result 0 May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: SATSMARTUserClient[0x1bd10100]::GetIdentifyData cpy 0x200 0x200 May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: SATSMARTUserClient[0x1bd10100]::DeallocateCommand May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: SATSMARTUserClient[0x1bd10100]::GetIdentifyData result 0 May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: SATSMARTUserClient[0x1bd10100]::getTargetAndMethodForIndex index 4 May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: SATSMARTUserClient[0x1bd10100]::ReadData data = 0x5fbfd0e0 May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: SATSMARTUserClient[0x1bd10100]::AllocateCommand May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: SATSMARTUserClient[0x1bd10100]::ReadData prepare 0xe00002de May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: SATSMARTUserClient[0x1bd10100]::DeallocateCommand May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: SATSMARTUserClient[0x1bd10100]::ReadData result -536870178 May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: SATSMARTUserClient[0x1bd10100]::clientClose May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: SATSMARTUserClient[0x1bd10100]::HandleTerminate May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: IOSATServices[0x1bfd2100]::handleIsOpen client 0x1bd10100 May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: SATSMARTUserClient[0x1bd10100]::HandleTerminate closing provider May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: IOSATServices[0x1bfd2100]::handleIsOpen client 0x1bd10100 May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: IOSATServices[0x1bfd2100]::handleClose May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: SATSMARTUserClient[0x1bd10100]::HandleTerminate result 0 May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: SATSMARTUserClient[0x1bd10100]::clientClose

mfisch commented 12 years ago

Jarkko,

Confirm, tested on Lion and getting similar results to before. Had to manually fix permissions as you said. Can see smart status but not smart values. Feel free to package just the kernel extension next time for testing and forego the package manager issues until you have a stable driver you want to package.

bootnote: I can see the smart test log structure for one of the drives -- though I can't initiate any tests. Not sure if this worked previously. Let me know if there's any information I can gather that would be useful.

sh-3.2# ./smartctl -T verypermissive -a disk6 smartctl 5.41 2011-06-09 r3365 [x86_64-apple-darwin10.8.0](local build) Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net

=== START OF INFORMATION SECTION === Model Family: Hitachi Deskstar 7K1000.B Device Model: Hitachi HDT721064SLA360 Serial Number: STFD03MG157NHK LU WWN Device Id: 5 000cca 348d07a1e Firmware Version: ST0KA36A User Capacity: 640,135,028,736 bytes [640 GB] Sector Size: 512 bytes logical/physical Device is: In smartctl database [for details use: -P show] ATA Version is: 8 ATA Standard is: ATA-8-ACS revision 4 Local Time is: Tue May 1 11:53:35 2012 EDT SMART support is: Available - device has SMART capability. SMART support is: Enabled

Error SMART Values Read failed: Undefined error: 0 Smartctl: SMART Read Values failed.

=== START OF READ SMART DATA SECTION === SMART overall-health self-assessment test result: PASSED

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 Short offline Completed without error 00% 4647 -

2 Extended offline Completed without error 00% 4240 -

3 Short offline Completed without error 00% 4237 -

Device does not support Selective Self Tests/Logging

On May 1, 2012, at 11:50 AM, killerovsky wrote:

I have build new version from sources and successfully installed it manually. And I can say that 'identify device' issue is fixed (32-bit kernel <-> 64-bit app). But SMARTReadData doesn't work for 64-bit clients. I already reported this issue for Lion (64-bit kernel). But now it looks like that bug is somewhere in 64-bit user space client library.

Here is debug log: smartctl 5.42 (build date Mar 11 2012) [x86_64-apple-darwin10.8.0](local build) Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net

SATSMARTLibFactory called SATSMARTClient::alloc called SATSMARTClient : QueryInterface called kIOCFPlugInInterfaceID requested SATSMARTClient::Probe called SATSMARTClient::Probe called 0 SATSMARTClient : Start SATSMARTClient : IOServiceOpen status = 0x00000000, connection = 5135 SATSMARTClient : QueryInterface called kIOATASMARTInterfaceID requested SATSMARTClient::GetATAIdentifyData 0x200 SATSMARTClient::GetATAIdentifyData status = 0 SATSMARTClient::SMARTReadData called SATSMARTClient::SMARTReadData status = -536870178 Error SMART Values Read failed: Unknown error: 0 Smartctl: SMART Read Values failed.

Kernel debug log: May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: IOSATServices[0x1bfd2100]::newUserClient type 12 May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: IOSATServices[0x1bfd2100]::newUserClient client class 0x1c464780 May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: IOSATServices[0x1bfd2100]::newUserClient client 0x30004 May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: SATSMARTUserClient[0x1bd10100]::initWithTask task = 0xf4aabb8 May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: SATSMARTUserClient[0x1bd10100]::start May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: IOSATServices[0x1bfd2100]::handleOpen May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: IOSATServices[0x1bfd2100]::handleOpen result 1 May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: IOSATServices[0x1bfd2100]::newUserClient result 0 May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: SATSMARTUserClient[0x1bd10100]::getTargetAndMethodForIndex index 8 May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: SATSMARTUserClient[0x1bd10100]::GetIdentifyData 0x974cae3c(-1756582796) May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: SATSMARTUserClient[0x1bd10100]::AllocateCommand May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: SATSMARTUserClient[0x1bd10100]::SendSMARTCommand May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: IOSATServices[0x1bfd2100]::sendSMARTCommand May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: IOSATDriver[0x1c5d4a00]::sendSMARTCommand May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: buffer 0x1bfcdd80 May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: bytecount 512 May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: features 0 May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: opcode 1 May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: timeout 30000 May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: sector count 0 May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: sector num 0 May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: cyllo 0 May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: cylhi 0 May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: device 0 May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: command ec May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: flags 2000 May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: IOSATDriver[0x1c5d4a00]::sendSMARTCommand direction 1, count 1, protocol 4 May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: IOSATDriver[0x1c5d4a00]::PASS_THROUGH_12 May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: IOSATDriver[0x1c5d4a00]::PASS_THROUGH_12 result 1 May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: IOSATDriver[0x1c5d4a00]::sendSMARTCommand success, service response 2, task status 0 May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: SATSMARTUserClient::sCommandCallback command 0x1c455f00 May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: IOSATDriver[0x1c5d4a00]::sendSMARTCommand result 0 0 success May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: IOSATServices[0x1bfd2100]::sendSMARTCommand result 0 May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: SATSMARTUserClient[0x1bd10100]::GatedWaitForCommand May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: SATSMARTUserClient[0x1bd10100]::GatedWaitForCommand result 0 May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: SATSMARTUserClient[0x1bd10100]::SendSMARTCommand result 0 May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: SATSMARTUserClient[0x1bd10100]::GetIdentifyData cpy 0x200 0x200 May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: SATSMARTUserClient[0x1bd10100]::DeallocateCommand May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: SATSMARTUserClient[0x1bd10100]::GetIdentifyData result 0 May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: SATSMARTUserClient[0x1bd10100]::getTargetAndMethodForIndex index 4 May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: SATSMARTUserClient[0x1bd10100]::ReadData data = 0x5fbfd0e0 May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: SATSMARTUserClient[0x1bd10100]::AllocateCommand May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: SATSMARTUserClient[0x1bd10100]::ReadData prepare 0xe00002de May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: SATSMARTUserClient[0x1bd10100]::DeallocateCommand May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: SATSMARTUserClient[0x1bd10100]::ReadData result -536870178 May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: SATSMARTUserClient[0x1bd10100]::clientClose May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: SATSMARTUserClient[0x1bd10100]::HandleTerminate May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: IOSATServices[0x1bfd2100]::handleIsOpen client 0x1bd10100 May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: SATSMARTUserClient[0x1bd10100]::HandleTerminate closing provider May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: IOSATServices[0x1bfd2100]::handleIsOpen client 0x1bd10100 May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: IOSATServices[0x1bfd2100]::handleClose May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: SATSMARTUserClient[0x1bd10100]::HandleTerminate result 0 May 1 18:37:07 Killer-MacBook-Pro-2 kernel[0]: SATSMARTUserClient[0x1bd10100]::clientClose


Reply to this email directly or view it on GitHub: https://github.com/kasbert/OS-X-SAT-SMART-Driver/issues/2#issuecomment-5441341

Vartkat commented 12 years ago

Hello,

I'm on a PWB 15 (model 3.1) on OS 10.6.8. Installed 0.3 and get the same message as killerovsky.

Succeeded in making the driver work by using the command lines with kextutil and chmod.

Here are the results on too USB drives using smartctl 5.41 (the version in SMARTReporter 2.72 /Applications/SMARTReporter/SMARTReporter.app/Contents/Resources) :

LaCie Rikiki USB 2.0 500 Go gives

$ ./smartctl -a /dev/disk1 smartctl 5.41 2011-04-06 r3314 [i386-apple-darwin9.8.0](local build) Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net

=== START OF INFORMATION SECTION === Model Family: Seagate Momentus 5400.6 series Device Model: ST9500325AS Serial Number: XXXXXXX LU WWN Device Id: 5 000c50 038d89a94 Firmware Version: 0002BSM1 User Capacity: 500,107,862,016 bytes [500 GB] Device is: In smartctl database [for details use: -P show] ATA Version is: 8 ATA Standard is: ATA-8-ACS revision 4 Local Time is: Wed May 2 00:21:17 2012 CEST SMART support is: Available - device has SMART capability. SMART support is: Enabled

Error SMART Values Read failed Smartctl: SMART Read Values failed.

=== START OF READ SMART DATA SECTION === SMART overall-health self-assessment test result: PASSED

SMART Error Log Version: 1 No Errors Logged

SMART Self-test log structure revision number 1 No self-tests have been logged. [To run self-tests, use: smartctl -t]

Device does not support Selective Self Tests/Logging

THEN $ ./smartctl -P show /dev/disk1 smartctl 5.41 2011-04-06 r3314 [i386-apple-darwin9.8.0](local build) Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net

ATA device successfully opened

Use 'smartctl -a' (or '-x') to print SMART (and more) information

THEN $ ./smartctl -x /dev/disk1 smartctl 5.41 2011-04-06 r3314 [i386-apple-darwin9.8.0](local build) Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net

=== START OF INFORMATION SECTION === Model Family: Seagate Momentus 5400.6 series Device Model: ST9500325AS Serial Number: XXXXXXXX LU WWN Device Id: 5 000c50 038d89a94 Firmware Version: 0002BSM1 User Capacity: 500,107,862,016 bytes [500 GB] Device is: In smartctl database [for details use: -P show] ATA Version is: 8 ATA Standard is: ATA-8-ACS revision 4 Local Time is: Wed May 2 00:24:32 2012 CEST SMART support is: Available - device has SMART capability. SMART support is: Enabled

Error SMART Values Read failed Smartctl: SMART Read Values failed.

=== START OF READ SMART DATA SECTION === SMART overall-health self-assessment test result: PASSED

ATA_READ_LOG_EXT (addr=0x00:0x00, page=0, n=1) failed: 48-bit ATA commands not supported Read GP Log Directory failed.

SMART Log Directory Version 1 [multi-sector log support] SMART Log at address 0x00 has 1 sectors [Log Directory] SMART Log at address 0x01 has 1 sectors [Summary SMART error log] SMART Log at address 0x02 has 5 sectors [Comprehensive SMART error log] SMART Log at address 0x03 has 5 sectors [Ext. Comprehensive SMART error log] SMART Log at address 0x06 has 1 sectors [SMART self-test log] SMART Log at address 0x07 has 1 sectors [Extended self-test log] SMART Log at address 0x09 has 1 sectors [Selective self-test log] SMART Log at address 0x10 has 1 sectors [NCQ Command Error] SMART Log at address 0x11 has 1 sectors [SATA Phy Event Counters] SMART Log at address 0x21 has 1 sectors [Write stream error log] SMART Log at address 0x22 has 1 sectors [Read stream error log] SMART Log at address 0x80 has 16 sectors [Host vendor specific log] SMART Log at address 0x81 has 16 sectors [Host vendor specific log] SMART Log at address 0x82 has 16 sectors [Host vendor specific log] SMART Log at address 0x83 has 16 sectors [Host vendor specific log] SMART Log at address 0x84 has 16 sectors [Host vendor specific log] SMART Log at address 0x85 has 16 sectors [Host vendor specific log] SMART Log at address 0x86 has 16 sectors [Host vendor specific log] SMART Log at address 0x87 has 16 sectors [Host vendor specific log] SMART Log at address 0x88 has 16 sectors [Host vendor specific log] SMART Log at address 0x89 has 16 sectors [Host vendor specific log] SMART Log at address 0x8a has 16 sectors [Host vendor specific log] SMART Log at address 0x8b has 16 sectors [Host vendor specific log] SMART Log at address 0x8c has 16 sectors [Host vendor specific log] SMART Log at address 0x8d has 16 sectors [Host vendor specific log] SMART Log at address 0x8e has 16 sectors [Host vendor specific log] SMART Log at address 0x8f has 16 sectors [Host vendor specific log] SMART Log at address 0x90 has 16 sectors [Host vendor specific log] SMART Log at address 0x91 has 16 sectors [Host vendor specific log] SMART Log at address 0x92 has 16 sectors [Host vendor specific log] SMART Log at address 0x93 has 16 sectors [Host vendor specific log] SMART Log at address 0x94 has 16 sectors [Host vendor specific log] SMART Log at address 0x95 has 16 sectors [Host vendor specific log] SMART Log at address 0x96 has 16 sectors [Host vendor specific log] SMART Log at address 0x97 has 16 sectors [Host vendor specific log] SMART Log at address 0x98 has 16 sectors [Host vendor specific log] SMART Log at address 0x99 has 16 sectors [Host vendor specific log] SMART Log at address 0x9a has 16 sectors [Host vendor specific log] SMART Log at address 0x9b has 16 sectors [Host vendor specific log] SMART Log at address 0x9c has 16 sectors [Host vendor specific log] SMART Log at address 0x9d has 16 sectors [Host vendor specific log] SMART Log at address 0x9e has 16 sectors [Host vendor specific log] SMART Log at address 0x9f has 16 sectors [Host vendor specific log] SMART Log at address 0xa1 has 20 sectors [Device vendor specific log] SMART Log at address 0xa8 has 65 sectors [Device vendor specific log] SMART Log at address 0xa9 has 1 sectors [Device vendor specific log] SMART Log at address 0xc0 has 1 sectors [Device vendor specific log] SMART Log at address 0xe0 has 1 sectors [SCT Command/Status] SMART Log at address 0xe1 has 1 sectors [SCT Data Transfer]

SMART Extended Comprehensive Error Log (GP Log 0x03) not supported SMART Error Log Version: 1 No Errors Logged

SMART Extended Self-test Log (GP Log 0x07) not supported SMART Self-test log structure revision number 1 No self-tests have been logged. [To run self-tests, use: smartctl -t]

Device does not support Selective Self Tests/Logging Error Write SCT Data Table command failed Error Write SCT (Get) Error Recovery Control Command failed: Unknown error: 0 Warning: device does not support SCT (Get) Error Recovery Control command

SATA Phy Event Counters (GP Log 0x11) not supported



On the second drive :

Western Digital My Book Essential 1To gives

$ ./smartctl -a /dev/disk2 smartctl 5.41 2011-04-06 r3314 [i386-apple-darwin9.8.0](local build) Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net

=== START OF INFORMATION SECTION === Model Family: Western Digital Caviar Green family Device Model: WDC WD10EADS-22M2B0 Serial Number: WD-XXXXXXXX LU WWN Device Id: 5 0014ee 25b3f7bfb Firmware Version: 01.00A01 User Capacity: 1,000,204,886,016 bytes [1,00 TB] Device is: In smartctl database [for details use: -P show] ATA Version is: 8 ATA Standard is: Exact ATA specification draft version not indicated Local Time is: Wed May 2 00:27:33 2012 CEST SMART support is: Available - device has SMART capability. SMART support is: Enabled

Error SMART Values Read failed Smartctl: SMART Read Values failed.

=== START OF READ SMART DATA SECTION === SMART overall-health self-assessment test result: PASSED

SMART Error Log Version: 1 No Errors Logged

SMART Self-test log structure revision number 1 No self-tests have been logged. [To run self-tests, use: smartctl -t]

Device does not support Selective Self Tests/Logging

THEN

$ ./smartctl -P show /dev/disk2 smartctl 5.41 2011-04-06 r3314 [i386-apple-darwin9.8.0](local build) Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net

ATA device successfully opened

Use 'smartctl -a' (or '-x') to print SMART (and more) information

THEN

$ ./smartctl -x /dev/disk2 smartctl 5.41 2011-04-06 r3314 [i386-apple-darwin9.8.0](local build) Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net

=== START OF INFORMATION SECTION === Model Family: Western Digital Caviar Green family Device Model: WDC WD10EADS-22M2B0 Serial Number: WD-XXXXXXXX LU WWN Device Id: 5 0014ee 25b3f7bfb Firmware Version: 01.00A01 User Capacity: 1,000,204,886,016 bytes [1,00 TB] Device is: In smartctl database [for details use: -P show] ATA Version is: 8 ATA Standard is: Exact ATA specification draft version not indicated Local Time is: Wed May 2 00:28:42 2012 CEST SMART support is: Available - device has SMART capability. SMART support is: Enabled

Error SMART Values Read failed Smartctl: SMART Read Values failed.

=== START OF READ SMART DATA SECTION === SMART overall-health self-assessment test result: PASSED

ATA_READ_LOG_EXT (addr=0x00:0x00, page=0, n=1) failed: 48-bit ATA commands not supported Read GP Log Directory failed.

SMART Log Directory Version 1 [multi-sector log support] SMART Log at address 0x00 has 1 sectors [Log Directory] SMART Log at address 0x01 has 1 sectors [Summary SMART error log] SMART Log at address 0x02 has 5 sectors [Comprehensive SMART error log] SMART Log at address 0x06 has 1 sectors [SMART self-test log] SMART Log at address 0x09 has 1 sectors [Selective self-test log] SMART Log at address 0x80 has 16 sectors [Host vendor specific log] SMART Log at address 0x81 has 16 sectors [Host vendor specific log] SMART Log at address 0x82 has 16 sectors [Host vendor specific log] SMART Log at address 0x83 has 16 sectors [Host vendor specific log] SMART Log at address 0x84 has 16 sectors [Host vendor specific log] SMART Log at address 0x85 has 16 sectors [Host vendor specific log] SMART Log at address 0x86 has 16 sectors [Host vendor specific log] SMART Log at address 0x87 has 16 sectors [Host vendor specific log] SMART Log at address 0x88 has 16 sectors [Host vendor specific log] SMART Log at address 0x89 has 16 sectors [Host vendor specific log] SMART Log at address 0x8a has 16 sectors [Host vendor specific log] SMART Log at address 0x8b has 16 sectors [Host vendor specific log] SMART Log at address 0x8c has 16 sectors [Host vendor specific log] SMART Log at address 0x8d has 16 sectors [Host vendor specific log] SMART Log at address 0x8e has 16 sectors [Host vendor specific log] SMART Log at address 0x8f has 16 sectors [Host vendor specific log] SMART Log at address 0x90 has 16 sectors [Host vendor specific log] SMART Log at address 0x91 has 16 sectors [Host vendor specific log] SMART Log at address 0x92 has 16 sectors [Host vendor specific log] SMART Log at address 0x93 has 16 sectors [Host vendor specific log] SMART Log at address 0x94 has 16 sectors [Host vendor specific log] SMART Log at address 0x95 has 16 sectors [Host vendor specific log] SMART Log at address 0x96 has 16 sectors [Host vendor specific log] SMART Log at address 0x97 has 16 sectors [Host vendor specific log] SMART Log at address 0x98 has 16 sectors [Host vendor specific log] SMART Log at address 0x99 has 16 sectors [Host vendor specific log] SMART Log at address 0x9a has 16 sectors [Host vendor specific log] SMART Log at address 0x9b has 16 sectors [Host vendor specific log] SMART Log at address 0x9c has 16 sectors [Host vendor specific log] SMART Log at address 0x9d has 16 sectors [Host vendor specific log] SMART Log at address 0x9e has 16 sectors [Host vendor specific log] SMART Log at address 0x9f has 16 sectors [Host vendor specific log] SMART Log at address 0xa0 has 16 sectors [Device vendor specific log] SMART Log at address 0xa1 has 16 sectors [Device vendor specific log] SMART Log at address 0xa2 has 16 sectors [Device vendor specific log] SMART Log at address 0xa3 has 16 sectors [Device vendor specific log] SMART Log at address 0xa4 has 16 sectors [Device vendor specific log] SMART Log at address 0xa5 has 16 sectors [Device vendor specific log] SMART Log at address 0xa6 has 16 sectors [Device vendor specific log] SMART Log at address 0xa7 has 16 sectors [Device vendor specific log] SMART Log at address 0xa8 has 1 sectors [Device vendor specific log] SMART Log at address 0xa9 has 1 sectors [Device vendor specific log] SMART Log at address 0xaa has 1 sectors [Device vendor specific log] SMART Log at address 0xab has 1 sectors [Device vendor specific log] SMART Log at address 0xac has 1 sectors [Device vendor specific log] SMART Log at address 0xad has 1 sectors [Device vendor specific log] SMART Log at address 0xae has 1 sectors [Device vendor specific log] SMART Log at address 0xaf has 1 sectors [Device vendor specific log] SMART Log at address 0xb0 has 1 sectors [Device vendor specific log] SMART Log at address 0xb1 has 1 sectors [Device vendor specific log] SMART Log at address 0xb2 has 1 sectors [Device vendor specific log] SMART Log at address 0xb3 has 1 sectors [Device vendor specific log] SMART Log at address 0xb4 has 1 sectors [Device vendor specific log] SMART Log at address 0xb5 has 1 sectors [Device vendor specific log] SMART Log at address 0xb6 has 1 sectors [Device vendor specific log] SMART Log at address 0xb7 has 1 sectors [Device vendor specific log] SMART Log at address 0xc0 has 1 sectors [Device vendor specific log] SMART Log at address 0xe0 has 1 sectors [SCT Command/Status] SMART Log at address 0xe1 has 1 sectors [SCT Data Transfer]

SMART Extended Comprehensive Error Log (GP Log 0x03) not supported SMART Error Log Version: 1 No Errors Logged

SMART Extended Self-test Log (GP Log 0x07) not supported SMART Self-test log structure revision number 1 No self-tests have been logged. [To run self-tests, use: smartctl -t]

Device does not support Selective Self Tests/Logging Error Write SCT Data Table command failed Warning: device does not support SCT Error Recovery Control command SATA Phy Event Counters (GP Log 0x11) not supported


Hope this help.

killerovsky commented 12 years ago

Jarkko, May be this information will be helpful to you: After some digging in your code and logs analysis - it looks like error occurs on next line "status = buffer->prepare ( );" in SATSMARTUserClient::ReadData() function (this is just my guess - as I'm not debugged this in debugger - just code and logs analysis). Call to prepare() results in error kIOReturnCannotWire (0xe00002de) "can't wire down physical memory". Generally this is strange because we should wire only just 512 bytes. But (!) in other hand - if our buffer is so small - why you have decided to use IOMemoryDescriptor instead of something more "structured" and reliable like marshalling via IOConnectCallStructMethod?

This is just my 5 cents. Keep up your great work! This driver will be very useful for many mac users.

kasbert commented 12 years ago

There is now version 0.4.

It is easier to make a full package with a script than manually package the driver files.

UserClient code is mostly a copy from Apple open source ATA smart code, so I didn't decide any interface mechanisms. Now I changed the code to use IOConnectCallStructMethod.

mfisch commented 12 years ago

Missing a file from this package?

sh-3.2# kextutil -t /System/Library/Extensions/SATSMARTDriver.kext Notice: /System/Library/Extensions/SATSMARTDriver.kext has debug properties set. /System/Library/Extensions/SATSMARTDriver.kext is invalid; can't resolve dependencies. /System/Library/Extensions/SATSMARTDriver.kext is invalid; can't resolve dependencies. /System/Library/Extensions/SATSMARTDriver.kext is invalid; can't resolve dependencies. Diagnostics for /System/Library/Extensions/SATSMARTDriver.kext: Validation Failures: Kext has a CFBundleExecutable property but the executable can't be found: SATSMARTDriver

sh-3.2# find .|grep SATS ./SATSMARTDriver.kext ./SATSMARTDriver.kext/Contents ./SATSMARTDriver.kext/Contents/Info.plist ./SATSMARTDriver.kext/Contents/Resources ./SATSMARTDriver.kext/Contents/Resources/English.lproj ./SATSMARTDriver.kext/Contents/Resources/English.lproj/InfoPlist.strings ./SATSMARTLib.plugin ./SATSMARTLib.plugin/Contents ./SATSMARTLib.plugin/Contents/Info.plist

On May 2, 2012, at 12:53 PM, Jarkko Sonninen wrote:

There is now version 0.4.

It is easier to make a full package with a script than manually package the driver files.

UserClient code is mostly a copy from Apple open source ATA smart code, so I didn't decide any interface mechanisms. Now I changed the code to use IOConnectCallStructMethod.


Reply to this email directly or view it on GitHub: https://github.com/kasbert/OS-X-SAT-SMART-Driver/issues/2#issuecomment-5466419

mfisch commented 12 years ago

Jarkko, This revision seems to have enabled full SMART access to Lion (64), I can't find any issues with it.

-Matt

On May 2, 2012, at 12:53 PM, Jarkko Sonninen wrote:

There is now version 0.4.

It is easier to make a full package with a script than manually package the driver files.

UserClient code is mostly a copy from Apple open source ATA smart code, so I didn't decide any interface mechanisms. Now I changed the code to use IOConnectCallStructMethod.


Reply to this email directly or view it on GitHub: https://github.com/kasbert/OS-X-SAT-SMART-Driver/issues/2#issuecomment-5466419

killerovsky commented 12 years ago

Jarkko,

Thanks for new release! Good news: it is now full functional for 64-bit apps. It looks like all S.M.A.R.T. stuff working now. Great work! Bad news: unfortunately installer still doesn't working on my MacBookPro 5,5 and OS X 10.6.8. Very weird. Could you please try to "rollback" to some previous version of your installer that worked?

kasbert commented 12 years ago

There is a new version with the same 0.4 number. Please try it out.

Seems that you have to use the PackageMaker gui instead of running it from command line.

killerovsky commented 12 years ago

New version of the installer is working. Thanks.

kasbert commented 12 years ago

Nice to hear.

Write log command may still be broken, but I don't know if it is important.