All of lore.kernel.org
 help / color / mirror / Atom feed
From: Edward Falk <efalk@google.com>
To: LKML <linux-kernel@vger.kernel.org>,
	Jagadeesh Bhaskar P <jbhaskar@hclinsys.com>
Subject: Re: usage of WIN_SMART
Date: Mon, 29 Nov 2004 16:05:19 -0800	[thread overview]
Message-ID: <41ABB93F.8060206@google.com> (raw)
In-Reply-To: <8783be6604112611137bcbfb61@mail.gmail.com>


> I have seen SMART system's code containing WIN_SMART directive in ioctl
> sprinkled through out the code? What does that mean? What is its proper
> usage? Is there a proper documentation for it?
> 
> Thanks in advance for all replies

Hi Jagadeesh; I'm not entirely sure what your question is, so I'll see 
if I can provide a vague enough answer to cover it :)

Executive summary:  The SMART data is used to obtain information about 
the state of the drive hardware, for the purpose of predicting or 
diagnosing failures.  What little documentation there is exists in the 
ATA/ATAPI specification, but most of the data is vendor-specific and 
undocumented.  The easiest way to access SMART data is by cat'ing the 
appropriate file in /proc/ide/hdX




Long answer:

Many (all?) modern disk drives provide what is known as "SMART" 
(Self-Monitoring, Analysis, and Reporting Technology) data.  This 
includes information about the performance of the drive, including how 
many errors the drive has corrected, what the drive temperature has 
been, and so on.  The WIN_SMART command has a number of sub-commands 
(specified through the features register), which are described in the 
ATA spec under "Command descriptions".

AFAIK, there are no ioctls directly corresponding to the SMART commands, 
but the SMART commands can be accessed via the HDIO_DRIVE_TASKFILE 
ioctl.  (NOTE:  do not attempt this without a copy of the ATA spec in 
front of you.)

An even easier way to obtain the SMART data is to cat 
/proc/ide/hdX/smart_values or /proc/ide/hdX/smart_thresholds.

(At Google, we've added "smart_logs" and "smart_status" entries to 
/proc.  We'll be submitting those patches Real Soon Now.)

The interesting SMART subcommands are:

SMART READ DATA

   Read and return the 512-byte SMART data structure.
   The ATA spec describes this structure, but most of the
   interesting fields are vendor-specific.  Several of the
   vendors have adopted a number of common data fields,
   such as spinup time, reallocation count, seek error
   rate, and so on.  In general though, the information is
   really private to the vendor, intended for the vendor
   to diagnose the drive.

SMART READ LOG

   Returns one of a number of available logs, including log
   directory, summary error log, comprehensive error log,
   and so on, including a few vendor-specific logs.

SMART WRITE LOG

   Write data to a log.

SMART RETURN STATUS

   Returns a simple yes/no status indicating whether or
   not any of the device's thresholds have been exceeded.



I hope this helps answer your questions.

	-ed falk

  parent reply	other threads:[~2004-11-30  0:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-24  9:54 usage of WIN_SMART Jagadeesh Bhaskar P
     [not found] ` <8783be6604112611137bcbfb61@mail.gmail.com>
2004-11-30  0:05   ` Edward Falk [this message]
2004-11-30  3:10     ` Jagadeesh Bhaskar P
2004-11-30 14:31       ` Ross Biro
  -- strict thread matches above, loose matches on Subject: below --
2004-11-24 10:49 Jagadeesh Bhaskar P
2004-11-24 12:10 ` Jan-Benedict Glaw
2004-11-25  4:27   ` Jagadeesh Bhaskar P
2004-11-25  7:08     ` Glynn Clements

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=41ABB93F.8060206@google.com \
    --to=efalk@google.com \
    --cc=jbhaskar@hclinsys.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.