dcsimg

Smartmontools: Ya Mon!

Last article we introduced the SMART capabilities of hard drives (who knew your drives were SMART?). In this article smartmontools, an application for examining the SMART attributes and trigger self tests, is examined.

As you might recall, SMART (Self-Monitoring, Analysis, and Reporting Technology) is a standard technology for storage devices to provide monitoring data about the device itself. However, the data, called the attributes, is not standard and varies from drive to drive and from manufacturer to manufacturer with values that are defined by the manufacturer. In general the attributes include such information as the temperature of the drive, the number of sectors that have gone bad, reallocation of bad sectors, and so on. In addition to attributes SMART can be used to force the drives to perform self-tests to check for problems and store the information in logs.

All of the features and capabilities of SMART drives sounds great but how does one collect SMART attribute information or control drive self-tests and obtain the logs? Linux has a great tool called smartmontools, that allows you to interact with the storage devices using the SMART protocol.

Smartmontools

There is an active open-source project to read the SMART information from hard drives under Linux (although it can be used by other operating systems). Smartmontools allows the user to control and monitor storage systems that are SMART capable. It is derived from an earlier project, smartsuite, from the University of California at Santa Cruz. It has expanded on the earlier work to add later standards and to add features to the tools. The tool is compatible with all SMART features and supports ATA/ATAPI/SATA-3 to -8 disks and SCSI disks and tape devices. It also supports the major Linux RAID cards which can sometimes give difficulties because they require vendor specific IO control commands. Check the smartmontools page for more details on your specific card.

Smartmontools is easy to build and easy to use. Let’s run through an example on the desktop system that I use for benchmarking.

The first step is to download the tar file and build it. This is covered in the smartmontool’s web page and is a straight forward process of “./configure; make; make install.” The resulting binaries are installed in /usr/local so be sure to adjust your $PATH accordingly. You should see two binaries in /usr/local/sbin: smartctl and smartd. Smartctl is the command we will be using most in this article since it’s the command line tool.

The first thing to do once smartmontools is built and installed is to scan each drive using the “-i” option (“info” option). The system I’m testing has 4 drives and the output from the “smartctl -i” option is shown below for each drive. Notice that the device path for each drive (e.g. /dev/hda) is used in the smartctl command. Be sure to replace this device path with whatever device you are examining.

[root@test64 laytonjb]# /usr/local/sbin/smartctl -i /dev/hda
smartctl 5.39.1 2010-01-28 r3054 [x86_64-unknown-linux-gnu] (local build)
Copyright (C) 2002-10 by Bruce Allen, http://smartmontools.sourceforge.net

=== START OF INFORMATION SECTION ===
Model Family:     IBM Deskstar 40GV & 75GXP series (all other firmware)
Device Model:     IBM-DTLA-307020
Serial Number:    YHCYHT7C565
Firmware Version: TX3IA65A
User Capacity:    20,416,757,760 bytes
Device is:        In smartctl database [for details use: -P show]
ATA Version is:   5
ATA Standard is:  ATA/ATAPI-5 T13 1321D revision 1
Local Time is:    Sat Apr 10 18:50:52 2010 EDT

==> WARNING: IBM Deskstar 40GV and 75GXP drives may need upgraded SMART firmware.
Please see http://www.geocities.com/dtla_update/ and

http://www.ibm.com/pc/support/site.wss/MIGR-42215.html

SMART support is: Available - device has SMART capability.
SMART support is: Enabled


I’ve ignored the warning since it’s a little old and this is a benchmark system. But notice the comment, “In smartctl database”. This informs us that this drive is in the smartctl database within smartmontools so the smart attribute values and what they mean are in the database. To check we just use the “-P show” option with smartctl.

[root@test64 SMARTMONTOOLS]# /usr/local/sbin/smartctl -P show /dev/hda
smartctl 5.39.1 2010-01-28 r3054 [x86_64-unknown-linux-gnu] (local build)
Copyright (C) 2002-10 by Bruce Allen, http://smartmontools.sourceforge.net

Drive found in smartmontools Database.  Drive identity strings:
MODEL:              IBM-DTLA-307020
FIRMWARE:           TX3IA65A
match smartmontools Drive Database entry:
MODEL REGEXP:       (IBM-)?DTLA-30[57]0[123467][05].*
FIRMWARE REGEXP:    .*
MODEL FAMILY:       IBM Deskstar 40GV & 75GXP series (all other firmware)
ATTRIBUTE OPTIONS:  None preset; no -v options are required.
WARNINGS:           IBM Deskstar 40GV and 75GXP drives may need upgraded SMART firmware.
Please see http://www.geocities.com/dtla_update/ and

http://www.ibm.com/pc/support/site.wss/MIGR-42215.html


Notice the comment about “match smartmontools” means the drive is in the database. After that comment the output from smartctl will present the summary information of the drive from the smartmontools database.

The second drive is /home and is a simple Seagate SATA drive that is a little on the older side.

[root@test64 laytonjb]# /usr/local/sbin/smartctl -i /dev/sda
smartctl 5.39.1 2010-01-28 r3054 [x86_64-unknown-linux-gnu] (local build)
Copyright (C) 2002-10 by Bruce Allen, http://smartmontools.sourceforge.net

=== START OF INFORMATION SECTION ===
Model Family:     Seagate Barracuda 7200.7 and 7200.7 Plus family
Device Model:     ST3160827AS
Serial Number:    4MT03PK8
Firmware Version: 3.42
User Capacity:    160,041,885,696 bytes
Device is:        In smartctl database [for details use: -P show]
ATA Version is:   6
ATA Standard is:  ATA/ATAPI-6 T13 1410D revision 2
Local Time is:    Sat Apr 10 18:51:33 2010 EDT
SMART support is: Available - device has SMART capability.
SMART support is: Enabled


This drive is also in the smartctl database.

The next two drives are the same but I’ll show the smartctl output for both.

[root@test64 laytonjb]# /usr/local/sbin/smartctl -i /dev/sdb
smartctl 5.39.1 2010-01-28 r3054 [x86_64-unknown-linux-gnu] (local build)
Copyright (C) 2002-10 by Bruce Allen, http://smartmontools.sourceforge.net

=== START OF INFORMATION SECTION ===
Model Family:     Seagate Barracuda 7200.11 family
Device Model:     ST3500320AS
Serial Number:    9QM5WJ21
Firmware Version: SD15
User Capacity:    500,107,862,016 bytes
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:    Sat Apr 10 18:52:01 2010 EDT
SMART support is: Available - device has SMART capability.
SMART support is: Enabled


[root@test64 laytonjb]# /usr/local/sbin/smartctl -i /dev/sdc
smartctl 5.39.1 2010-01-28 r3054 [x86_64-unknown-linux-gnu] (local build)
Copyright (C) 2002-10 by Bruce Allen, http://smartmontools.sourceforge.net

=== START OF INFORMATION SECTION ===
Model Family:     Seagate Barracuda 7200.11 family
Device Model:     ST3500320AS
Serial Number:    9QM6A0SC
Firmware Version: SD15
User Capacity:    500,107,862,016 bytes
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:    Sat Apr 10 18:52:19 2010 EDT
SMART support is: Available - device has SMART capability.
SMART support is: Enabled


During the query of the drives you will see messages in /var/log/message. For example, the following is output when /dev/sda, /dev/sdb, and /dev/sdc were queried.

Apr 10 18:41:34 test64 smartd[3714]: Device /dev/sda: using '-d sat' for ATA disk behind SAT layer.
Apr 10 18:41:34 test64 smartd[3714]: Device: /dev/sda, opened
Apr 10 18:41:34 test64 smartd[3714]: Device: /dev/sda, found in smartd database.
Apr 10 18:41:34 test64 smartd[3714]: Device: /dev/sda, is SMART capable. Adding to "monitor" list.
Apr 10 18:41:34 test64 smartd[3714]: Device: /dev/sdb, opened
Apr 10 18:41:34 test64 smartd[3714]: Device /dev/sdb: using '-d sat' for ATA disk behind SAT layer.
Apr 10 18:41:34 test64 smartd[3714]: Device: /dev/sdb, opened
Apr 10 18:41:34 test64 smartd[3714]: Device: /dev/sdb, found in smartd database.
Apr 10 18:41:34 test64 smartd[3714]: Device: /dev/sdb, is SMART capable. Adding to "monitor" list.
Apr 10 18:41:34 test64 smartd[3714]: Device: /dev/sdc, opened
Apr 10 18:41:34 test64 smartd[3714]: Device /dev/sdc: using '-d sat' for ATA disk behind SAT layer.
Apr 10 18:41:34 test64 smartd[3714]: Device: /dev/sdc, opened
Apr 10 18:41:34 test64 smartd[3714]: Device: /dev/sdc, found in smartd database.
Apr 10 18:41:35 test64 smartd[3714]: Device: /dev/sdc, is SMART capable. Adding to "monitor" list.
Apr 10 18:41:35 test64 smartd[3714]: Monitoring 1 ATA and 3 SCSI devices
Apr 10 18:41:36 test64 smartd[3719]: smartd has fork()ed into background mode. New PID=3719.


The line that says “Adding to ‘monitor’ list” refers to the smart daemon that monitors the drives (smartd). We’ll talk more about smartd in a later article.

The next thing we should do is check the health of the devices. This is pretty simple using the “-H” option with smartctl. In this and subsequent examples, only /dev/sdb will be used for the sake of brevity.

[root@test64 laytonjb]# /usr/local/sbin/smartctl -H /dev/sdb
smartctl 5.39.1 2010-01-28 r3054 [x86_64-unknown-linux-gnu] (local build)
Copyright (C) 2002-10 by Bruce Allen, http://smartmontools.sourceforge.net

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


You can see that the drive passed the SMART health test (really this is the SMART status attribute of the drive). If you have a drive that didn’t pass, immediately back up that drive and pull it from service.

Now that we’ve scanned our storage devices and we know they are healthy let’s do something useful. In particular, let’s do the following:


  • Enable SMART permanently
  • Turn on offline data collection
  • Autosave device vendor-specific attributes through power cycles (so we don’t lose data between power cycles)

The smartctl command is, “smartctl -s on -o on -S on /dev/sdb”. I’m just using the /dev/sdb as an example (it would be the same for the other drives). The output from this command is,
[root@test64 laytonjb]# /usr/local/sbin/smartctl -s on -o on -S on /dev/sdb
smartctl 5.39.1 2010-01-28 r3054 [x86_64-unknown-linux-gnu] (local build)
Copyright (C) 2002-10 by Bruce Allen, http://smartmontools.sourceforge.net

=== START OF ENABLE/DISABLE COMMANDS SECTION ===
SMART Enabled.
SMART Attribute Autosave Enabled.
SMART Automatic Offline Testing Enabled every four hours.

Comments on "Smartmontools: Ya Mon!"

Nowadays, the conditions for your website to be ranked high in the search engine results are based on the search engine optimization techniques that you decide to use. The usual SEO methods include keyword research, link building and such. Forgetting to write for an audience is one of the biggest mistakes that bloggers make. You have to take price quotes from different SEO companies locally and internationally.

continuously i used to read smaller articles that as well clear their motive,
and that is also happening with this post which I am reading at this place.

With the whole thing which appears to be developing inside this subject matter, your points of view are generally fairly refreshing. On the other hand, I beg your pardon, because I do not subscribe to your entire theory, all be it exciting none the less. It appears to me that your commentary are actually not entirely justified and in fact you are yourself not fully certain of the assertion. In any case I did appreciate reading through it.

Throughout this grand scheme of things you secure a B+ just for hard work. Where exactly you misplaced me was on the facts. As they say, details make or break the argument.. And that couldn’t be much more accurate here. Having said that, let me say to you what exactly did give good results. Your article (parts of it) is incredibly convincing and this is probably why I am making the effort to comment. I do not really make it a regular habit of doing that. 2nd, although I can see a leaps in reason you come up with, I am not necessarily certain of just how you appear to unite the details which in turn produce the conclusion. For the moment I will subscribe to your position but hope in the near future you actually connect your dots much better.

If you child has sweaty feet, see a podiatric physician before all possible friends are running away from the odor. A strong character is needed in order to be successful in this game. It is in fact a steadfast work in progress, yet the payoff is actually spectacular.

The frame bag is a classic, but not ‘of-the-moment’ anymore. Try eating alot more nutritional fibre, or perhaps your Mister Hankey is often more such as Mr Tablecloth. The budget for buying bags depends from woman to woman.

Wow! This blog looks just like my old one! It’s on a totally different subject but it has pretty much the same page layout and design. Great choice of colors!

What i don’t realize is if truth be told how you are now not actually a lot more neatly-preferred than you may be now. You’re so intelligent. You realize thus significantly with regards to this matter, made me for my part consider it from so many various angles. Its like men and women aren’t fascinated except it’s one thing to do with Woman gaga! Your own stuffs outstanding. Always handle it up!

I do like the manner in which you have framed this difficulty and it does indeed provide us a lot of fodder for thought. However, from everything that I have experienced, I really trust when other commentary stack on that folks keep on point and not get started upon a soap box associated with some other news du jour. Anyway, thank you for this superb point and even though I do not necessarily agree with it in totality, I value your viewpoint.

A lot of of the things you say is astonishingly accurate and that makes me ponder the reason why I hadn’t looked at this with this light before. Your piece truly did turn the light on for me as far as this subject goes. Nonetheless there is one particular issue I am not necessarily too cozy with and whilst I attempt to reconcile that with the main theme of your issue, allow me see just what all the rest of your readers have to say.Well done.

I do enjoy the manner in which you have presented this particular issue and it does indeed offer me personally a lot of fodder for thought. On the other hand, through everything that I have experienced, I simply just hope when the actual comments pile on that men and women continue to be on issue and not get started on a soap box associated with the news of the day. All the same, thank you for this exceptional piece and while I can not necessarily go along with it in totality, I value your point of view.

When I originally commented I clicked the “Notify me when new comments are added” checkbox and now each time a comment is added I get four e-mails with the same comment. Is there any way you can remove me from that service? Many thanks!

Check beneath, are some absolutely unrelated sites to ours, nonetheless, they are most trustworthy sources that we use.

Hi, I do think this is an excellent web site. I stumbledupon it ;) I will come back once again since I saved as a favorite it. Money and freedom is the greatest way to change, may you be rich and continue to help other people.

What’s Taking place i’m new to this, I stumbled upon this I’ve discovered It positively useful and it has helped me out loads. I am hoping to give a contribution & aid other customers like its aided me. Good job.

I all the time used to study paragraph in news papers but now as I am a user of web so from now I am using net for posts, thanks to web.

Hello everyone, it’s my first pay a quick visit at this site, and piece of writing is in fact fruitful for me, keep up posting these types of articles.

Ahaa, its fastidious dialogue about this post here at this web site, I have read all that, so now me also commenting here.

Oh my goodness! Impressive article dude! Thank you so much, However I am having issues with your RSS. I don’t know why I can’t subscribe to it. Is there anybody getting the same RSS issues? Anybody who knows the answer can you kindly respond? Thanks!!

Great article, just what I was looking for.

Almost all of what you state is supprisingly appropriate and it makes me ponder the reason why I had not looked at this with this light previously. Your article truly did turn the light on for me personally as far as this particular subject goes. However at this time there is actually 1 point I am not really too cozy with so whilst I make an effort to reconcile that with the actual core idea of your position, permit me observe just what all the rest of your visitors have to say.Well done.

Thanks for one’s marvelous posting! I actually enjoyed reading it, you happen to be a great author. I will be sure to bookmark your blog and will often come back someday. I want to encourage you to continue your great work, have a nice afternoon!

Fabulous, what a blog it is! This web site presents valuable data to us, keep it up.

Good info. Lucky me I found your website by chance (stumbleupon). I have saved as a favorite for later!

Whats up very nice site!! Guy .. Beautiful .. Wonderful .. I’ll bookmark your website and take the feeds additionally? I’m glad to search out a lot of useful info here within the publish, we need develop more strategies in this regard, thanks for sharing. . . . . .

I do agree with all the ideas you have offered on your post. They’re very convincing and can definitely work. Still, the posts are too short for novices. May you please lengthen them a bit from subsequent time? Thanks for the post.

Appreciate you sharing, great article.Really thank you! Cool.

I’m extremely pleased to discover this web site.
I want to to thank you for your time due to this fantastic read!!

I definitely appreciated every little bit of it and
i also have you saved to fav to see new information on your blog.

Just beneath, are various absolutely not related web pages to ours, nonetheless, they are certainly really worth going over.

In this awesome scheme of things you receive a B+ with regard to hard work. Exactly where you confused me personally ended up being on the facts. You know, as the maxim goes, details make or break the argument.. And that couldn’t be more true in this article. Having said that, let me reveal to you just what did do the job. Your writing is certainly incredibly persuasive and this is probably the reason why I am making an effort in order to comment. I do not really make it a regular habit of doing that. Secondly, while I can certainly notice the jumps in logic you come up with, I am not really convinced of just how you seem to unite the points which inturn produce your final result. For now I will, no doubt yield to your point however trust in the near future you link the facts better.

Almost all of whatever you claim happens to be astonishingly accurate and it makes me ponder the reason why I had not looked at this with this light previously. This article really did turn the light on for me personally as far as this issue goes. Nevertheless at this time there is actually 1 point I am not really too cozy with and while I make an effort to reconcile that with the actual main theme of the point, permit me observe what the rest of the readers have to say.Well done.

One of our guests lately encouraged the following website.

I simply want to mention I’m very new to blogging and actually savored you’re website. Very likely I’m want to bookmark your blog post . You absolutely come with amazing posts. Kudos for sharing with us your webpage.

It’s actually a cool and useful piece of information. I’m glad that you simply shared this useful info with us. Please keep us informed like this. Thank you for sharing.

Here are some hyperlinks to sites that we link to for the reason that we think they may be worth visiting.

The time to read or stop by the content or internet sites we’ve linked to below.

Below you will locate the link to some web pages that we assume you ought to visit.

Great topic and well written. Do you have any more resources about this that you reccommend?

Great topic and well written. Do you have any more resources about this that you reccommend?

Great topic and well written. Do you have any more resources about this that you reccommend?

Great topic and well written. Do you have any more resources about this that you reccommend?

Top-notch post it is without doubt. My boss has been awaiting for this tips.

Hi! This is my first visit to your blog! We are a collection of volunteers and starting a new initiative in a community in the same niche. Your blog provided us beneficial information to work on. You have done a marvellous job!

Great post and straight to the point. I am not sure if this is truly the best place to ask but do you folks have any thoughts on where to hire some professional writers? Thanks :)

Every weekend i used to pay a visit this web page, because i want enjoyment, since this this web site conations in fact fastidious funny stuff too.

F*ckin’ amazing things here. I am very satisfied to see your article. Thanks so much and i’m having a look forward to contact you. Will you kindly drop me a mail?

Very nice article and straight to the point. I am not sure if this is in fact the best place to ask but do you people have any thoughts on where to hire some professional writers? Thanks :)

Great web site you have got here.. It’s hard to find good quality writing like yours these days. I really appreciate individuals like you! Take care!!

When someone writes an post he/she keeps the idea of a user in his/her mind that how a user can understand it. Thus that’s why this paragraph is outstdanding. Thanks!

Great topic and well written. Do you have any more resources about this that you reccommend?

Leave a Reply