{"id":1345,"date":"2014-11-27T23:15:25","date_gmt":"2014-11-27T23:15:25","guid":{"rendered":"https:\/\/qbytes.cloud\/?p=1345"},"modified":"2014-11-27T23:15:25","modified_gmt":"2014-11-27T23:15:25","slug":"smartctl-linux","status":"publish","type":"post","link":"https:\/\/www.qbytes.cloud\/index.php\/2014\/11\/27\/smartctl-linux\/","title":{"rendered":"Smartctl on Linux"},"content":{"rendered":"<p>SMART (Self-Monitoring, Analysis, and Reporting Technology) allows you to see the status or overall health of a hard drive. This information is instumental in providing warning signs of problems with a hard drive.<\/p>\n<p>All Linux distributions provide the smartmontools package, which contain the smartctl program used to display SMART information from attached drives. This package also provides the smartd daemon which periodically polls the drives to obtain SMART information.<\/p>\n<p>Using smartd is essential as it can let you know immediately when a SMART attribute fails. <\/p>\n<p>With the -i option, you can view the type of drive, its serial number, and so forth. In a system with a lot of drives, having this information recorded can assist in knowing which drive device (i.e., \/dev\/sda) corresponds with which physical drive.<\/p>\n<p>Install:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n# yum install smartmontools\n<\/pre>\n<p>Now start the service of Smartctl. <\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n\n#service smartd start \n# chkconfig smartd on\n\n<\/pre>\n<p>To enable Smart Capability for the disk run below command. <\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n#smartctl -s on \/dev\/sdb\n<\/pre>\n<p>To disable Smart Capability for the disk run below command. <\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n\n#smartctl -s off  \/dev\/sdb\n\n<\/pre>\n<p>To display details Smart info for the disk run below command. <\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n\n#smartctl -a \/dev\/sdb              \/\/ For IDE drive\n#smartctl -a -d ata \/dev\/sdb       \/\/ For SATA drive\n\n<\/pre>\n<p>To begin, see what the drive details are:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n\n&#x5B;root@austin ~]# fdisk -l\n\nDisk \/dev\/sda: 250.0 GB, 250000000000 bytes\n255 heads, 63 sectors\/track, 30394 cylinders\nUnits = cylinders of 16065 * 512 = 8225280 bytes\nSector size (logical\/physical): 512 bytes \/ 512 bytes\nI\/O size (minimum\/optimal): 512 bytes \/ 512 bytes\nDisk identifier: 0x00000000\n\n   Device Boot      Start         End      Blocks   Id  System\n\/dev\/sda1   *           1          62      497983+  83  Linux\n\/dev\/sda2              64         584     4184932+  82  Linux swap \/ Solaris\n\/dev\/sda3             585       30390   239416695   82  Linux swap \/ Solaris\n\n<\/pre>\n<p>Now we know the single drive is sda. Also, you can usually identify which hard disks are on your system by<br \/>\nlooking in \/proc\/ide and in \/proc\/scsi.<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n# smartctl -i \/dev\/sda\n<\/pre>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nroot@austin ~]# smartctl -i \/dev\/sda\nsmartctl 5.43 2012-06-30 r3573 &#x5B;x86_64-linux-2.6.32-504.el6.x86_64] (local build)\nCopyright (C) 2002-12 by Bruce Allen, http:\/\/smartmontools.sourceforge.net\n\n=== START OF INFORMATION SECTION ===\nModel Family:     Western Digital RE3 Serial ATA\nDevice Model:     WDC WD2502ABYS-18B7A0\nSerial Number:    WD-WCAT19910234\nLU WWN Device Id: 5 0014ee 157014252\nFirmware Version: 02.03B04\nUser Capacity:    250,000,000,000 bytes &#x5B;250 GB]\nSector Size:      512 bytes logical\/physical\nDevice is:        In smartctl database &#x5B;for details use: -P show]\nATA Version is:   8\nATA Standard is:  Exact ATA specification draft version not indicated\nLocal Time is:    Thu Nov 27 16:10:20 2014 MST\nSMART support is: Available - device has SMART capability.\nSMART support is: Enabled\n\n&#x5B;root@austin ~]# smartctl -i \/dev\/sda\nsmartctl 5.43 2012-06-30 r3573 &#x5B;x86_64-linux-2.6.32-504.el6.x86_64] (local build)\nCopyright (C) 2002-12 by Bruce Allen, http:\/\/smartmontools.sourceforge.net\n\n=== START OF INFORMATION SECTION ===\nModel Family:     Western Digital RE3 Serial ATA\nDevice Model:     WDC WD2502ABYS-18B7A0\nSerial Number:    WD-WCAT19910234\nLU WWN Device Id: 5 0014ee 157014252\nFirmware Version: 02.03B04\nUser Capacity:    250,000,000,000 bytes &#x5B;250 GB]\nSector Size:      512 bytes logical\/physical\nDevice is:        In smartctl database &#x5B;for details use: -P show]\nATA Version is:   8\nATA Standard is:  Exact ATA specification draft version not indicated\nLocal Time is:    Thu Nov 27 16:14:54 2014 MST\nSMART support is: Available - device has SMART capability.\nSMART support is: Enabled\n\n<\/pre>\n<p>Now, edit \/etc\/smartd.conf and add entries for your drives:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n\n\/dev\/sda -d ata -H -m root\n\/dev\/sdb -d ata -H -m root\n\n<\/pre>\n<p>Turn the service on:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n\n# chkconfig smartd on\n# service smartd start\n\n<\/pre>\n<p>The smartctl program also allows for you to view and test SMART attributes of a drive. You can quickly check the overall health of a drive by using:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n# smartctl -H \/dev\/sda\n<\/pre>\n<p>smartctl can be used to initiate long and short tests for the drive. These should be run periodically to do quick, or full, self-tests of the drive:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n\n# smartctl --test=short \/dev\/sda\n# smartctl --test=long \/dev\/sda\n# smartctl -a \/dev\/sda\n\n<\/pre>\n<p>More info : https:\/\/wiki.archlinux.org\/index.php\/S.M.A.R.T.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>SMART (Self-Monitoring, Analysis, and Reporting Technology) allows you to see the status or overall health of a hard drive. This information is instumental in providing warning signs of problems with a hard drive. All Linux distributions provide the smartmontools package, which contain the smartctl program used to display SMART information from attached drives. This package &#8230; <a title=\"Smartctl on Linux\" class=\"read-more\" href=\"https:\/\/www.qbytes.cloud\/index.php\/2014\/11\/27\/smartctl-linux\/\" aria-label=\"Read more about Smartctl on Linux\">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":[2,47],"tags":[139],"class_list":["post-1345","post","type-post","status-publish","format-standard","hentry","category-administration","category-hardware","tag-linux"],"_links":{"self":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts\/1345","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=1345"}],"version-history":[{"count":0,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts\/1345\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/media?parent=1345"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/categories?post=1345"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/tags?post=1345"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}