{"id":3091,"date":"2019-06-14T11:58:37","date_gmt":"2019-06-14T03:58:37","guid":{"rendered":"https:\/\/www.linuxcool.com\/?p=3091"},"modified":"2019-06-16T12:42:09","modified_gmt":"2019-06-16T04:42:09","slug":"badblocks","status":"publish","type":"post","link":"https:\/\/www.linuxcool.com\/badblocks","title":{"rendered":"badblocks\u547d\u4ee4 – \u68c0\u67e5\u78c1\u76d8\u88c5\u7f6e\u4e2d\u635f\u574f\u7684\u533a\u5757"},"content":{"rendered":"\n

badblocks\u5c31\u662f\u4e00\u4e2a\u68c0\u67e5\u78c1\u76d8\u88c5\u7f6e\u4e2d\u635f\u574f\u533a\u5757\u7684\u547d\u4ee4\uff0c\u6267\u884c\u8be5\u547d\u4ee4\u65f6\u53ea\u987b\u6307\u5b9a\u6240\u8981\u68c0\u67e5\u7684\u78c1\u76d8\u88c5\u7f6e\uff0c\u53ca\u6b64\u88c5\u7f6e\u7684\u78c1\u76d8\u533a\u5757\u6570\u3002<\/p>\n\n\n\n

\u8bed\u6cd5\u683c\u5f0f\uff1a<\/strong>badblocks [\u53c2\u6570] <\/p>\n\n\n\n

\u5e38\u7528\u53c2\u6570\uff1a<\/strong><\/p>\n\n\n\n
-b<\/td>\u6307\u5b9a\u78c1\u76d8\u7684\u533a\u5757\u5927\u5c0f\uff0c\u5355\u4f4d\u4e3a\u5b57\u8282 <\/td><\/tr>
-o<\/td>\u5c06\u68c0\u67e5\u7684\u7ed3\u679c\u5199\u5165\u6307\u5b9a\u7684\u8f93\u51fa\u6587\u4ef6 <\/td><\/tr>
-s<\/td>\u5728\u68c0\u67e5\u65f6\u663e\u793a\u8fdb\u5ea6 <\/td><\/tr>
-v<\/td>\u6267\u884c\u65f6\u663e\u793a\u8be6\u7ec6\u7684\u4fe1\u606f <\/td><\/tr>
-w<\/td>\u5728\u68c0\u67e5\u65f6\uff0c\u6267\u884c\u5199\u5165\u6d4b\u8bd5 <\/td><\/tr><\/tbody><\/table>\n\n\n\n

\u53c2\u8003\u5b9e\u4f8b<\/strong><\/p>\n\n\n\n

\u901a\u8fc7\u547d\u4ee4\u626b\u63cf\u786c\u76d8\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# badblocks -s -v \/dev\/sdnx<\/pre>\n\n\n\n

\u5176\u4e2dn\u8868\u793a\u786c\u76d8\u8bbe\u5907\u540d\uff0cx\u8868\u793a\u786c\u76d8\u5bf9\u5e94\u7684\u5206\u533a\u53f7\uff0c\u4f8b\u5982\u9700\u8981\u68c0\u67e5”\/dev\/sda2″\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# badblocks -s -v \/dev\/sda2\n \nChecking blocks 0 to 30681000 \nChecking for bad blocks (read-only test): 306809600674112\/ 306810000000 30680964\n30680965\n30680966\n30680967\n30680968\n30680969\n30680970\n30680971\n30680972\n30680973 \n...\ndone Pass completed, 37 bad blocks found.\u5176\u4e2d\uff0c\u201c37 bad blocks found\u201d\u8868\u793a\u786c\u76d8\u5b58\u572837\u4e2a\u574f\u5757\u3002<\/pre>\n\n\n\n

\u4ee54096\u5b57\u8282\u4e3a\u4e00\u4e2a\u201cblock\u201d,\u6bcf\u4e00\u4e2a\u201cblock\u201d\u68c0\u67e51\u6b21, \u5c06\u7ed3\u679c\u8f93\u51fa\u5230\u201chda-badblocks-list.1\u201d\u6587\u4ef6\u4e2d\uff0c\u7531\u7b2c51000 block\u5f00\u59cb\uff0c\u523063000 block\u7ed3\u675f\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# badblocks -b 4096 -c 1 \/dev\/hda1 -o hda-badblocks-list.1 63000 51000<\/pre>\n\n\n\n

\u626b\u63cf\u786c\u76d8\u7684\u635f\u574f\u6247\u533a\u6216\u533a\u5757\u5e76\u5199\u5165\u5230\u4e34\u65f6\u6587\u4ef6\u5939\u4e0b\u7684bad-blocks.txt\u6587\u4ef6\u4e2d\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# badblocks -v -o \/dev\/sdb > \/tmp\/bad-blocks.txt<\/pre>\n\n\n\n

\u5982\u679c\u627e\u5230\u4e86\u574f\u9053\uff0c\u53ef\u4ee5\u8fdb\u884c\u5199\u5165\u626b\u63cf\u8fdb\u884c\u4fee\u590d\u3002\u5199\u5165\u626b\u63cf\u9047\u5230\u574f\u9053\u7684\u65f6\u5019\u4f1a\u81ea\u52a8\u91cd\u6620\u5c04\u3002\u5199\u5165\u626b\u63cf\u4f1a\u8986\u76d6\u539f\u6709\u6570\u636e\uff0c\u6240\u4ee5\u8bf7\u5148\u5907\u4efd\u3002\u5199\u5165\u626b\u63cf\u901f\u5ea6\u5f88\u4f4e\uff0c\u6240\u4ee5\u5e94\u8be5\u53ea\u626b\u63cf\u53ea\u8bfb\u626b\u63cf\u65f6\u5019\u53d1\u73b0\u9519\u8bef\u7684\u90e8\u5206\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# badblocks -w -s \/dev\/sdb END START<\/pre>\n\n\n\n

\u5c06END\u548cSTART\u6362\u6210\u7ed3\u675f\u548c\u5f00\u59cb\u7684\u5757\u7684\u7f16\u53f7\u5c31\u53ef\u4ee5\u4e86\u3002 <\/p>\n","protected":false},"excerpt":{"rendered":"

badblocks\u5c31\u662f\u4e00\u4e2a\u68c0\u67e5\u78c1\u76d8\u88c5\u7f6e\u4e2d\u635f\u574f\u533a\u5757\u7684\u547d\u4ee4\uff0c\u6267\u884c\u8be5\u547d\u4ee4\u65f6\u53ea\u987b\u6307\u5b9a\u6240\u8981\u68c0\u67e5\u7684\u78c1\u76d8\u88c5\u7f6e\uff0c\u53ca\u6b64\u88c5\u7f6e\u7684\u78c1\u76d8 […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[5],"tags":[],"_links":{"self":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/3091"}],"collection":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/comments?post=3091"}],"version-history":[{"count":7,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/3091\/revisions"}],"predecessor-version":[{"id":3255,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/3091\/revisions\/3255"}],"wp:attachment":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/media?parent=3091"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/categories?post=3091"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/tags?post=3091"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}