{"id":5142,"date":"2019-10-13T19:08:25","date_gmt":"2019-10-13T11:08:25","guid":{"rendered":"https:\/\/www.linuxcool.com\/?p=5142"},"modified":"2020-05-06T09:18:48","modified_gmt":"2020-05-06T01:18:48","slug":"e2image","status":"publish","type":"post","link":"https:\/\/www.linuxcool.com\/e2image","title":{"rendered":"e2image\u547d\u4ee4 – \u4fdd\u5b58ext2\/ext3\u6587\u4ef6\u5143\u6570\u636e"},"content":{"rendered":"\n

e2image\u547d\u4ee4\u53ef\u4ee5\u5c06\u5904\u4e8e\u5371\u9669\u72b6\u6001\u7684\u201cext2\u201d\u6216\u8005\u201cext3\u201d\u6587\u4ef6\u7cfb\u7edf\u4fdd\u5b58\u5230\u6587\u4ef6\u4e2d\u3002\u751f\u6210\u7684\u6587\u4ef6\u53ef\u4ee5\u88abdumpe2fs\u547d\u4ee4\u548cdebugfs\u547d\u4ee4\u901a\u8fc7\u201c-i\u201d\u53c2\u6570\u4f7f\u7528\u3002\u6709\u7ecf\u9a8c\u7684\u7ba1\u7406\u5458\u53ef\u4ee5\u7528\u5b83\u6765\u505a\u6587\u4ef6\u7cfb\u7edf\u7684\u707e\u96be\u6062\u590d\u3002<\/p>\n\n\n\n

\u4e3a\u4e86\u8282\u7701\u78c1\u76d8\u7a7a\u95f4\uff0ce2Image\u5c06image\u6587\u4ef6\u521b\u5efa\u4e3a\u7a00\u758f\u6587\u4ef6\uff0c\u6216\u4ee5QCOW2\u683c\u5f0f\u521b\u5efa\u3002\u56e0\u6b64\uff0c\u5982\u679c\u9700\u8981\u5c06\u7a00\u758fimage\u6587\u4ef6\u590d\u5236\u5230\u53e6\u4e00\u4e2a\u4f4d\u7f6e\uff0c\u5219\u5e94\u8be5\u9996\u5148\u5bf9\u5176\u8fdb\u884c\u538b\u7f29\uff0c\u6216\u8005\u4f7f\u7528GNU\u7248\u672c\u7684cp \u201d sparse=always\u201d\u9009\u9879\u3002\u8fd9\u4e0d\u9002\u7528\u4e8eQCOW2\u6620\u50cf\uff0c\u5b83\u5e76\u4e0d\u7a00\u758f\u3002<\/p>\n\n\n\n

\u8bed\u6cd5\u683c\u5f0f\uff1a<\/strong>e2image [\u53c2\u6570] [\u6587\u4ef6\/\u6587\u4ef6\u7cfb\u7edf]<\/p>\n\n\n\n

\u5e38\u7528\u53c2\u6570\uff1a<\/strong><\/p>\n\n\n\n

-I<\/td>\u5c06\u6587\u4ef6\u4e2d\u7684\u5143\u6570\u636e\u6062\u590d\u5230\u5206\u533a<\/td><\/tr>
-r<\/td>\u521b\u5efaraw\u683c\u5f0f\u7684image<\/td><\/tr>
-Q<\/td>\u521b\u5efaQCOW2\u683c\u5f0f\u7684image<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n

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

\u751f\u6210\u5236\u5b9a\u5206\u533a\u5143\u6570\u636e\u6620\u50cf\u6587\u4ef6\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# e2image \/dev\/sda1 sda1\ne2image 1.44.3 (10-July-2018)<\/pre>\n\n\n\n

\u67e5\u770b\u6587\u4ef6\u7684\u7cfb\u7edf\u7c7b\u578b\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]#file sda1\nsda1\uff1aLinux rev 1.0 ext2 filesystem data<\/pre>\n\n\n\n

\u751f\u6210\u4e00\u4e2aQCOW2\u56fe\u50cf\u6587\u4ef6\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# e2image -Q \/dev\/hda1 hda1.qcow2 <\/pre>\n\n\n\n

\u751f\u6210\u4e00\u4e2a\u539f\u59cbimage\u6587\u4ef6\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# e2image -r \/dev\/hda1 | bzip2> hda1.e2i.bz2<\/pre>\n","protected":false},"excerpt":{"rendered":"

e2image\u547d\u4ee4\u53ef\u4ee5\u5c06\u5904\u4e8e\u5371\u9669\u72b6\u6001\u7684\u201cext2\u201d\u6216\u8005\u201cext3\u201d\u6587\u4ef6\u7cfb\u7edf\u4fdd\u5b58\u5230\u6587\u4ef6\u4e2d\u3002\u751f\u6210\u7684\u6587\u4ef6\u53ef\u4ee5\u88abdum […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/5142"}],"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=5142"}],"version-history":[{"count":7,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/5142\/revisions"}],"predecessor-version":[{"id":7514,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/5142\/revisions\/7514"}],"wp:attachment":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/media?parent=5142"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/categories?post=5142"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/tags?post=5142"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}