{"id":18194,"date":"2024-11-18T16:05:37","date_gmt":"2024-11-18T08:05:37","guid":{"rendered":"https:\/\/fwq.ai\/blog\/18194\/"},"modified":"2024-11-18T16:05:37","modified_gmt":"2024-11-18T08:05:37","slug":"linux%e9%87%8c%e7%9a%84dd%e6%80%8e%e4%b9%88%e4%bd%bf%e7%94%a8","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/18194\/","title":{"rendered":"linux\u91cc\u7684dd\u600e\u4e48\u4f7f\u7528"},"content":{"rendered":"<blockquote><p>\n  dd \u547d\u4ee4\u7528\u4e8e\u5728 linux \u4e2d\u590d\u5236\u548c\u8f6c\u6362\u78c1\u76d8\u6570\u636e\u3002\u5176\u57fa\u672c\u7528\u6cd5\u662f\u9010\u4f4d\u590d\u5236\u6587\u4ef6\uff1add if=input_file of=output_file\u3002\u53ef\u7528\u9009\u9879\u5305\u62ec\u6307\u5b9a\u5757\u5927\u5c0f (-bs)\u3001\u5757\u6570 (-count)\u3001\u8df3\u8fc7\u5757 (-skip)\u3001\u5b9a\u4f4d\u5757 (-seek) \u548c\u6570\u636e\u8f6c\u6362 (-conv)\u3002dd \u8fd8\u53ef\u7528\u4e8e\u521b\u5efa\u78c1\u76d8\u6620\u50cf\u3001\u6062\u590d\u78c1\u76d8\u6620\u50cf\u548c\u62b9\u9664\u78c1\u76d8\u3002\u5728\u4f7f\u7528 dd \u65f6\u8981\u8c28\u614e\uff0c\u56e0\u4e3a\u9519\u8bef\u53ef\u80fd\u5bfc\u81f4\u6570\u636e\u4e22\u5931\u3002\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202406\/04\/2024060413092117271.jpg\" class=\"aligncenter\" title=\"linux\u91cc\u7684dd\u600e\u4e48\u4f7f\u7528\u63d2\u56fe\" alt=\"linux\u91cc\u7684dd\u600e\u4e48\u4f7f\u7528\u63d2\u56fe\" \/><\/p>\n<p><strong>Linux \u4e2d\u7684 dd \u547d\u4ee4<\/strong><\/p>\n<p>dd \u547d\u4ee4\u5728 Linux \u7cfb\u7edf\u4e2d\u662f\u4e00\u4e2a\u5f3a\u5927\u7684\u5de5\u5177\uff0c\u7528\u4e8e\u590d\u5236\u548c\u8f6c\u6362\u78c1\u76d8\u6570\u636e\u3002\u5176\u8bed\u6cd5\u5982\u4e0b\uff1a<\/p>\n<pre>dd if=input file of=output file [options]<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>\u57fa\u672c\u7528\u6cd5<\/strong><\/p>\n<p>\u8981\u590d\u5236\u4e00\u4e2a\u6587\u4ef6\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre>dd if=input_file of=output_file<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u8fd9\u5c06\u9010\u4f4d\u590d\u5236 input_file \u4e2d\u7684\u5185\u5bb9\u5230 output_file \u4e2d\u3002<\/p>\n<p><strong>\u9009\u9879<\/strong><\/p>\n<p>dd \u547d\u4ee4\u63d0\u4f9b\u4e86\u8bb8\u591a\u9009\u9879\u6765\u63a7\u5236\u590d\u5236\u8fc7\u7a0b\uff1a<\/p>\n<ul>\n<li> <strong>bs (block size)<\/strong>\uff1a\u6307\u5b9a\u6570\u636e\u5757\u7684\u5927\u5c0f\u3002\u9ed8\u8ba4\u4e3a 512 \u5b57\u8282\u3002<\/li>\n<li> <strong>count<\/strong>\uff1a\u6307\u5b9a\u8981\u590d\u5236\u7684\u6570\u636e\u5757\u6570\u3002\u9ed8\u8ba4\u4e3a\u5168\u90e8\u5757\u3002<\/li>\n<li> <strong>skip<\/strong>\uff1a\u6307\u5b9a\u5728\u8f93\u5165\u6587\u4ef6\u4e2d\u8df3\u8fc7\u7684\u5757\u6570\u3002<\/li>\n<li> <strong>seek<\/strong>\uff1a\u6307\u5b9a\u5728\u8f93\u51fa\u6587\u4ef6\u4e2d\u5b9a\u4f4d\u5230\u7684\u5757\u6570\u3002<\/li>\n<li> <strong>conv<\/strong>\uff1a\u6307\u5b9a\u6570\u636e\u8f6c\u6362\u3002\u4f8b\u5982\uff0cconv=ascii \u5c06\u4e8c\u8fdb\u5236\u6570\u636e\u8f6c\u6362\u4e3a ASCII \u6587\u672c\u3002<\/li>\n<\/ul>\n<p><strong>\u8fdb\u9636\u7528\u6cd5<\/strong><\/p>\n<p>dd \u8fd8\u53ef\u7528\u4e8e\u66f4\u9ad8\u7ea7\u7684\u64cd\u4f5c\uff0c\u4f8b\u5982\uff1a<\/p>\n<ul>\n<li> <strong>\u521b\u5efa\u78c1\u76d8\u6620\u50cf<\/strong>\uff1a<\/li>\n<\/ul>\n<pre>dd if=\/dev\/sda of=disk_image.img<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<ul>\n<li> <strong>\u6062\u590d\u78c1\u76d8\u6620\u50cf<\/strong>\uff1a<\/li>\n<\/ul>\n<pre>dd if=disk_image.img of=\/dev\/sda<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<ul>\n<li> <strong>\u62b9\u9664\u78c1\u76d8<\/strong>\uff1a<\/li>\n<\/ul>\n<pre>dd if=\/dev\/zero of=\/dev\/sda<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>\u6ce8\u610f\u4e8b\u9879<\/strong><\/p>\n<ul>\n<li>dd \u662f\u4e00\u79cd\u5f3a\u5927\u7684\u5de5\u5177\uff0c\u5728\u4f7f\u7528\u65f6\u8981\u683c\u5916\u5c0f\u5fc3\u3002<\/li>\n<li>\u786e\u4fdd\u8f93\u5165\u548c\u8f93\u51fa\u6587\u4ef6\u662f\u6b63\u786e\u7684\uff0c\u56e0\u4e3a\u9519\u8bef\u53ef\u80fd\u4f1a\u5bfc\u81f4\u3002<\/li>\n<li>\u5728\u4f7f\u7528 dd \u4e4b\u524d\uff0c\u8bf7\u786e\u4fdd\u5df2\u5907\u4efd\u91cd\u8981\u6570\u636e\u3002<\/li>\n<\/ul>\n<p>\u4ee5\u4e0a\u5c31\u662f\u91cc\u7684dd\u600e\u4e48\u4f7f\u7528\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>dd \u547d\u4ee4\u7528\u4e8e\u5728 linux \u4e2d\u590d\u5236\u548c\u8f6c\u6362\u78c1\u76d8\u6570\u636e\u3002\u5176\u57fa\u672c\u7528\u6cd5\u662f\u9010\u4f4d\u590d\u5236\u6587\u4ef6\uff1add if=input_file of=output_file\u3002\u53ef\u7528\u9009\u9879\u5305\u62ec\u6307\u5b9a\u5757\u5927\u5c0f (-bs)\u3001\u5757\u6570 (-count)\u3001\u8df3\u8fc7\u5757 (-skip)\u3001\u5b9a\u4f4d\u5757 (-seek) \u548c\u6570\u636e\u8f6c\u6362 (-conv)\u3002dd \u8fd8\u53ef\u7528\u4e8e\u521b\u5efa\u78c1\u76d8\u6620\u50cf\u3001\u6062\u590d\u78c1\u76d8\u6620\u50cf\u548c\u62b9\u9664\u78c1\u76d8\u3002\u5728\u4f7f\u7528 dd \u65f6\u8981\u8c28\u614e\uff0c\u56e0\u4e3a\u9519\u8bef\u53ef\u80fd\u5bfc\u81f4\u6570\u636e\u4e22\u5931\u3002 Linux \u4e2d\u7684 dd \u547d\u4ee4 dd \u547d\u4ee4\u5728 Linux \u7cfb\u7edf\u4e2d\u662f\u4e00\u4e2a\u5f3a\u5927\u7684\u5de5\u5177\uff0c\u7528\u4e8e\u590d\u5236\u548c\u8f6c\u6362\u78c1\u76d8\u6570\u636e\u3002\u5176\u8bed\u6cd5\u5982\u4e0b\uff1a dd if=input file of=output file [options] \u767b\u5f55\u540e\u590d\u5236 \u57fa\u672c\u7528\u6cd5 \u8981\u590d\u5236\u4e00\u4e2a\u6587\u4ef6\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a dd if=input_file of=output_file \u767b\u5f55\u540e\u590d\u5236 \u8fd9\u5c06\u9010\u4f4d\u590d\u5236 input_file \u4e2d\u7684\u5185\u5bb9\u5230 output_file \u4e2d\u3002 \u9009\u9879 dd \u547d\u4ee4\u63d0\u4f9b\u4e86\u8bb8\u591a\u9009\u9879\u6765\u63a7\u5236\u590d\u5236\u8fc7\u7a0b\uff1a bs (block size)\uff1a\u6307\u5b9a\u6570\u636e\u5757\u7684\u5927\u5c0f\u3002\u9ed8\u8ba4\u4e3a 512 \u5b57\u8282\u3002 count\uff1a\u6307\u5b9a\u8981\u590d\u5236\u7684\u6570\u636e\u5757\u6570\u3002\u9ed8\u8ba4\u4e3a\u5168\u90e8\u5757\u3002 skip\uff1a\u6307\u5b9a\u5728\u8f93\u5165\u6587\u4ef6\u4e2d\u8df3\u8fc7\u7684\u5757\u6570\u3002 seek\uff1a\u6307\u5b9a\u5728\u8f93\u51fa\u6587\u4ef6\u4e2d\u5b9a\u4f4d\u5230\u7684\u5757\u6570\u3002 conv\uff1a\u6307\u5b9a\u6570\u636e\u8f6c\u6362\u3002\u4f8b\u5982\uff0cconv=ascii \u5c06\u4e8c\u8fdb\u5236\u6570\u636e\u8f6c\u6362\u4e3a ASCII [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-18194","post","type-post","status-publish","format-standard","hentry","category-os"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/18194","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=18194"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/18194\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=18194"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=18194"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=18194"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}