Jump to content

_WMI_GetATAPISmartData v1.01


ripdad
 Share

Recommended Posts

Gregor1806,

oops... I guess I should had said what the reproducer was for (to which issue, that is).

It pertains to the Raid Systems that ricky03 and rodent1 mentioned in previous post.

For instance, how is it that Raid was "getting by the error object statement".

I'm still playing with it, trying to solve a secondary measure also.

I will be updating _WMI_GetATAPISmartData() soon, with the new code for it.

And thanks for the feedback on the reproducer!

Now, on to your issue.

I want to get this solved as much as you do!

Is there anything more you need from my machine...

I wish I had your machine in my hot little hands! <grin>

Since I can't, then could you post a screen-shot of the array for your SSD from _WMI_GetATAPISmartData()?

Thanks.

"The mediocre teacher tells. The Good teacher explains. The superior teacher demonstrates. The great teacher inspires." -William Arthur Ward

Link to comment
Share on other sites

At the bottom-right of "Reply to this topic", you'll see "More Reply Options".

Click that, and I think you can do the rest.

"The mediocre teacher tells. The Good teacher explains. The superior teacher demonstrates. The great teacher inspires." -William Arthur Ward

Link to comment
Share on other sites

Well no wonder! It doesn't have any attributes 170 thru 179.

And, just looking at the data... it looks like I'll have to regroup on a few issues.

1) It doesn't have nominal or threshold values. They are all zero.

2) Temperature is missing.

3) PowerOnHours is zero.

I'll get back with you in a day or two, after I do some more research.

Thanks!

"The mediocre teacher tells. The Good teacher explains. The superior teacher demonstrates. The great teacher inspires." -William Arthur Ward

Link to comment
Share on other sites

I ran across several forums that mention upgrading the "firmware" of an OCZ SSD,

because of erroneous S.M.A.R.T. attributes and values.

Here's the link to OCZ: http://www.ocztechnology.com/ssd_tools/

Please read all warnings and precautions if you do the upgrade!

You might also want to visit their forums for additional insight.

Also, could you post the data from the code below?

It will put the data on the clipboard. All you have to do is paste it here after you run it.

#RequireAdmin
;
_WMI_Win32_DiskDrive()
;
Func _WMI_Win32_DiskDrive()
    Local $objWMI = ObjGet('Winmgmts:{ImpersonationLevel=Impersonate,AuthenticationLevel=PktPrivacy,(Debug)}!.rootCIMV2')
    If @error Or Not IsObj($objWMI) Then Return SetError(-1)
    ;
    Local $objClass = $objWMI.InstancesOf('Win32_DiskDrive')
    Local $count = $objClass.Count
    If @error Or Not $count Then Return SetError(-2)
    ;
    Local $name, $value, $s = ''
    ;
    For $objItem In $objClass
        For $ObjDrive In $objItem.Properties_()
            $name = $ObjDrive.Name
            $value = $ObjDrive.Value
            If StringExists($value) Then
                $s &= $name & ' = ' & $value & @CRLF
            EndIf
        Next
        $s &= @CRLF
    Next
    ;
    ClipPut($s)
    MsgBox(0, '', $s)
EndFunc
;
Func StringExists($s_String, $i_Chars = 30)
    $s_String = StringStripWS(StringLeft($s_String, $i_Chars), 8)
    If Not StringLen($s_String) Then
        Return SetError(0, 0, 0)
    ElseIf $s_String <> 0 Then
        Return SetError(0, 0, 1)
    Else
        Return SetError(0, 1, 1)
    EndIf
EndFunc
;

-Edit

fixed tag problem with <> in StringExists.

-Edit2

fixed forum formatting again.

Edited by ripdad

"The mediocre teacher tells. The Good teacher explains. The superior teacher demonstrates. The great teacher inspires." -William Arthur Ward

Link to comment
Share on other sites

OK, output as requested:

BytesPerSector = 512

Caption = OCZ-VERTEX

ConfigManagerErrorCode = 0

ConfigManagerUserConfig = False

CreationClassName = Win32_DiskDrive

Description = Disk drive

DeviceID = .PHYSICALDRIVE1

FirmwareRevision = 1.7

Index = 1

InterfaceType = IDE

Manufacturer = (Standard disk drives)

MediaLoaded = True

MediaType = Fixed hard disk media

Model = OCZ-VERTEX

Name = .PHYSICALDRIVE1

Partitions = 2

PNPDeviceID = IDEDISKOCZ-VERTEX______________________________1.7_____4&0&0.0.0

SCSIBus = 0

SCSILogicalUnit = 0

SCSIPort = 0

SCSITargetId = 0

SectorsPerTrack = 63

SerialNumber = F0SXXXX

Signature = -1377066054

Size = 128034708480

Status = OK

SystemCreationClassName = Win32_ComputerSystem

SystemName = MYPC

TotalCylinders = 15566

TotalHeads = 255

TotalSectors = 250067790

TotalTracks = 3969330

TracksPerCylinder = 255

BytesPerSector = 512

Caption = IMD-0

ConfigManagerErrorCode = 0

ConfigManagerUserConfig = False

CreationClassName = Win32_DiskDrive

Description = Disk drive

DeviceID = .PHYSICALDRIVE0

Index = 0

InterfaceType = SCSI

Manufacturer = (Standard disk drives)

MediaLoaded = True

MediaType = Fixed hard disk media

Model = IMD-0

Name = .PHYSICALDRIVE0

Partitions = 1

PNPDeviceID = IDEIMD5&12782356&0&1.0.0

SCSIBus = 0

SCSILogicalUnit = 0

SCSIPort = 0

SCSITargetId = 0

SectorsPerTrack = 63

Signature = -1550593468

Size = 537772032

Status = OK

SystemCreationClassName = Win32_ComputerSystem

SystemName = MYPC

TotalCylinders = 521

TotalHeads = 32

TotalSectors = 1050336

TotalTracks = 16672

TracksPerCylinder = 32

Thanks,

Gregor

Link to comment
Share on other sites

From the data you posted, your SSD "FirmwareRevision = 1.7"

Have you checked into updating it?

I doubt it will help with the original SSD detection scheme, but it should fix it for proper readings.

I'm afraid we are out of luck using an attribute for this model.

There are other ways to detect an SSD.

Example: You could use a combination of "Caption or Model, DeviceID, and PNPDeviceID" from the above data.

"The mediocre teacher tells. The Good teacher explains. The superior teacher demonstrates. The great teacher inspires." -William Arthur Ward

Link to comment
Share on other sites

Hi, I have not read all the posts here, but I thought that you may be interested to hear the opinions on SMART by one of the industry's hard drive experts, the creator of Spinrite (a hard drive recovery program) Mr. Steve Gibson.

There are Lots of goodies on his site like Shields Up and the weekly podcasts covering every security issue you might have etc.

GRC Homepage

The following is an excerpt from a podcast (#81) by Steve Gibson of GRC.com and Leo Laporte:

The drive can die spontaneously while SMART is completely happy and sees nothing going wrong. At the same time there are drives which look like they’re on their last throes from a standpoint of the SMART data that just keep on going for years. So the problem really, and this is what Google’s findings were – well, actually Google found a lot of things. But relative to SMART they found a very disappointing lack of correlation between, well, based on extensive statistical analysis of over 100,000 drives within their system, a very weak analysis...

At the GRC site there are free copies of all the podcasts and also txt and pdf versions too.

Podcast #81:

Hard Drive Unreliability

I hope this has been useful.

Regards,

DeMo.

Quote of the week:"BASIC programmers never die, they GOSUB and don't RETURN." -- UnknownWisdom of the ages:

  

  • I'd be unstoppable... if not for law enforcement and physics.
  • Marriage, the number 1 cause of divorce.
  • Don't steal... the government hates competition.
  • Irish Government Motto: We’ve got what it takes to take what you’ve got.
  • Birthdays are good for you. Statistics show that the people who have the most live the longest.
  • Failure is not an option. It comes bundled with your Microsoft product.-- Ferenc Mantfeld
  • If you learn from your mistakes, then why ain't I a genius?! -- Anonymous
  • Remember, live every day as if it was your last day! one day you will be right.
  • How is it one careless match can start a forest fire, but it takes a whole box to start a campfire?
  • Sure my system is secure, it just locked up again.
  • I haven't lost my mind; I have a tape back-up somewhere.  ~Author Unknown
Link to comment
Share on other sites

GerrOrneq, thanks for the info.

Although I agree (in part) with what Steve has said (in the podcast), I believe that S.M.A.R.T. is still useful in some areas.

For instance ... Power On Hours, Reallocated Sectors and Drive Temperature.

Those three are the most important to me and are good indicators of a drives condition.

The rest is up for grabs when it comes to predicting a failure.

There are simply too many things that can go wrong; And not just the drive.

As Steve said, backing up a drive is THE most important thing you can do to protect your data.

---

This will be about as far as I'm willing to go with this project, without building a database on vendors and models,

lest it turn into a full-time job.

Updated 1st Post with better error handling on InstancesOf() statements.

Note: SSD detection works only on models that have the 170 thru 179 Attributes.

"The mediocre teacher tells. The Good teacher explains. The superior teacher demonstrates. The great teacher inspires." -William Arthur Ward

Link to comment
Share on other sites

  • 2 months later...

The script in the 1st post got messed up with forum formatting.

No problem - it's easily fixed with a zipfile.

Updated 1st post to Version 1.00

Notes:

I finally came up with the way I wanted the script to handle object errors.

1) If there is any object error, it will return from the function immediately, with the error message.

2) If there are no "object items count", it will return: "classname"=0.

Which simply means: no object items found for this class.

"The mediocre teacher tells. The Good teacher explains. The superior teacher demonstrates. The great teacher inspires." -William Arthur Ward

Link to comment
Share on other sites

  • 2 weeks later...

Thanks a lot for the code, i really like it.-)

FYI: I tried it with my SSD and it is not detected as SSD (see atteched screenshot)

As the SSD is almost brandnew the POH value is wrong, too

Also the _WMI_GetDriveList.au3 script gives me Error Number: 80041021 Script Line: 19

Anything i can try here?

post-5062-0-04527000-1351800469_thumb.jp

Edited by Allow2010
Link to comment
Share on other sites

For the error description look here: http://msdn.microsoft.com/en-us/library/windows/desktop/aa394559(v=vs.85).aspx

Br,

UEZ

Edited by UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

Allow2010,

When I first started this project, SSD's were not on my mind.

Putting that aside... I found that some SSD's work with this script and others don't. Yours being the latter.

And... not much I can do about it, because "others that don't" are playing with "non-standard attributes".

If there is such a thing.

The only way to make this script work for your drive... is to specifically tailor it to that one drive.

Anyways, I see my little "test scripts" in this topic are also messed up by forum formatting. I'll tend to those shortly.

Edited by ripdad

"The mediocre teacher tells. The Good teacher explains. The superior teacher demonstrates. The great teacher inspires." -William Arthur Ward

Link to comment
Share on other sites

  • 2 weeks later...

Thanks for the replies...

Just in case anyone is interested:

http://download.intel.com/newsroom/kits/ssd/pdfs/intel_ssd_520_product_spec_325968.pdf

page 17 and fo0llowing list the smart values for Intel SSDs

It seems some calculation is needed for the POH vale 9 and 249 holds Total NAND Writes

the smartmontools use a file called drivedb.h which can be updated online. this file holds all the special cases...

Would be nice if you code could read the needed info from there to make more drives work.

{ "Intel 320 Series SSDs", // tested with INTEL SSDSA2CT040G3/4PC10362

"INTEL SSDSA[12]C[WT](040|080|120|160|300|600)G3",

"", "",

//"-v 3,raw16(avg16),Spin_Up_Time "

//"-v 4,raw48,Start_Stop_Count "

//"-v 5,raw16(raw16),Reallocated_Sector_Ct "

//"-v 9,raw24(raw8),Power_On_Hours "

//"-v 12,raw48,Power_Cycle_Count "

"-v 170,raw48,Reserve_Block_Count "

"-v 171,raw48,Program_Fail_Count "

"-v 172,raw48,Erase_Fail_Count "

//"-v 184,raw48,End-to-End_Error "

//"-v 187,raw48,Reported_Uncorrect "

"-v 192,raw48,Unsafe_Shutdown_Count "

"-v 225,raw48,Host_Writes_32MiB "

"-v 226,raw48,Workld_Media_Wear_Indic " // Timed Workload Media Wear Indicator (percent*1024)

"-v 227,raw48,Workld_Host_Reads_Perc " // Timed Workload Host Reads Percentage

"-v 228,raw48,Workload_Minutes " // 226,227,228 can be reset by 'smartctl -t vendor,0x40'

//"-v 232,raw48,Available_Reservd_Space "

//"-v 233,raw48,Media_Wearout_Indicator "

"-v 241,raw48,Host_Writes_32MiB "

"-v 242,raw48,Host_Reads_32MiB"

},

I attached such a file just in case you want to take a look

drivedb.zip

Edited by Allow2010
Link to comment
Share on other sites

ripdad,

I really want to thank you for your work with SMART and AutoIT. I had previously seen many programs that read SMART data but I found them incomprehensible. Your script sparked my interest.

I've looked at many drives lately and I find that Seagate drives in particular seem to have very high POH figures. I've seen 20000 on drives that are a few years old. If you consider that 8 hours per day x 5 days per week x 50 weeks per year is 2000 hours, this indicates 10 years of average desktop use. Yes, it could have been left on 24/7 but I know in this case that is not true. Have you or anybody else seen what appears to be an excessively high values?

I've Googled this and come up with very little except that some manufacturers may record power on minutes or seconds instead of hours. I also found that current Seagate Barracuda drives are rated at only 2400 POH. That's ridiculously low. See here: http://www.seagate.com/files/staticfiles/docs/pdf/datasheet/disc/barracuda-ds1737-1-1111us.pdf

HDD's of late just aren't what they used to be. I've seen many drives fail that just 1 or 2 years old. Used to be that drives hardly ever failed. Don't even mention external USB drives, especially the newer WD ones.

Link to comment
Share on other sites

Allow2010 - Thanks for the info. I'll take a look.

4Eyes - "Planned Obsolescence on Steroids" for most things these days.

On the 20000 POH issue -- Could you copy the POH field from the array and post it here?

I am aware that some vendors use minutes instead of hours.

There is no way a script could determine that, unless a database for models was used.

I wish everything was standardized with SMART, but sadly it's not.

On the 2400 POH issue -- That can't be right for literal hours. I'd have to buy a new one every 6 months!

"The mediocre teacher tells. The Good teacher explains. The superior teacher demonstrates. The great teacher inspires." -William Arthur Ward

Link to comment
Share on other sites

ripdad,

I won't be near that machine until next Tuesday, but I found another (this time a Maxtor 6Y080M0) today with a POH of 58590 and 1888 power cycles. That translates to roughly 30 hours per cycle which I now in this case is not factual.

Despite Googling I have so far been unable to find any manufacturer that spec's exactly what there POH value means... that is, is it hours, minutes, seconds, fortnights, etc. Could you please elaborate on what info you have in this respect? (Edit... the file mentioned below does specify that at least some Hitachi drives store power on minutes in the POH value).

BTW, in my searching today I did find that smartmontools (smartmontools.sourceforge.net) can use a seperate file (drivedb.h) that is in fact a helper file for many different issues. From what I can gather, POH as used by Seagate really is hours.

Again, the URL I gave says 'Power-On hours' and shows 2400. Check it out.

BTW, I don't expect you to do anything extra with your SMART tool. It's quite useful as it is. I've put a GUI around it and stripped it back to just a few parameters of interest to me and I find it quite useful. Nah... it's my current obsession, apart from playing Dishonoured. :)

Link to comment
Share on other sites

I did look at the pdf for the Seagate models. Logically, I suppose that 2400 POH is in line with their warranty policy. Basically saying, that those drives have a minimum life of 2400 hours or 6 months, whichever comes first, or something to that effect.

I guess a vendor would be hard pressed to say that a drive should last "X" hours, given all the variables that could happen during it's lifetime.

If I had to say what are the main causes for a drive to fail (barring any electrical or mechanical failure),

it would be something like this:

1) Temperature. Laptop drives especially, are notorious at failing because they can't get enough airflow. I've seen it too many times when they are above 125 degrees. A safe temperature would be below 100 degrees Fahrenheit (just my opinion). My personal drives are usually somewhere between 85 and 90.

I rigged my personal laptop's fan with a variable voltage regulator, so that it "always runs" at 60%.

Never did like the way they worked from the factory. On/Off, On/Off, enough to drive one nuts.

2) Bad sectors from crashes or hard shutdowns. Most of the time when this happens, people reboot and if the OS gets to the desktop, then "thats good enough". The proper thing to do is check the hard drive for errors, so that errors don't compound on one another. Then, you can boot the OS after chkdsk has fixed them, if there were any.

I just don't understand why there is not an option at a "safemode prompt" to scan the drive for errors! That has never made any sense to me. So, you are left to a few options. Either boot up a WinPE or a repair console, if you have one. Most people do not have access to either, nor would they know how to use them.

Most machines won't boot a CD first. It's usually the hard drive that has the first boot order. Most people would not have a clue of how to change that in the Bios or what F-Key to press so they could choose the boot device.

3) Shock from being dropped. That goes without saying, of course.

As far as elaborating any further on how some vendors calculate POH in minutes, etc. --

it was only in passing during research. Most are in hours though.

---

I looked over the drivedb.h file and found entries like this:

"-v 9, seconds" - POH, FUJITSU

"-v 9, halfminutes" - POH, Samsung

"-v 9, minutes" - POH, Maxtor

"-v 194, unknown" - Temperature, Maxtor

"-v 194, 10xCelsius" - Temperature, Samsung

---

edit: added a few more things.

edit2: added findings about drivedb.h

Edited by ripdad

"The mediocre teacher tells. The Good teacher explains. The superior teacher demonstrates. The great teacher inspires." -William Arthur Ward

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...