{"id":2379,"date":"2022-08-11T09:23:42","date_gmt":"2022-08-11T01:23:42","guid":{"rendered":"https:\/\/www.wjxy.net.cn\/?p=2379"},"modified":"2023-10-04T06:31:36","modified_gmt":"2023-10-03T22:31:36","slug":"%e7%a1%ac%e7%9b%98%e6%a3%80%e6%b5%8b%e5%b7%a5%e5%85%b7-smartctl%e7%9a%84%e4%bd%bf%e7%94%a8","status":"publish","type":"post","link":"https:\/\/www.wjxy.net.cn\/?p=2379","title":{"rendered":"\u786c\u76d8\u68c0\u6d4b\u5de5\u5177-smartctl\u7684\u4f7f\u7528"},"content":{"rendered":"<p>\u663e\u793a\u6240\u6709smart\u8bbe\u5907\uff1asmartctl &#8211;scan<br \/>\n\u5173\u95ed\u786c\u76d8:smartctl -s off \/dev\/sda<br \/>\n\u5f00\u542f\u786c\u76d8:smartctl -s on \/dev\/sda<br \/>\n\u67e5\u770b\u786c\u76d8\uff1asmartctl -a \/dev\/sda<br \/>\n\u67e5\u770b\u9635\u5217\u8bbe\u5907:smartctl -a -d megaraid,5 \/dev\/sdc<br \/>\n\u5728\u7ebf\u5feb\u901f\u6d4b\u8bd5\uff1a \u5927\u7ea62\u5206\u949f:smartctl -t short \/dev\/sdb<br \/>\n\u5728\u7ebf\u957f\u6d4b\u8bd5: (1T\u5927\u7ea64\u5c0f\u65f6):smartctl -t long \/dev\/sdb<br \/>\n\u7ec8\u6b62\u6b63\u5728\u8fdb\u884c\u7684\u6d4b\u8bd5smartctl -X \/dev\/sdb<br \/>\n\u5728\u6d4b\u8bd5\u7ed3\u675f\u540e\u83b7\u53d6\u6d4b\u8bd5\u7ed3\u679c:smatrctl -l selftest \/dev\/sdb<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" width=\"643\" height=\"133\" class=\"alignnone wp-image-2386 size-full\" src=\"https:\/\/www.wjxy.net.cn\/wp-content\/uploads\/2022\/08\/Pasted-1.png\" srcset=\"https:\/\/www.wjxy.net.cn\/wp-content\/uploads\/2022\/08\/Pasted-1.png 643w, https:\/\/www.wjxy.net.cn\/wp-content\/uploads\/2022\/08\/Pasted-1-300x62.png 300w\" sizes=\"(max-width: 643px) 100vw, 643px\" \/><\/p>\n<p>\u9635\u5217\u5361megaraid,0\u8868\u793a\u7b2c\u4e00\u5757\u786c\u76d8 megaraid,1\u8868\u793a\u7b2c\u4e8c\u5757\u786c\u76d8\u4ee5\u6b64\u7c7b\u63a8<\/p>\n<ul>\n<li>\u67e5\u770b\u786c\u76d8\u7684\u6240\u6709<code>smart<\/code>\u4fe1\u606f\n<div class=\"_2Uzcx_\">\n<p>&nbsp;<\/p>\n<pre class=\"line-numbers language-bash\"><code class=\"bash language-bash\">[root@server ~]# smartctl -a \/dev\/sda\r\n# \u5bf9\u4e8eraid\u8bbe\u5907, \u9700\u8981\u52a0\u4e0a `-d megaraid,{n}`  n \u4e3araid\u63a7\u5236\u5668\u7684\u7f16\u53f7\r\n[root@server ~]# #smartctl -a \/dev\/sda -d megaraid,{n}\r\n<\/code><\/pre>\n<\/div>\n<\/li>\n<li>\u67e5\u770b\u786c\u76d8\u7684\u6240\u6709<code>smart<\/code>\u548c<code>\u975esmart<\/code>\u7684\u4fe1\u606f\n<div class=\"_2Uzcx_\">\n<p>&nbsp;<\/p>\n<pre class=\"line-numbers language-bash\"><code class=\"bash language-bash\">[root@server ~]# smartctl -x \/dev\/sdb\r\n<\/code><\/pre>\n<\/div>\n<\/li>\n<li>\u67e5\u770b\u7cfb\u7edf\u4e0a\u7684\u6240\u6709\u8bbe\u5907\n<div class=\"_2Uzcx_\">\n<p>&nbsp;<\/p>\n<pre class=\"line-numbers language-bash\"><code class=\"bash language-bash\">[root@server ~]# smartctl --scan\r\n\/dev\/sda -d scsi # \/dev\/sda, SCSI device\r\n\/dev\/sdb -d scsi # \/dev\/sdb, SCSI device\r\n\/dev\/sdd -d scsi # \/dev\/sdd, SCSI device\r\n\/dev\/sde -d scsi # \/dev\/sde, SCSI device\r\n<\/code><\/pre>\n<\/div>\n<\/li>\n<li>\u67e5\u770b<code>non-smart<\/code>\u8bbe\u5907\u7684\u914d\u7f6e\n<div class=\"_2Uzcx_\">\n<p>&nbsp;<\/p>\n<pre class=\"line-numbers language-bash\"><code class=\"bash language-bash\"># -g \u53ef\u9009\u53c2\u6570 {aam, apm, lookahead, security, wcache, rcache, wcreorder}\r\n[root@server ~]# smartctl -g apm \/dev\/sda\r\nsmartctl 6.5 2016-05-07 r4318 [x86_64-linux-3.10.0-957.27.2.el7.x86_64] (local build)\r\nCopyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org\r\n\r\nAPM feature is:   Disabled\r\n<\/code><\/pre>\n<\/div>\n<\/li>\n<li>\u6307\u5b9a\u6a21\u5f0f\u67e5\u8be2\u78c1\u76d8\u4fe1\u606f\n<div class=\"_2Uzcx_\">\n<p>&nbsp;<\/p>\n<pre class=\"line-numbers language-bash\"><code class=\"bash language-bash\"># -q \u53ef\u9009\u53c2\u6570 {errorsonly, silent, noserial}\r\n[root@server ~]# smartctl -a -q noserial \/dev\/sda    # \u4e0d\u6253\u5370\u786c\u76d8\u7684\u5e8f\u5217\u53f7\r\n[root@server ~]# smartctl -a -q silent \/dev\/sda     # \u9759\u9ed8\u6a21\u5f0f,\u4e0d\u4f1a\u8f93\u51fa\u4efb\u4f55\u4fe1\u606f\r\n[root@server ~]# smartctl -a -q errorsonly \/dev\/sda -l error  # \u5c06\u786c\u76d8\u76f8\u5173\u7684\u9519\u8bef\u4fe1\u606f\u8bb0\u5f55\u5230smart\u65e5\u5fd7\u4e2d\uff0c\u5e76\u5728\u5f00\u673a\u7684\u65f6\u5019\u5c55\u793a\u5728\u542f\u52a8\u754c\u9762\r\n<\/code><\/pre>\n<\/div>\n<\/li>\n<li>\u67e5\u770b\u6307\u5b9a\u7c7b\u578b\u7684\u786c\u76d8\u4fe1\u606f\n<div class=\"_2Uzcx_\">\n<p>&nbsp;<\/p>\n<pre class=\"line-numbers language-bash\"><code class=\"bash language-bash\"># -d \u53ef\u9009\u53c2\u6570 {ata, scsi, nvme[,NSID], sat[,auto][,N][+TYPE], usbcypress[,X], usbjmicron[,p][,x][,N], usbprolific, usbsunplus, marvell, areca,N\/E, 3ware,N, hpt,L\/M\/N, megaraid,N, aacraid,H,L,ID, cciss,N, auto, test}\r\n[root@server ~]# smartctl -a -d megaraid,0 \/dev\/sda \r\n[root@server ~]# smartctl -a -d scsi \/dev\/sda\r\n<\/code><\/pre>\n<\/div>\n<\/li>\n<li>\u67e5\u770b\u786c\u76d8\u7684\u5065\u5eb7\u72b6\u51b5\n<div class=\"_2Uzcx_\">\n<p>&nbsp;<\/p>\n<pre class=\"line-numbers language-bash\"><code class=\"bash language-bash\">[root@server ~]# smartctl -H \/dev\/sda\r\nsmartctl 6.5 2016-05-07 r4318 [x86_64-linux-3.10.0-957.27.2.el7.x86_64] (local build)\r\nCopyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org\r\n\r\n=== START OF READ SMART DATA SECTION ===\r\nSMART overall-health self-assessment test result: PASSED\r\n<\/code><\/pre>\n<\/div>\n<\/li>\n<li><code>long<\/code> \u7c7b\u578b\u7684\u786c\u76d8\u6d4b\u8bd5\n<div class=\"_2Uzcx_\">\n<p>&nbsp;<\/p>\n<pre class=\"line-numbers language-bash\"><code class=\"bash language-bash\">[root@server ~]# smartctl --test=long \/dev\/sda\r\nsmartctl 6.5 2016-05-07 r4318 [x86_64-linux-3.10.0-957.27.2.el7.x86_64] (local build)\r\nCopyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org\r\n\r\n=== START OF OFFLINE IMMEDIATE AND SELF-TEST SECTION ===\r\nSending command: \"Execute SMART Extended self-test routine immediately in off-line mode\".\r\nDrive command \"Execute SMART Extended self-test routine immediately in off-line mode\" successful.\r\nTesting has begun.\r\nPlease wait 42 minutes for test to complete.\r\nTest will complete after Thu Dec  9 16:50:50 2021\r\n\r\nUse smartctl -X to abort test.\r\n<\/code><\/pre>\n<\/div>\n<\/li>\n<li>\u542f\u7528\u786c\u76d8\u7684 <code>smart<\/code> \u529f\u80fd\n<div class=\"_2Uzcx_\">\n<p>&nbsp;<\/p>\n<pre class=\"line-numbers language-bash\"><code class=\"bash language-bash\">[root@server ~]# smartctl --smart=on --offlineauto=on --saveauto=on \/dev\/sda\r\n<\/code><\/pre>\n<\/div>\n<p>\u6ce8\uff1a\u4e00\u4e9b\u786c\u76d8\u662f\u4e0d\u652f\u6301<code>smart<\/code>\u7684\uff0c\u56e0\u6b64\u867d\u7136\u53ef\u4ee5\u901a\u8fc7<code>smartctl<\/code>\u5c55\u793a\u51fa\u6765\uff0c\u4f46\u65e0\u6cd5\u67e5\u770b\u786c\u76d8\u7684\u8be6\u7ec6\u53c2\u6570\u3002<\/li>\n<\/ul>\n<p>\u4f5c\u8005\uff1a\u5f52\u6e90<br \/>\n\u94fe\u63a5\uff1ahttps:\/\/www.jianshu.com\/p\/0a9a217dc2dd<br \/>\n\u6765\u6e90\uff1a\u7b80\u4e66<br \/>\n\u8457\u4f5c\u6743\u5f52\u4f5c\u8005\u6240\u6709\u3002\u5546\u4e1a\u8f6c\u8f7d\u8bf7\u8054\u7cfb\u4f5c\u8005\u83b7\u5f97\u6388\u6743\uff0c\u975e\u5546\u4e1a\u8f6c\u8f7d\u8bf7\u6ce8\u660e\u51fa\u5904\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u663e\u793a\u6240\u6709smart\u8bbe\u5907\uff1asmartctl &#8211;scan \u5173\u95ed\u786c\u76d8:smartctl -s off \/ [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[28],"tags":[],"_links":{"self":[{"href":"https:\/\/www.wjxy.net.cn\/index.php?rest_route=\/wp\/v2\/posts\/2379"}],"collection":[{"href":"https:\/\/www.wjxy.net.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wjxy.net.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wjxy.net.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wjxy.net.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2379"}],"version-history":[{"count":6,"href":"https:\/\/www.wjxy.net.cn\/index.php?rest_route=\/wp\/v2\/posts\/2379\/revisions"}],"predecessor-version":[{"id":2387,"href":"https:\/\/www.wjxy.net.cn\/index.php?rest_route=\/wp\/v2\/posts\/2379\/revisions\/2387"}],"wp:attachment":[{"href":"https:\/\/www.wjxy.net.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2379"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wjxy.net.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2379"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wjxy.net.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2379"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}