{"id":233,"date":"2014-04-17T15:23:48","date_gmt":"2014-04-17T15:23:48","guid":{"rendered":"https:\/\/qbytes.cloud\/?p=233"},"modified":"2014-04-17T15:23:48","modified_gmt":"2014-04-17T15:23:48","slug":"hard-drive-tools","status":"publish","type":"post","link":"https:\/\/www.qbytes.cloud\/index.php\/2014\/04\/17\/hard-drive-tools\/","title":{"rendered":"Hard Drive Tools"},"content":{"rendered":"<p>With respect to hard drives, the acronym &#8220;SMART&#8221; stands for Self-Monitoring, Analysis and Reporting Technology. This was built into many ATA-3 and later ATA, IDE and SCSI-3 hard drives. Basically anything after about 2005 should have it.<\/p>\n<p>Ubuntu\/Debian:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nsudo apt-get install smartmontools\n\n<\/pre>\n<p>CentOS\/Fedora\/RH:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nsudo yum install smartmontools\n\n<\/pre>\n<p>Gentoo:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nsudo emerge sys-apps\/smartmontools\n\n<\/pre>\n<p>Wiki: <a href=\"http:\/\/sourceforge.net\/apps\/trac\/smartmontools\/wiki\" target=\"_blank\" rel=\"noopener\">http:\/\/sourceforge.net\/apps\/trac\/smartmontools\/wiki<\/a><\/p>\n<p>smartctl<\/p>\n<p>The program smartctl is used to interface with the SMART features on the drive firmware. Here are a couple of easy things to get started with (however some versions do not have the &#8211;scan option):<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n\n$ smartctl --scan -d ata\n\/dev\/hda -d ata # \/dev\/hda, ATA device\n\/dev\/hdc -d ata # \/dev\/hdc, ATA device\n$ sudo smartctl --info \/dev\/hdc\nsmartctl 5.42 2011-10-20 r3458 &#x5B;i686-linux-2.6.33.1-xedvia] (local\nbuild)\nCopyright (C) 2002-11 by Bruce Allen,\nhttp:\/\/smartmontools.sourceforge.net\n\n=== START OF INFORMATION SECTION ===\nModel Family:     Seagate Barracuda 7200.7 and 7200.7 Plus\nDevice Model:     ST3160023A\nSerial Number:    5JS9MDKW\nFirmware Version: 8.01\nUser Capacity:    160,041,885,696 bytes &#x5B;160 GB]\nSector Size:      512 bytes logical\/physical\nDevice is:        In smartctl database &#x5B;for details use: -P show]\nATA Version is:   6\nATA Standard is:  ATA\/ATAPI-6 T13 1410D revision 2\nLocal Time is:    Thu Feb  7 09:27:18 2013 PST\nSMART support is: Available - device has SMART capability.\nSMART support is: Disabled\n\n<\/pre>\n<p>Note that the &#8220;SMART support&#8221; is listed as available but disabled. To enable full diagnostic checking turn it on with something like this:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n\n$ sudo smartctl --smart=on --offlineauto=on --saveauto=on \/dev\/hdc\n=== START OF ENABLE\/DISABLE COMMANDS SECTION ===\nSMART Enabled.\nSMART Attribute Autosave Enabled.\nSMART Automatic Offline Testing Enabled every four hours.\n\n<\/pre>\n<p>In theory this should only need to be done once and the drive should remember this (because of the saveauto directive). The offlineauto will cause automatic testing every 4 hours. In theory it will wait &#8220;nicely&#8221; if the drive is already busy so performance should not be seriously impacted.<br \/>\nTesting<\/p>\n<p>Here\u2019s a way to run a &#8220;short&#8221; off-line test. This tests electrical and mechanical performance of the drive and does read testing.<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n\n$ sudo smartctl --test=short \/dev\/hda\n=== START OF OFFLINE IMMEDIATE AND SELF-TEST SECTION ===\nSending command: &quot;Execute SMART Short self-test routine immediately in off-line mode&quot;.\nDrive command &quot;Execute SMART Short self-test routine immediately in off-line mode&quot; successful.\nTesting has begun.\nPlease wait 1 minutes for test to complete.\nTest will complete after Thu Feb  7 10:13:19 2013\nUse smartctl -X to abort test.\n\n$ sudo smartctl --log=selftest \/dev\/hda\n=== START OF READ SMART DATA SECTION ===\nSMART Self-test log structure revision number 1\nNum  Test_Description    Status                  Remaining LifeTime(hours)  LBA_of_first_error\n# 1  Short offline       Completed without error       00%     43398        -\n\n$ sudo smartctl --log=selftest \/dev\/hdc\n=== START OF READ SMART DATA SECTION ===\nSMART Self-test log structure revision number 1\nNum  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error\n# 1  Short offline       Completed: read failure       90%     37994         7234643\n\n<\/pre>\n<p>The first command starts the test off and it tells you to come back in 1 or 2 minutes. The second command shows how to query the log file to see if anything bad came up. In this case hda was fine (&#8220;Completed without error&#8221;) but hdc had a very important &#8220;read error&#8221;. Replace that drive ASAP!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>With respect to hard drives, the acronym &#8220;SMART&#8221; stands for Self-Monitoring, Analysis and Reporting Technology. This was built into many ATA-3 and later ATA, IDE and SCSI-3 hard drives. Basically anything after about 2005 should have it. Ubuntu\/Debian: sudo apt-get install smartmontools CentOS\/Fedora\/RH: sudo yum install smartmontools Gentoo: sudo emerge sys-apps\/smartmontools Wiki: http:\/\/sourceforge.net\/apps\/trac\/smartmontools\/wiki smartctl The &#8230; <a title=\"Hard Drive Tools\" class=\"read-more\" href=\"https:\/\/www.qbytes.cloud\/index.php\/2014\/04\/17\/hard-drive-tools\/\" aria-label=\"Read more about Hard Drive Tools\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[47],"tags":[],"class_list":["post-233","post","type-post","status-publish","format-standard","hentry","category-hardware"],"_links":{"self":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts\/233","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/comments?post=233"}],"version-history":[{"count":0,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts\/233\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/media?parent=233"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/categories?post=233"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/tags?post=233"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}