{"id":4528,"date":"2019-08-24T23:57:47","date_gmt":"2019-08-24T15:57:47","guid":{"rendered":"https:\/\/www.linuxcool.com\/?p=4528"},"modified":"2019-08-26T15:58:04","modified_gmt":"2019-08-26T07:58:04","slug":"sgdisk","status":"publish","type":"post","link":"https:\/\/www.linuxcool.com\/sgdisk","title":{"rendered":"sgdisk\u547d\u4ee4 – Linux\u548cUnix\u7684\u547d\u4ee4\u884cGPT\u64cd\u7eb5\u5668"},"content":{"rendered":"\n

sgdisk\u662fLinux\u4e0b\u64cd\u4f5cGPT\u5206\u533a\u7684\u5de5\u5177\uff0c sgdisk\u7a0b\u5e8f\u4f7f\u7528\u5b8c\u5168\u57fa\u4e8e\u547d\u4ee4\u884c\u7684\u7528\u6237\u754c\u9762\uff0c\u4f7f\u5176\u9002\u7528\u4e8e\u811a\u672c\u6216\u60f3\u8981\u5bf9\u78c1\u76d8\u8fdb\u884c\u4e00\u6b21\u6216\u4e24\u6b21\u5feb\u901f\u66f4\u6539\u7684\u4e13\u5bb6\u3002<\/p>\n\n\n\n

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

\u5e38\u7528\u53c2\u6570\uff1a<\/strong><\/p>\n\n\n\n
-p <\/td>\u6253\u5370\u5206\u533a\u8868<\/td><\/tr>
-d x<\/td>\u5220\u9664\u5206\u533a<\/td><\/tr>
-n x:y:z <\/td>\u521b\u5efa\u4e00\u4e2a\u7f16\u53f7 x \u7684\u65b0\u5206\u533a\uff0c\u4ece y\u6247\u533a \u5f00\u59cb\uff0c\u5230 z\u6247\u533a \u7ed3\u675f<\/td><\/tr>
-c x:y <\/td>\u66f4\u6539\u5206\u533a x \u7684\u540d\u79f0\u4e3a y<\/td><\/tr>
-t x:y <\/td>-t x:y \u5c06\u5206\u533a x \u7684\u7c7b\u578b\u66f4\u6539\u4e3a y<\/td><\/tr>
\u2013list-types <\/td>\u5217\u51fa\u5206\u533a\u7c7b\u578b\u4ee3\u7801<\/td><\/tr><\/tbody><\/table>\n\n\n\n

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

\u6253\u5370\u5206\u533a\u8868\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]#  sgdisk -p \/dev\/sda <\/pre>\n\n\n\n

\u5220\u9664sda\u7684\u7b2c\u4e00\u4e2a\u5206\u533a\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# sgdisk -d 1 \/dev\/sda <\/pre>\n\n\n\n

\u521b\u5efa\u4e00\u4e2a\u7f16\u53f7 1 \u7684\u65b0\u5206\u533a\uff0c\u4ece 1MiB \u5f00\u59cb\uff0c\u5230 2MiB \u7ed3\u675f\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# sgdisk -n 1:1MiB:2MiB \/dev\/sda<\/pre>\n\n\n\n

\u628a\u7f16\u53f7\u4e3a 1 \u7684\u5206\u533a\u540d\u79f0\u6539\u4e3a grub\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]#  sgdisk -c 1:grub \/dev\/sda <\/pre>\n\n\n\n

\u5c06\u7f16\u53f7\u4e3a 1 \u7684\u5206\u533a\uff0c\u7c7b\u578b\u66f4\u6539\u4e3a ef02\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# sgdisk -t 1:ef02 \/dev\/sda <\/pre>\n\n\n\n

\u5217\u51fa\u5206\u533a\u7c7b\u578b\u4ee3\u7801\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# sgdisk --list-types<\/pre>\n","protected":false},"excerpt":{"rendered":"

sgdisk\u662fLinux\u4e0b\u64cd\u4f5cGPT\u5206\u533a\u7684\u5de5\u5177\uff0c sgdisk\u7a0b\u5e8f\u4f7f\u7528\u5b8c\u5168\u57fa\u4e8e\u547d\u4ee4\u884c\u7684\u7528\u6237\u754c\u9762\uff0c\u4f7f\u5176\u9002\u7528\u4e8e\u811a\u672c […]<\/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\/4528"}],"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=4528"}],"version-history":[{"count":8,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/4528\/revisions"}],"predecessor-version":[{"id":4816,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/4528\/revisions\/4816"}],"wp:attachment":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/media?parent=4528"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/categories?post=4528"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/tags?post=4528"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}