{"id":71195,"date":"2026-02-03T11:42:21","date_gmt":"2026-02-03T03:42:21","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/71195.html"},"modified":"2026-02-03T11:42:21","modified_gmt":"2026-02-03T03:42:21","slug":"%e3%80%90linux%e5%91%bd%e4%bb%a4%e5%a4%a7%e5%85%a8%e3%80%91008-%e7%a3%81%e7%9b%98%e7%bb%b4%e6%8a%a4%e4%b9%8bsfdisk%e5%91%bd%e4%bb%a4%ef%bc%88%e5%ae%9e%e6%93%8d%e7%af%87%ef%bc%89","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/71195.html","title":{"rendered":"\u3010Linux\u547d\u4ee4\u5927\u5168\u3011008.\u78c1\u76d8\u7ef4\u62a4\u4e4bsfdisk\u547d\u4ee4\uff08\u5b9e\u64cd\u7bc7\uff09"},"content":{"rendered":"<h2>\u3010Linux\u547d\u4ee4\u5927\u5168\u3011008.\u78c1\u76d8\u7ef4\u62a4\u4e4bsfdisk\u547d\u4ee4&#xff08;\u5b9e\u64cd\u7bc7&#xff09;<\/h2>\n<p>\u2728 \u672c\u6587\u4e3aLinux\u7cfb\u7edf\u78c1\u76d8\u7ef4\u62a4\u547d\u4ee4\u7684\u5168\u9762\u6c47\u603b\u4e0e\u6df1\u5ea6\u4f18\u5316&#xff0c;\u7ed3\u5408\u56fe\u6807\u3001\u7ed3\u6784\u5316\u6392\u7248\u4e0e\u5b9e\u7528\u6280\u5de7&#xff0c;\u4e13\u4e3a\u9ad8\u7ea7\u7528\u6237\u548c\u7cfb\u7edf\u7ba1\u7406\u5458\u6253\u9020\u3002<\/p>\n<p>(\u5173\u6ce8\u4e0d\u8ff7\u8def\u54c8&#xff01;&#xff01;&#xff01;)<\/p>\n<\/p>\n<h4>\u6587\u7ae0\u76ee\u5f55<\/h4>\n<ul>\n<li>\u3010Linux\u547d\u4ee4\u5927\u5168\u3011008.\u78c1\u76d8\u7ef4\u62a4\u4e4bsfdisk\u547d\u4ee4&#xff08;\u5b9e\u64cd\u7bc7&#xff09;<\/li>\n<li>\n<ul>\n<li>\u4e00\u3001\u529f\u80fd\u4e0e\u4f5c\u7528<\/li>\n<li>\u4e8c\u3001\u57fa\u672c\u7528\u6cd5<\/li>\n<li>\n<ul>\n<li>1. \u663e\u793a\u78c1\u76d8\u5206\u533a\u4fe1\u606f<\/li>\n<li>2. \u5907\u4efd\u5206\u533a\u8868<\/li>\n<li>3. \u6062\u590d\u5206\u533a\u8868<\/li>\n<li>4. \u663e\u793a\u5206\u533a\u5927\u5c0f<\/li>\n<li>5. \u66f4\u6539\u5206\u533a\u7c7b\u578b<\/li>\n<li>6. \u521b\u5efa\u65b0\u7684\u5206\u533a\u8868<\/li>\n<\/ul>\n<\/li>\n<li>\u4e09\u3001\u9ad8\u7ea7\u7528\u6cd5<\/li>\n<li>\n<ul>\n<li>1. \u4ece\u811a\u672c\u521b\u5efa\u5206\u533a<\/li>\n<li>2. \u4f7f\u7528JSON\u683c\u5f0f\u5b9a\u4e49\u5206\u533a<\/li>\n<li>3. \u590d\u5236\u5206\u533a\u8868\u5230\u53e6\u4e00\u4e2a\u78c1\u76d8<\/li>\n<li>4. \u521b\u5efaGPT\u5206\u533a\u8868<\/li>\n<li>5. \u5728\u81ea\u52a8\u5316\u811a\u672c\u4e2d\u4f7f\u7528sfdisk<\/li>\n<li>6. \u4f7f\u7528sfdisk\u8fdb\u884c\u9ad8\u7ea7\u5206\u533a\u64cd\u4f5c<\/li>\n<\/ul>\n<\/li>\n<li>\u56db\u3001\u5b9e\u7528\u6280\u5de7\u4e0e\u5e38\u89c1\u95ee\u9898<\/li>\n<li>\n<ul>\n<li>\u5b9e\u7528\u6280\u5de7<\/li>\n<li>\u5e38\u89c1\u95ee\u9898<\/li>\n<\/ul>\n<\/li>\n<li>\u4e94\u3001\u603b\u7ed3<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<hr \/>\n<h3>\u4e00\u3001\u529f\u80fd\u4e0e\u4f5c\u7528<\/h3>\n<p>sfdisk\u547d\u4ee4\u662fLinux\u7cfb\u7edf\u4e2d\u4e00\u4e2a\u5f3a\u5927\u7684\u78c1\u76d8\u5206\u533a\u5de5\u5177&#xff0c;\u4e3b\u8981\u7528\u4e8e\u521b\u5efa\u3001\u4fee\u6539\u548c\u663e\u793a\u5206\u533a\u8868\u3002\u4e0e\u4f20\u7edf\u7684\u4ea4\u4e92\u5f0f\u5206\u533a\u5de5\u5177&#xff08;\u5982fdisk&#xff09;\u4e0d\u540c&#xff0c;sfdisk\u662f\u4e00\u4e2a\u975e\u4ea4\u4e92\u5f0f\u547d\u4ee4\u884c\u5de5\u5177&#xff0c;\u7279\u522b\u9002\u5408\u5728\u811a\u672c\u4e2d\u4f7f\u7528\u6216\u8fdb\u884c\u81ea\u52a8\u5316\u5206\u533a\u64cd\u4f5c\u3002\u5b83\u652f\u6301\u591a\u79cd\u5206\u533a\u8868\u683c\u5f0f&#xff0c;\u5305\u62ec\u4f20\u7edf\u7684MBR&#xff08;Master Boot Record&#xff09;\u548c\u8f83\u65b0\u7684GPT&#xff08;GUID Partition Table&#xff09;\u3002<\/p>\n<p>sfdisk\u547d\u4ee4\u5728\u7cfb\u7edf\u5b89\u88c5\u3001\u78c1\u76d8\u7ba1\u7406\u548c\u81ea\u52a8\u5316\u90e8\u7f72\u4e2d\u5177\u6709\u4ee5\u4e0b\u91cd\u8981\u4f5c\u7528&#xff1a;<\/p>\n<ul>\n<li>\u521b\u5efa\u548c\u7ba1\u7406\u78c1\u76d8\u5206\u533a\u8868<\/li>\n<li>\u5907\u4efd\u548c\u6062\u590d\u5206\u533a\u8868<\/li>\n<li>\u5728\u811a\u672c\u4e2d\u8fdb\u884c\u81ea\u52a8\u5316\u5206\u533a\u64cd\u4f5c<\/li>\n<li>\u590d\u5236\u5206\u533a\u8868\u4ece\u4e00\u4e2a\u78c1\u76d8\u5230\u53e6\u4e00\u4e2a\u78c1\u76d8<\/li>\n<li>\u652f\u6301\u591a\u79cd\u5206\u533a\u8868\u683c\u5f0f&#xff0c;\u5305\u62ecMBR\u548cGPT<\/li>\n<\/ul>\n<p>\u53c2\u6570\u8be6\u89e3<\/p>\n<table>\n<tr>\u53c2\u6570\u8bf4\u660e<\/tr>\n<tbody>\n<tr>\n<td>-d<\/td>\n<td>\u663e\u793a\u5206\u533a\u8868\u8be6\u60c5<\/td>\n<\/tr>\n<tr>\n<td>-l<\/td>\n<td>\u5217\u51fa\u6240\u6709\u78c1\u76d8\u7684\u5206\u533a\u4fe1\u606f<\/td>\n<\/tr>\n<tr>\n<td>-s<\/td>\n<td>\u663e\u793a\u5206\u533a\u5927\u5c0f<\/td>\n<\/tr>\n<tr>\n<td>-c<\/td>\n<td>\u66f4\u6539\u5206\u533a\u7c7b\u578b<\/td>\n<\/tr>\n<tr>\n<td>-f<\/td>\n<td>\u5f3a\u5236\u64cd\u4f5c<\/td>\n<\/tr>\n<tr>\n<td>-n<\/td>\n<td>\u4e0d\u6267\u884c\u64cd\u4f5c&#xff0c;\u53ea\u663e\u793a\u7ed3\u679c<\/td>\n<\/tr>\n<tr>\n<td>-u<\/td>\n<td>\u8bbe\u7f6e\u5355\u4f4d<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>\u4e8c\u3001\u57fa\u672c\u7528\u6cd5<\/h3>\n<h4>1. \u663e\u793a\u78c1\u76d8\u5206\u533a\u4fe1\u606f<\/h4>\n<p>\u4f7f\u7528sfdisk\u547d\u4ee4\u67e5\u770b\u6307\u5b9a\u78c1\u76d8\u7684\u5206\u533a\u8868\u4fe1\u606f&#xff1a;<\/p>\n<p><span class=\"token comment\"># \u663e\u793a\/dev\/sdb\u7684\u5206\u533a\u8868\u4fe1\u606f<\/span><br \/>\n<span class=\"token function\">sudo<\/span> sfdisk -l \/dev\/sdb<\/p>\n<p><span class=\"token comment\"># \u8f93\u51fa\u793a\u4f8b&#xff1a;<\/span><br \/>\n<span class=\"token comment\"># Disk \/dev\/sdb: 465.8 GiB, 500107862016 bytes, 976773168 sectors<\/span><br \/>\n<span class=\"token comment\"># Units: sectors of 1 * 512 &#061; 512 bytes<\/span><br \/>\n<span class=\"token comment\"># Sector size (logical\/physical): 512 bytes \/ 4096 bytes<\/span><br \/>\n<span class=\"token comment\"># I\/O size (minimum\/optimal): 4096 bytes \/ 4096 bytes<\/span><br \/>\n<span class=\"token comment\"># Disklabel type: dos<\/span><br \/>\n<span class=\"token comment\"># Disk identifier: 0x12345678<\/span><br \/>\n<span class=\"token comment\"># <\/span><br \/>\n<span class=\"token comment\"># Device     Boot     Start       End   Sectors   Size Id Type<\/span><br \/>\n<span class=\"token comment\"># \/dev\/sdb1            2048  41943039  41940992    20G 83 Linux<\/span><br \/>\n<span class=\"token comment\"># \/dev\/sdb2        41943040  83886079  41943040    20G 83 Linux<\/span><br \/>\n<span class=\"token comment\"># \/dev\/sdb3        83886080 125829119  41943040    20G 83 Linux<\/span><\/p>\n<h4>2. \u5907\u4efd\u5206\u533a\u8868<\/h4>\n<p>\u4f7f\u7528sfdisk\u547d\u4ee4\u5907\u4efd\u78c1\u76d8\u7684\u5206\u533a\u8868\u5230\u6587\u4ef6&#xff1a;<\/p>\n<p><span class=\"token comment\"># \u5907\u4efd\/dev\/sdb\u7684\u5206\u533a\u8868\u5230\u6587\u4ef6<\/span><br \/>\n<span class=\"token function\">sudo<\/span> sfdisk -d \/dev\/sdb <span class=\"token operator\">&gt;<\/span> \/backup\/sdb_partition_table.bak<\/p>\n<p><span class=\"token comment\"># \u67e5\u770b\u5907\u4efd\u6587\u4ef6\u5185\u5bb9<\/span><br \/>\n<span class=\"token function\">cat<\/span> \/backup\/sdb_partition_table.bak<\/p>\n<p><span class=\"token comment\"># \u8f93\u51fa\u793a\u4f8b&#xff1a;<\/span><br \/>\n<span class=\"token comment\"># # partition table of \/dev\/sdb<\/span><br \/>\n<span class=\"token comment\"># unit: sectors<\/span><br \/>\n<span class=\"token comment\"># <\/span><br \/>\n<span class=\"token comment\"># \/dev\/sdb1 : start&#061;     2048, size&#061; 41940992, type&#061;83<\/span><br \/>\n<span class=\"token comment\"># \/dev\/sdb2 : start&#061; 41943040, size&#061; 41943040, type&#061;83<\/span><br \/>\n<span class=\"token comment\"># \/dev\/sdb3 : start&#061; 83886080, size&#061; 41943040, type&#061;83<\/span><\/p>\n<h4>3. \u6062\u590d\u5206\u533a\u8868<\/h4>\n<p>\u4f7f\u7528\u4e4b\u524d\u5907\u4efd\u7684\u5206\u533a\u8868\u6587\u4ef6\u6062\u590d\u78c1\u76d8\u5206\u533a\u8868&#xff1a;<\/p>\n<p><span class=\"token comment\"># \u4ece\u5907\u4efd\u6587\u4ef6\u6062\u590d\/dev\/sdb\u7684\u5206\u533a\u8868<\/span><br \/>\n<span class=\"token function\">sudo<\/span> sfdisk \/dev\/sdb <span class=\"token operator\">&lt;<\/span> \/backup\/sdb_partition_table.bak<\/p>\n<p><span class=\"token comment\"># \u8f93\u51fa\u793a\u4f8b&#xff1a;<\/span><br \/>\n<span class=\"token comment\"># Checking that no-one is using this disk right now &#8230; OK<\/span><br \/>\n<span class=\"token comment\"># <\/span><br \/>\n<span class=\"token comment\"># Disk \/dev\/sdb: 465.8 GiB, 500107862016 bytes, 976773168 sectors<\/span><br \/>\n<span class=\"token comment\"># Units: sectors of 1 * 512 &#061; 512 bytes<\/span><br \/>\n<span class=\"token comment\"># Sector size (logical\/physical): 512 bytes \/ 4096 bytes<\/span><br \/>\n<span class=\"token comment\"># I\/O size (minimum\/optimal): 4096 bytes \/ 4096 bytes<\/span><br \/>\n<span class=\"token comment\"># Disklabel type: dos<\/span><br \/>\n<span class=\"token comment\"># Disk identifier: 0x12345678<\/span><br \/>\n<span class=\"token comment\"># <\/span><br \/>\n<span class=\"token comment\"># Old situation:<\/span><br \/>\n<span class=\"token comment\"># <\/span><br \/>\n<span class=\"token comment\"># Device     Boot     Start       End   Sectors   Size Id Type<\/span><br \/>\n<span class=\"token comment\"># \/dev\/sdb1            2048  41943039  41940992    20G 83 Linux<\/span><br \/>\n<span class=\"token comment\"># \/dev\/sdb2        41943040  83886079  41943040    20G 83 Linux<\/span><br \/>\n<span class=\"token comment\"># \/dev\/sdb3        83886080 125829119  41943040    20G 83 Linux<\/span><br \/>\n<span class=\"token comment\"># <\/span><br \/>\n<span class=\"token comment\"># New situation:<\/span><br \/>\n<span class=\"token comment\"># <\/span><br \/>\n<span class=\"token comment\"># Device     Boot     Start       End   Sectors   Size Id Type<\/span><br \/>\n<span class=\"token comment\"># \/dev\/sdb1            2048  41943039  41940992    20G 83 Linux<\/span><br \/>\n<span class=\"token comment\"># \/dev\/sdb2        41943040  83886079  41943040    20G 83 Linux<\/span><br \/>\n<span class=\"token comment\"># \/dev\/sdb3        83886080 125829119  41943040    20G 83 Linux<\/span><br \/>\n<span class=\"token comment\"># <\/span><br \/>\n<span class=\"token comment\"># The partition table has been altered.<\/span><br \/>\n<span class=\"token comment\"># Calling ioctl() to re-read partition table.<\/span><br \/>\n<span class=\"token comment\"># Syncing disks.<\/span><\/p>\n<h4>4. \u663e\u793a\u5206\u533a\u5927\u5c0f<\/h4>\n<p>\u4f7f\u7528sfdisk\u547d\u4ee4\u663e\u793a\u7279\u5b9a\u5206\u533a\u7684\u5927\u5c0f&#xff1a;<\/p>\n<p><span class=\"token comment\"># \u663e\u793a\u5206\u533a\u5927\u5c0f&#xff08;\u4ee5\u5757\u4e3a\u5355\u4f4d&#xff09;<\/span><br \/>\n<span class=\"token function\">sudo<\/span> sfdisk -s \/dev\/sdb1<\/p>\n<p><span class=\"token comment\"># \u8f93\u51fa\u793a\u4f8b&#xff1a;<\/span><br \/>\n<span class=\"token comment\"># 41940992<\/span><\/p>\n<p><span class=\"token comment\"># \u663e\u793a\u6240\u6709\u5206\u533a\u7684\u5927\u5c0f<\/span><br \/>\n<span class=\"token function\">sudo<\/span> sfdisk -s<\/p>\n<h4>5. \u66f4\u6539\u5206\u533a\u7c7b\u578b<\/h4>\n<p>\u4f7f\u7528sfdisk\u547d\u4ee4\u66f4\u6539\u73b0\u6709\u5206\u533a\u7684\u7c7b\u578b&#xff1a;<\/p>\n<p><span class=\"token comment\"># \u5c06\/dev\/sdb3\u7684\u5206\u533a\u7c7b\u578b\u66f4\u6539\u4e3aLinux\u4ea4\u6362\u5206\u533a&#xff08;\u7c7b\u578b82&#xff09;<\/span><br \/>\n<span class=\"token function\">sudo<\/span> sfdisk -c \/dev\/sdb <span class=\"token number\">3<\/span> <span class=\"token number\">82<\/span><\/p>\n<p><span class=\"token comment\"># \u9a8c\u8bc1\u66f4\u6539\u662f\u5426\u751f\u6548<\/span><br \/>\n<span class=\"token function\">sudo<\/span> sfdisk -l \/dev\/sdb<\/p>\n<h4>6. \u521b\u5efa\u65b0\u7684\u5206\u533a\u8868<\/h4>\n<p>\u4f7f\u7528sfdisk\u547d\u4ee4\u521b\u5efa\u65b0\u7684\u5206\u533a\u8868&#xff1a;<\/p>\n<p><span class=\"token comment\"># \u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u7a7a\u5206\u533a\u8868&#xff08;\u8b66\u544a&#xff1a;\u8fd9\u4f1a\u5220\u9664\u6240\u6709\u73b0\u6709\u5206\u533a&#xff01;&#xff09;<\/span><br \/>\n<span class=\"token function\">sudo<\/span> sfdisk &#8211;wipe<span class=\"token operator\">&#061;<\/span>always \/dev\/sdb<\/p>\n<h3>\u4e09\u3001\u9ad8\u7ea7\u7528\u6cd5<\/h3>\n<h4>1. \u4ece\u811a\u672c\u521b\u5efa\u5206\u533a<\/h4>\n<p>sfdisk\u6700\u5f3a\u5927\u7684\u529f\u80fd\u4e4b\u4e00\u662f\u53ef\u4ee5\u4ece\u811a\u672c\u6216\u6587\u672c\u6587\u4ef6\u4e2d\u521b\u5efa\u5206\u533a\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u4f8b\u5b50&#xff1a;<\/p>\n<p><span class=\"token comment\"># \u521b\u5efa\u4e00\u4e2a\u5b9a\u4e49\u5206\u533a\u7684\u6587\u672c\u6587\u4ef6<\/span><br \/>\n<span class=\"token function\">cat<\/span> <span class=\"token operator\">&gt;<\/span> \/tmp\/partitions.txt <span class=\"token operator\">&lt;&lt;<\/span> <span class=\"token string\">EOF<br \/>\n# partition table of \/dev\/sdb<br \/>\nunit: sectors<\/p>\n<p>\/dev\/sdb1 : start&#061;     2048, size&#061; 41940992, type&#061;83<br \/>\n\/dev\/sdb2 : start&#061; 41943040, size&#061; 83886080, type&#061;83<br \/>\n\/dev\/sdb3 : start&#061;125829120, size&#061; 41943040, type&#061;82<br \/>\nEOF<\/span><\/p>\n<p><span class=\"token comment\"># \u5e94\u7528\u5206\u533a\u8868<\/span><br \/>\n<span class=\"token function\">sudo<\/span> sfdisk \/dev\/sdb <span class=\"token operator\">&lt;<\/span> \/tmp\/partitions.txt<\/p>\n<p>\u8fd9\u4e2a\u4f8b\u5b50\u521b\u5efa\u4e86\u4e09\u4e2a\u5206\u533a&#xff1a;\u4e00\u4e2a20GB\u7684Linux\u5206\u533a&#xff0c;\u4e00\u4e2a40GB\u7684Linux\u5206\u533a&#xff0c;\u548c\u4e00\u4e2a20GB\u7684\u4ea4\u6362\u5206\u533a\u3002<\/p>\n<h4>2. \u4f7f\u7528JSON\u683c\u5f0f\u5b9a\u4e49\u5206\u533a<\/h4>\n<p>\u5728\u8f83\u65b0\u7248\u672c\u7684sfdisk\u4e2d&#xff0c;\u652f\u6301\u4f7f\u7528JSON\u683c\u5f0f\u5b9a\u4e49\u5206\u533a&#xff1a;<\/p>\n<p><span class=\"token comment\"># \u521b\u5efa\u4e00\u4e2aJSON\u683c\u5f0f\u7684\u5206\u533a\u5b9a\u4e49\u6587\u4ef6<\/span><br \/>\n<span class=\"token function\">cat<\/span> <span class=\"token operator\">&gt;<\/span> \/tmp\/partitions.json <span class=\"token operator\">&lt;&lt;<\/span> <span class=\"token string\">EOF<br \/>\n{<br \/>\n  &#034;partitiontable&#034;: {<br \/>\n    &#034;label&#034;: &#034;dos&#034;,<br \/>\n    &#034;id&#034;: &#034;0x12345678&#034;,<br \/>\n    &#034;device&#034;: &#034;\/dev\/sdb&#034;,<br \/>\n    &#034;unit&#034;: &#034;sectors&#034;,<br \/>\n    &#034;partitions&#034;: [<br \/>\n      {<br \/>\n        &#034;start&#034;: 2048,<br \/>\n        &#034;size&#034;: 41940992,<br \/>\n        &#034;type&#034;: &#034;83&#034;,<br \/>\n        &#034;bootable&#034;: true<br \/>\n      },<br \/>\n      {<br \/>\n        &#034;start&#034;: 41943040,<br \/>\n        &#034;size&#034;: 83886080,<br \/>\n        &#034;type&#034;: &#034;83&#034;<br \/>\n      },<br \/>\n      {<br \/>\n        &#034;start&#034;: 125829120,<br \/>\n        &#034;size&#034;: 41943040,<br \/>\n        &#034;type&#034;: &#034;82&#034;<br \/>\n      }<br \/>\n    ]<br \/>\n  }<br \/>\n}<br \/>\nEOF<\/span><\/p>\n<p><span class=\"token comment\"># \u5e94\u7528JSON\u683c\u5f0f\u7684\u5206\u533a\u8868<\/span><br \/>\n<span class=\"token function\">sudo<\/span> sfdisk &#8211;json \/dev\/sdb <span class=\"token operator\">&lt;<\/span> \/tmp\/partitions.json<\/p>\n<h4>3. \u590d\u5236\u5206\u533a\u8868\u5230\u53e6\u4e00\u4e2a\u78c1\u76d8<\/h4>\n<p>\u53ef\u4ee5\u4f7f\u7528sfdisk\u547d\u4ee4\u5c06\u4e00\u4e2a\u78c1\u76d8\u7684\u5206\u533a\u8868\u590d\u5236\u5230\u53e6\u4e00\u4e2a\u78c1\u76d8&#xff1a;<\/p>\n<p><span class=\"token comment\"># \u5c06\/dev\/sdb\u7684\u5206\u533a\u8868\u590d\u5236\u5230\/dev\/sdc&#xff08;\u8b66\u544a&#xff1a;\u8fd9\u4f1a\u8986\u76d6\/dev\/sdc\u4e0a\u7684\u6240\u6709\u6570\u636e&#xff01;&#xff09;<\/span><br \/>\n<span class=\"token function\">sudo<\/span> sfdisk -d \/dev\/sdb <span class=\"token operator\">|<\/span> <span class=\"token function\">sudo<\/span> sfdisk \/dev\/sdc<\/p>\n<p><span class=\"token comment\"># \u9a8c\u8bc1\u590d\u5236\u662f\u5426\u6210\u529f<\/span><br \/>\n<span class=\"token function\">sudo<\/span> sfdisk -l \/dev\/sdc<\/p>\n<h4>4. \u521b\u5efaGPT\u5206\u533a\u8868<\/h4>\n<p>sfdisk\u547d\u4ee4\u4e5f\u652f\u6301\u521b\u5efa\u548c\u7ba1\u7406GPT\u5206\u533a\u8868&#xff1a;<\/p>\n<p><span class=\"token comment\"># \u521b\u5efaGPT\u5206\u533a\u8868<\/span><br \/>\n<span class=\"token function\">sudo<\/span> sfdisk &#8211;label<span class=\"token operator\">&#061;<\/span>gpt \/dev\/sdb<\/p>\n<p><span class=\"token comment\"># \u521b\u5efa\u4e00\u4e2aGPT\u5206\u533a\u5b9a\u4e49\u6587\u4ef6<\/span><br \/>\n<span class=\"token function\">cat<\/span> <span class=\"token operator\">&gt;<\/span> \/tmp\/gpt_partitions.txt <span class=\"token operator\">&lt;&lt;<\/span> <span class=\"token string\">EOF<br \/>\n# partition table of \/dev\/sdb<br \/>\nunit: sectors<\/p>\n<p>\/dev\/sdb1 : start&#061;     2048, size&#061; 41940992, type&#061;8300<br \/>\n\/dev\/sdb2 : start&#061; 41943040, size&#061; 83886080, type&#061;8300<br \/>\n\/dev\/sdb3 : start&#061;125829120, size&#061; 41943040, type&#061;8200<br \/>\nEOF<\/span><\/p>\n<p><span class=\"token comment\"># \u5e94\u7528GPT\u5206\u533a\u8868<\/span><br \/>\n<span class=\"token function\">sudo<\/span> sfdisk \/dev\/sdb <span class=\"token operator\">&lt;<\/span> \/tmp\/gpt_partitions.txt<\/p>\n<p><span class=\"token comment\"># \u9a8c\u8bc1GPT\u5206\u533a\u8868<\/span><br \/>\n<span class=\"token function\">sudo<\/span> sfdisk -l \/dev\/sdb<\/p>\n<p>\u5bf9\u4e8eGPT\u5206\u533a\u8868&#xff0c;\u5206\u533a\u7c7b\u578b\u4ee3\u7801\u7565\u6709\u4e0d\u540c&#xff1a;Linux\u5206\u533a\u4f7f\u75288300&#xff0c;\u4ea4\u6362\u5206\u533a\u4f7f\u75288200\u3002<\/p>\n<h4>5. \u5728\u81ea\u52a8\u5316\u811a\u672c\u4e2d\u4f7f\u7528sfdisk<\/h4>\n<p>\u4ee5\u4e0b\u662f\u4e00\u4e2a\u66f4\u5b8c\u6574\u7684\u793a\u4f8b&#xff0c;\u5c55\u793a\u5982\u4f55\u5728\u81ea\u52a8\u5316\u90e8\u7f72\u811a\u672c\u4e2d\u4f7f\u7528sfdisk&#xff1a;<\/p>\n<p><span class=\"token shebang important\">#!\/bin\/bash<\/span><\/p>\n<p><span class=\"token comment\"># \u81ea\u52a8\u5206\u533a\u811a\u672c<\/span><br \/>\n<span class=\"token assign-left variable\">DISK_DEVICE<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;\/dev\/sdb&#034;<\/span><br \/>\n<span class=\"token assign-left variable\">ROOT_PARTITION_SIZE<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;20G&#034;<\/span><br \/>\n<span class=\"token assign-left variable\">HOME_PARTITION_SIZE<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;40G&#034;<\/span><br \/>\n<span class=\"token assign-left variable\">SWAP_PARTITION_SIZE<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;8G&#034;<\/span><br \/>\n<span class=\"token assign-left variable\">LOG_FILE<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;\/var\/log\/autopartition.log&#034;<\/span><\/p>\n<p><span class=\"token comment\"># \u8bb0\u5f55\u65e5\u5fd7\u51fd\u6570<\/span><br \/>\n<span class=\"token function-name function\">log<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token builtin class-name\">echo<\/span> <span class=\"token string\">&#034;[<span class=\"token variable\"><span class=\"token variable\">$(<\/span><span class=\"token function\">date<\/span><span class=\"token variable\">)<\/span><\/span>] <span class=\"token variable\">$1<\/span>&#034;<\/span> <span class=\"token operator\">&gt;&gt;<\/span> <span class=\"token variable\">$LOG_FILE<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p><span class=\"token comment\"># \u68c0\u67e5\u662f\u5426\u4ee5root\u6743\u9650\u8fd0\u884c<\/span><br \/>\n<span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">[<\/span> <span class=\"token string\">&#034;<span class=\"token variable\"><span class=\"token variable\">$(<\/span><span class=\"token function\">id<\/span> -u<span class=\"token variable\">)<\/span><\/span>&#034;<\/span> <span class=\"token operator\">!&#061;<\/span> <span class=\"token string\">&#034;0&#034;<\/span> <span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">;<\/span> <span class=\"token keyword\">then<\/span><br \/>\n    <span class=\"token builtin class-name\">echo<\/span> <span class=\"token string\">&#034;\u9519\u8bef&#xff1a;\u8bf7\u4ee5root\u6743\u9650\u8fd0\u884c\u6b64\u811a\u672c&#xff01;&#034;<\/span><br \/>\n    <span class=\"token builtin class-name\">exit<\/span> <span class=\"token number\">1<\/span><br \/>\n<span class=\"token keyword\">fi<\/span><\/p>\n<p>log <span class=\"token string\">&#034;\u5f00\u59cb\u81ea\u52a8\u5206\u533a\u64cd\u4f5c&#xff1a;<span class=\"token variable\">$DISK_DEVICE<\/span>&#034;<\/span><\/p>\n<p><span class=\"token comment\"># \u68c0\u67e5\u78c1\u76d8\u662f\u5426\u5b58\u5728<\/span><br \/>\n<span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">[<\/span> <span class=\"token operator\">!<\/span> -b <span class=\"token string\">&#034;<span class=\"token variable\">$DISK_DEVICE<\/span>&#034;<\/span> <span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">;<\/span> <span class=\"token keyword\">then<\/span><br \/>\n    log <span class=\"token string\">&#034;\u9519\u8bef&#xff1a;\u78c1\u76d8\u8bbe\u5907 <span class=\"token variable\">$DISK_DEVICE<\/span> \u4e0d\u5b58\u5728&#xff01;&#034;<\/span><br \/>\n    <span class=\"token builtin class-name\">exit<\/span> <span class=\"token number\">1<\/span><br \/>\n<span class=\"token keyword\">fi<\/span><\/p>\n<p><span class=\"token comment\"># \u5378\u8f7d\u78c1\u76d8\u4e0a\u7684\u6240\u6709\u6302\u8f7d\u70b9<\/span><br \/>\nlog <span class=\"token string\">&#034;\u6b63\u5728\u5378\u8f7d\u78c1\u76d8\u4e0a\u7684\u6240\u6709\u6302\u8f7d\u70b9&#8230;&#034;<\/span><br \/>\n<span class=\"token keyword\">for<\/span> <span class=\"token for-or-select variable\">mount_point<\/span> <span class=\"token keyword\">in<\/span> <span class=\"token variable\"><span class=\"token variable\">$(<\/span><span class=\"token function\">mount<\/span> <span class=\"token operator\">|<\/span> <span class=\"token function\">grep<\/span> <span class=\"token string\">&#034;<span class=\"token variable\">$DISK_DEVICE<\/span>&#034;<\/span> <span class=\"token operator\">|<\/span> <span class=\"token function\">awk<\/span> <span class=\"token string\">&#039;{print $3}&#039;<\/span><span class=\"token variable\">)<\/span><\/span><span class=\"token punctuation\">;<\/span> <span class=\"token keyword\">do<\/span><br \/>\n    <span class=\"token function\">umount<\/span> <span class=\"token string\">&#034;<span class=\"token variable\">$mount_point<\/span>&#034;<\/span><br \/>\n    log <span class=\"token string\">&#034;\u5df2\u5378\u8f7d&#xff1a;<span class=\"token variable\">$mount_point<\/span>&#034;<\/span><br \/>\n<span class=\"token keyword\">done<\/span><\/p>\n<p><span class=\"token comment\"># \u5907\u4efd\u5f53\u524d\u5206\u533a\u8868&#xff08;\u5982\u679c\u6709&#xff09;<\/span><br \/>\n<span class=\"token assign-left variable\">BACKUP_FILE<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;\/backup\/<span class=\"token variable\">${DISK_DEVICE<span class=\"token operator\">##<\/span>*<span class=\"token operator\">\/<\/span>}<\/span>_partition_table_<span class=\"token variable\"><span class=\"token variable\">$(<\/span><span class=\"token function\">date<\/span> &#043;%Y%m%d%H%M%S<span class=\"token variable\">)<\/span><\/span>.bak&#034;<\/span><br \/>\nlog <span class=\"token string\">&#034;\u6b63\u5728\u5907\u4efd\u5f53\u524d\u5206\u533a\u8868\u5230 <span class=\"token variable\">$BACKUP_FILE<\/span>&#8230;&#034;<\/span><br \/>\n<span class=\"token function\">mkdir<\/span> -p \/backup<br \/>\nsfdisk -d <span class=\"token string\">&#034;<span class=\"token variable\">$DISK_DEVICE<\/span>&#034;<\/span> <span class=\"token operator\">&gt;<\/span> <span class=\"token string\">&#034;<span class=\"token variable\">$BACKUP_FILE<\/span>&#034;<\/span><\/p>\n<p><span class=\"token comment\"># \u521b\u5efa\u5206\u533a\u5b9a\u4e49\u6587\u4ef6<\/span><br \/>\n<span class=\"token assign-left variable\">PARTITION_FILE<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;\/tmp\/<span class=\"token variable\">${DISK_DEVICE<span class=\"token operator\">##<\/span>*<span class=\"token operator\">\/<\/span>}<\/span>_partitions.txt&#034;<\/span><br \/>\nlog <span class=\"token string\">&#034;\u6b63\u5728\u521b\u5efa\u5206\u533a\u5b9a\u4e49\u6587\u4ef6&#xff1a;<span class=\"token variable\">$PARTITION_FILE<\/span>&#034;<\/span><\/p>\n<p><span class=\"token comment\"># \u8f6c\u6362\u5206\u533a\u5927\u5c0f\u4e3a\u6247\u533a\u6570<\/span><br \/>\n<span class=\"token assign-left variable\">SECTOR_SIZE<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token number\">512<\/span>  <span class=\"token comment\"># \u5047\u8bbe\u6247\u533a\u5927\u5c0f\u4e3a512\u5b57\u8282<\/span><\/p>\n<p><span class=\"token comment\"># \u8ba1\u7b97\u5404\u5206\u533a\u7684\u6247\u533a\u6570<\/span><br \/>\n<span class=\"token assign-left variable\">ROOT_SECTORS<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token variable\"><span class=\"token variable\">$((<\/span> $<span class=\"token punctuation\">(<\/span>numfmt <span class=\"token operator\">&#8212;<\/span>from<span class=\"token operator\">&#061;<\/span>iec &#034;$ROOT_PARTITION_SIZE&#034;<span class=\"token punctuation\">)<\/span> <span class=\"token operator\">\/<\/span> $SECTOR_SIZE <span class=\"token variable\">))<\/span><\/span><br \/>\n<span class=\"token assign-left variable\">HOME_SECTORS<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token variable\"><span class=\"token variable\">$((<\/span> $<span class=\"token punctuation\">(<\/span>numfmt <span class=\"token operator\">&#8212;<\/span>from<span class=\"token operator\">&#061;<\/span>iec &#034;$HOME_PARTITION_SIZE&#034;<span class=\"token punctuation\">)<\/span> <span class=\"token operator\">\/<\/span> $SECTOR_SIZE <span class=\"token variable\">))<\/span><\/span><br \/>\n<span class=\"token assign-left variable\">SWAP_SECTORS<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token variable\"><span class=\"token variable\">$((<\/span> $<span class=\"token punctuation\">(<\/span>numfmt <span class=\"token operator\">&#8212;<\/span>from<span class=\"token operator\">&#061;<\/span>iec &#034;$SWAP_PARTITION_SIZE&#034;<span class=\"token punctuation\">)<\/span> <span class=\"token operator\">\/<\/span> $SECTOR_SIZE <span class=\"token variable\">))<\/span><\/span><\/p>\n<p><span class=\"token comment\"># \u8ba1\u7b97\u5206\u533a\u8d77\u59cb\u4f4d\u7f6e<\/span><br \/>\n<span class=\"token assign-left variable\">ROOT_START<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token number\">2048<\/span>  <span class=\"token comment\"># \u9ed8\u8ba4\u4ece2048\u6247\u533a\u5f00\u59cb<\/span><br \/>\n<span class=\"token assign-left variable\">HOME_START<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token variable\"><span class=\"token variable\">$((<\/span>ROOT_START <span class=\"token operator\">&#043;<\/span> ROOT_SECTORS<span class=\"token variable\">))<\/span><\/span><br \/>\n<span class=\"token assign-left variable\">SWAP_START<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token variable\"><span class=\"token variable\">$((<\/span>HOME_START <span class=\"token operator\">&#043;<\/span> HOME_SECTORS<span class=\"token variable\">))<\/span><\/span><\/p>\n<p><span class=\"token comment\"># \u521b\u5efa\u5206\u533a\u5b9a\u4e49<\/span><br \/>\n<span class=\"token function\">cat<\/span> <span class=\"token operator\">&gt;<\/span> <span class=\"token string\">&#034;<span class=\"token variable\">$PARTITION_FILE<\/span>&#034;<\/span> <span class=\"token operator\">&lt;&lt;<\/span> <span class=\"token string\">EOF<br \/>\n# partition table of <span class=\"token variable\">$DISK_DEVICE<\/span><br \/>\nunit: sectors<\/p>\n<p><span class=\"token variable\">${DISK_DEVICE}<\/span>1 : start&#061;    <span class=\"token variable\">$ROOT_START<\/span>, size&#061;  <span class=\"token variable\">$ROOT_SECTORS<\/span>, type&#061;83, bootable<br \/>\n<span class=\"token variable\">${DISK_DEVICE}<\/span>2 : start&#061;    <span class=\"token variable\">$HOME_START<\/span>, size&#061;  <span class=\"token variable\">$HOME_SECTORS<\/span>, type&#061;83<br \/>\n<span class=\"token variable\">${DISK_DEVICE}<\/span>3 : start&#061;    <span class=\"token variable\">$SWAP_START<\/span>, size&#061;  <span class=\"token variable\">$SWAP_SECTORS<\/span>, type&#061;82<br \/>\nEOF<\/span><\/p>\n<p><span class=\"token comment\"># \u663e\u793a\u5206\u533a\u8ba1\u5212<\/span><br \/>\n<span class=\"token builtin class-name\">echo<\/span> <span class=\"token string\">&#034;<span class=\"token entity\" title=\"\\\\n\">\\\\n<\/span>&#061;&#061;&#061; \u5206\u533a\u8ba1\u5212 &#061;&#061;&#061;&#034;<\/span><br \/>\n<span class=\"token function\">cat<\/span> <span class=\"token string\">&#034;<span class=\"token variable\">$PARTITION_FILE<\/span>&#034;<\/span><br \/>\n<span class=\"token builtin class-name\">echo<\/span> <span class=\"token string\">&#034;<span class=\"token entity\" title=\"\\\\n\">\\\\n<\/span>\u6ce8\u610f&#xff1a;\u6b64\u64cd\u4f5c\u5c06\u8986\u76d6 <span class=\"token variable\">$DISK_DEVICE<\/span> \u4e0a\u7684\u6240\u6709\u6570\u636e&#xff01;&#034;<\/span><br \/>\n<span class=\"token builtin class-name\">read<\/span> -p <span class=\"token string\">&#034;\u786e\u8ba4\u7ee7\u7eed\u5417&#xff1f;(y\/N) &#034;<\/span> CONFIRM<br \/>\n<span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">[<\/span><span class=\"token punctuation\">[<\/span> <span class=\"token operator\">!<\/span> <span class=\"token variable\">$CONFIRM<\/span> <span class=\"token operator\">&#061;~<\/span> ^<span class=\"token punctuation\">[<\/span>Yy<span class=\"token punctuation\">]<\/span>$ <span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">;<\/span> <span class=\"token keyword\">then<\/span><br \/>\n    log <span class=\"token string\">&#034;\u7528\u6237\u53d6\u6d88\u4e86\u5206\u533a\u64cd\u4f5c\u3002&#034;<\/span><br \/>\n    <span class=\"token function\">rm<\/span> -f <span class=\"token string\">&#034;<span class=\"token variable\">$PARTITION_FILE<\/span>&#034;<\/span><br \/>\n    <span class=\"token builtin class-name\">exit<\/span> <span class=\"token number\">0<\/span><br \/>\n<span class=\"token keyword\">fi<\/span><\/p>\n<p><span class=\"token comment\"># \u5e94\u7528\u5206\u533a\u8868<\/span><br \/>\nlog <span class=\"token string\">&#034;\u6b63\u5728\u5e94\u7528\u5206\u533a\u8868&#8230;&#034;<\/span><br \/>\nsfdisk &#8211;force <span class=\"token string\">&#034;<span class=\"token variable\">$DISK_DEVICE<\/span>&#034;<\/span> <span class=\"token operator\">&lt;<\/span> <span class=\"token string\">&#034;<span class=\"token variable\">$PARTITION_FILE<\/span>&#034;<\/span><\/p>\n<p><span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">[<\/span> <span class=\"token variable\">$?<\/span> -eq <span class=\"token number\">0<\/span> <span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">;<\/span> <span class=\"token keyword\">then<\/span><br \/>\n    log <span class=\"token string\">&#034;\u6210\u529f&#xff1a;\u5206\u533a\u8868\u5e94\u7528\u5b8c\u6210&#xff01;&#034;<\/span><br \/>\n    <span class=\"token comment\"># \u91cd\u65b0\u8bfb\u53d6\u5206\u533a\u8868<\/span><br \/>\n    partprobe <span class=\"token string\">&#034;<span class=\"token variable\">$DISK_DEVICE<\/span>&#034;<\/span><br \/>\n    <span class=\"token comment\"># \u683c\u5f0f\u5316\u5206\u533a<\/span><br \/>\n    log <span class=\"token string\">&#034;\u6b63\u5728\u683c\u5f0f\u5316\u5206\u533a&#8230;&#034;<\/span><br \/>\n    <span class=\"token comment\"># \u683c\u5f0f\u5316\u6839\u5206\u533a<\/span><br \/>\n    mkfs.ext4 -L root <span class=\"token string\">&#034;<span class=\"token variable\">${DISK_DEVICE}<\/span>1&#034;<\/span><br \/>\n    <span class=\"token comment\"># \u683c\u5f0f\u5316\u5bb6\u76ee\u5f55\u5206\u533a<\/span><br \/>\n    mkfs.ext4 -L home <span class=\"token string\">&#034;<span class=\"token variable\">${DISK_DEVICE}<\/span>2&#034;<\/span><br \/>\n    <span class=\"token comment\"># \u683c\u5f0f\u5316\u4ea4\u6362\u5206\u533a<\/span><br \/>\n    <span class=\"token function\">mkswap<\/span> -L swap <span class=\"token string\">&#034;<span class=\"token variable\">${DISK_DEVICE}<\/span>3&#034;<\/span><br \/>\n    <span class=\"token comment\"># \u663e\u793a\u7ed3\u679c<\/span><br \/>\n    log <span class=\"token string\">&#034;\u5206\u533a\u64cd\u4f5c\u5b8c\u6210&#xff0c;\u65b0\u7684\u5206\u533a\u8868&#xff1a;&#034;<\/span><br \/>\nsfdisk -l <span class=\"token string\">&#034;<span class=\"token variable\">$DISK_DEVICE<\/span>&#034;<\/span> <span class=\"token operator\">&gt;&gt;<\/span> <span class=\"token variable\">$LOG_FILE<\/span><br \/>\n<span class=\"token keyword\">else<\/span><br \/>\n    log <span class=\"token string\">&#034;\u9519\u8bef&#xff1a;\u5206\u533a\u8868\u5e94\u7528\u5931\u8d25&#xff01;&#034;<\/span><br \/>\n    <span class=\"token builtin class-name\">exit<\/span> <span class=\"token number\">1<\/span><br \/>\n<span class=\"token keyword\">fi<\/span><\/p>\n<p><span class=\"token comment\"># \u6e05\u7406\u4e34\u65f6\u6587\u4ef6<\/span><br \/>\n<span class=\"token function\">rm<\/span> -f <span class=\"token string\">&#034;<span class=\"token variable\">$PARTITION_FILE<\/span>&#034;<\/span><\/p>\n<p>log <span class=\"token string\">&#034;\u81ea\u52a8\u5206\u533a\u811a\u672c\u6267\u884c\u5b8c\u6210&#xff01;&#034;<\/span><\/p>\n<p><span class=\"token comment\"># \u663e\u793a\u7ed3\u679c\u6458\u8981<\/span><br \/>\n<span class=\"token builtin class-name\">echo<\/span> <span class=\"token string\">&#034;<span class=\"token entity\" title=\"\\\\n\">\\\\n<\/span>&#061;&#061;&#061; \u5206\u533a\u7ed3\u679c\u6458\u8981 &#061;&#061;&#061;&#034;<\/span><br \/>\n<span class=\"token function\">sudo<\/span> sfdisk -l <span class=\"token string\">&#034;<span class=\"token variable\">$DISK_DEVICE<\/span>&#034;<\/span><br \/>\n<span class=\"token builtin class-name\">echo<\/span> <span class=\"token string\">&#034;\u8be6\u7ec6\u65e5\u5fd7\u8bf7\u67e5\u770b&#xff1a;<span class=\"token variable\">$LOG_FILE<\/span>&#034;<\/span><br \/>\n<span class=\"token builtin class-name\">echo<\/span> <span class=\"token string\">&#034;\u5206\u533a\u8868\u5907\u4efd\u6587\u4ef6&#xff1a;<span class=\"token variable\">$BACKUP_FILE<\/span>&#034;<\/span><\/p>\n<h4>6. \u4f7f\u7528sfdisk\u8fdb\u884c\u9ad8\u7ea7\u5206\u533a\u64cd\u4f5c<\/h4>\n<p>\u4ee5\u4e0b\u662f\u4e00\u4e9bsfdisk\u7684\u9ad8\u7ea7\u5206\u533a\u64cd\u4f5c\u793a\u4f8b&#xff1a;<\/p>\n<p><span class=\"token comment\"># \u663e\u793a\u5206\u533a\u8868\u7684\u8be6\u7ec6\u4fe1\u606f&#xff08;\u5305\u62ec\u6269\u5c55\u5206\u533a\u548c\u903b\u8f91\u5206\u533a&#xff09;<\/span><br \/>\n<span class=\"token function\">sudo<\/span> sfdisk -d \/dev\/sdb<\/p>\n<p><span class=\"token comment\"># \u521b\u5efa\u4e00\u4e2a\u5e26\u6269\u5c55\u5206\u533a\u7684\u5206\u533a\u8868<\/span><br \/>\n<span class=\"token function\">cat<\/span> <span class=\"token operator\">&gt;<\/span> \/tmp\/extended_partitions.txt <span class=\"token operator\">&lt;&lt;<\/span> <span class=\"token string\">EOF<br \/>\n# partition table of \/dev\/sdb<br \/>\nunit: sectors<\/p>\n<p>\/dev\/sdb1 : start&#061;     2048, size&#061; 41940992, type&#061;83, bootable<br \/>\n\/dev\/sdb2 : start&#061; 41943040, size&#061;209715200, type&#061;5<br \/>\n\/dev\/sdb5 : start&#061; 41945088, size&#061; 41940992, type&#061;83<br \/>\n\/dev\/sdb6 : start&#061; 83886080, size&#061; 41943040, type&#061;83<br \/>\n\/dev\/sdb7 : start&#061;125829120, size&#061; 41943040, type&#061;82<br \/>\nEOF<\/span><\/p>\n<p><span class=\"token function\">sudo<\/span> sfdisk \/dev\/sdb <span class=\"token operator\">&lt;<\/span> \/tmp\/extended_partitions.txt<\/p>\n<p>\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d&#xff0c;\u6211\u4eec\u521b\u5efa\u4e86\u4e00\u4e2a\u4e3b\u5206\u533a&#xff08;\/dev\/sdb1&#xff09;\u3001\u4e00\u4e2a\u6269\u5c55\u5206\u533a&#xff08;\/dev\/sdb2&#xff09;&#xff0c;\u4ee5\u53ca\u5728\u6269\u5c55\u5206\u533a\u4e2d\u521b\u5efa\u4e86\u4e09\u4e2a\u903b\u8f91\u5206\u533a&#xff08;\/dev\/sdb5\u3001\/dev\/sdb6\u548c\/dev\/sdb7&#xff09;\u3002<\/p>\n<h3>\u56db\u3001\u5b9e\u7528\u6280\u5de7\u4e0e\u5e38\u89c1\u95ee\u9898<\/h3>\n<h4>\u5b9e\u7528\u6280\u5de7<\/h4>\n<li>\u4f7f\u7528\u6247\u533a\u5bf9\u9f50\u63d0\u9ad8\u6027\u80fd<\/li>\n<p>\u5bf9\u4e8e\u73b0\u4ee3\u786c\u76d8&#xff08;\u7279\u522b\u662fSSD\u548c\u9ad8\u7ea7\u683c\u5f0f\u5316\u786c\u76d8&#xff09;&#xff0c;\u6b63\u786e\u7684\u6247\u533a\u5bf9\u9f50\u53ef\u4ee5\u63d0\u9ad8\u6027\u80fd\u548c\u5ef6\u957f\u4f7f\u7528\u5bff\u547d&#xff1a;<\/p>\n<p><span class=\"token comment\"># \u786e\u4fdd\u5206\u533a\u4ece2048\u6247\u533a\u5f00\u59cb&#xff08;\u8fd9\u662f\u5927\u591a\u6570\u73b0\u4ee3\u5206\u533a\u5de5\u5177\u7684\u9ed8\u8ba4\u8bbe\u7f6e&#xff09;<\/span><br \/>\n<span class=\"token comment\"># 2048\u6247\u533a &#061; 1MB&#xff0c;\u8fd9\u662f\u5927\u591a\u6570\u73b0\u4ee3\u5b58\u50a8\u8bbe\u5907\u7684\u6700\u4f73\u5bf9\u9f50\u5355\u4f4d<\/span><\/p>\n<li>\u4f7f\u7528partprobe\u91cd\u65b0\u8bfb\u53d6\u5206\u533a\u8868<\/li>\n<p>\u5728\u4fee\u6539\u5206\u533a\u8868\u540e&#xff0c;\u4f7f\u7528partprobe\u547d\u4ee4\u8ba9\u5185\u6838\u91cd\u65b0\u8bfb\u53d6\u5206\u533a\u8868&#xff0c;\u907f\u514d\u9700\u8981\u91cd\u542f\u7cfb\u7edf&#xff1a;<\/p>\n<p><span class=\"token comment\"># \u4fee\u6539\u5206\u533a\u8868\u540e\u91cd\u65b0\u8bfb\u53d6<\/span><br \/>\n<span class=\"token function\">sudo<\/span> sfdisk \/dev\/sdb <span class=\"token operator\">&lt;<\/span> partitions.txt<br \/>\n<span class=\"token function\">sudo<\/span> partprobe \/dev\/sdb<\/p>\n<li>\u4f7f\u7528numfmt\u8f6c\u6362\u5927\u5c0f\u5355\u4f4d<\/li>\n<p>\u5728\u811a\u672c\u4e2d&#xff0c;\u53ef\u4ee5\u4f7f\u7528numfmt\u547d\u4ee4\u5728\u4e0d\u540c\u7684\u5b58\u50a8\u5355\u4f4d\u4e4b\u95f4\u8fdb\u884c\u8f6c\u6362&#xff1a;<\/p>\n<p><span class=\"token comment\"># \u5c06GB\u8f6c\u6362\u4e3a\u6247\u533a\u6570&#xff08;\u5047\u8bbe\u6247\u533a\u5927\u5c0f\u4e3a512\u5b57\u8282&#xff09;<\/span><br \/>\n<span class=\"token assign-left variable\">SECTORS<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token variable\"><span class=\"token variable\">$(<\/span>numfmt &#8211;from<span class=\"token operator\">&#061;<\/span>iec <span class=\"token string\">&#034;20G&#034;<\/span> &#8211;to-unit<span class=\"token operator\">&#061;<\/span><span class=\"token number\">512<\/span><span class=\"token variable\">)<\/span><\/span><br \/>\n<span class=\"token builtin class-name\">echo<\/span> <span class=\"token string\">&#034;20GB &#061; <span class=\"token variable\">$SECTORS<\/span> \u6247\u533a&#034;<\/span><\/p>\n<li>\u67e5\u770b\u652f\u6301\u7684\u5206\u533a\u7c7b\u578b<\/li>\n<p>\u4f7f\u7528sfdisk\u547d\u4ee4\u67e5\u770b\u6240\u6709\u652f\u6301\u7684\u5206\u533a\u7c7b\u578b\u4ee3\u7801&#xff1a;<\/p>\n<p><span class=\"token comment\"># \u67e5\u770b\u6240\u6709\u652f\u6301\u7684\u5206\u533a\u7c7b\u578b<\/span><br \/>\n<span class=\"token function\">sudo<\/span> sfdisk &#8211;list-types<\/p>\n<li>\u4f7f\u7528\u2013wipe\u9009\u9879\u5b89\u5168\u64e6\u9664<\/li>\n<p>\u5728\u521b\u5efa\u65b0\u5206\u533a\u8868\u4e4b\u524d&#xff0c;\u53ef\u4ee5\u4f7f\u7528&#8211;wipe\u9009\u9879\u5b89\u5168\u64e6\u9664\u65e7\u7684\u5206\u533a\u8868&#xff1a;<\/p>\n<p><span class=\"token comment\"># \u5728\u521b\u5efa\u65b0\u5206\u533a\u8868\u524d\u64e6\u9664\u65e7\u7684\u5206\u533a\u8868<\/span><br \/>\n<span class=\"token function\">sudo<\/span> sfdisk &#8211;wipe<span class=\"token operator\">&#061;<\/span>always \/dev\/sdb<\/p>\n<h4>\u5e38\u89c1\u95ee\u9898<\/h4>\n<li>\u65e0\u6cd5\u5e94\u7528\u5206\u533a\u8868<\/li>\n<p>\u95ee\u9898\u63cf\u8ff0&#xff1a;\u6267\u884csfdisk\u547d\u4ee4\u65f6\u51fa\u73b0&#034;Device or resource busy&#034;\u6216&#034;Partition table busy&#034;\u9519\u8bef\u3002<\/p>\n<p>\u89e3\u51b3\u65b9\u6cd5&#xff1a;<\/p>\n<ul>\n<li>\u786e\u4fdd\u78c1\u76d8\u6ca1\u6709\u88ab\u6302\u8f7d&#xff1a;sudo umount \/dev\/sdb*<\/li>\n<li>\u786e\u4fdd\u6ca1\u6709\u8fdb\u7a0b\u6b63\u5728\u4f7f\u7528\u8be5\u78c1\u76d8&#xff1a;lsof | grep \/dev\/sdb<\/li>\n<li>\u4f7f\u7528&#8211;force\u53c2\u6570\u5f3a\u5236\u5e94\u7528\u5206\u533a\u8868<\/li>\n<\/ul>\n<li>\u5206\u533a\u8868\u635f\u574f<\/li>\n<p>\u95ee\u9898\u63cf\u8ff0&#xff1a;\u78c1\u76d8\u5206\u533a\u8868\u635f\u574f&#xff0c;\u5bfc\u81f4\u65e0\u6cd5\u8bc6\u522b\u5206\u533a\u3002<\/p>\n<p>\u89e3\u51b3\u65b9\u6cd5&#xff1a;<\/p>\n<ul>\n<li>\u4ece\u5907\u4efd\u6062\u590d\u5206\u533a\u8868&#xff1a;sudo sfdisk \/dev\/sdb &lt; partition_table.bak<\/li>\n<li>\u4f7f\u7528testdisk\u7b49\u5de5\u5177\u5c1d\u8bd5\u6062\u590d\u635f\u574f\u7684\u5206\u533a\u8868<\/li>\n<li>\u5982\u679c\u6ca1\u6709\u5907\u4efd\u4e14\u6570\u636e\u4e0d\u91cd\u8981&#xff0c;\u53ef\u4ee5\u91cd\u65b0\u521b\u5efa\u5206\u533a\u8868<\/li>\n<\/ul>\n<li>\u5206\u533a\u5927\u5c0f\u4e0e\u9884\u671f\u4e0d\u7b26<\/li>\n<p>\u95ee\u9898\u63cf\u8ff0&#xff1a;\u521b\u5efa\u7684\u5206\u533a\u5927\u5c0f\u4e0e\u6307\u5b9a\u7684\u5927\u5c0f\u4e0d\u7b26\u3002<\/p>\n<p>\u89e3\u51b3\u65b9\u6cd5&#xff1a;<\/p>\n<ul>\n<li>\u786e\u4fdd\u6b63\u786e\u8ba1\u7b97\u6247\u533a\u6570&#xff08;\u6ce8\u610f\u6247\u533a\u5927\u5c0f\u53ef\u80fd\u662f512\u5b57\u8282\u62164096\u5b57\u8282&#xff09;<\/li>\n<li>\u4f7f\u7528-u\u53c2\u6570\u660e\u786e\u6307\u5b9a\u5355\u4f4d&#xff1a;sudo sfdisk -u M \/dev\/sdb&#xff08;\u4ee5MB\u4e3a\u5355\u4f4d&#xff09;<\/li>\n<\/ul>\n<li>GPT\u5206\u533a\u8868\u95ee\u9898<\/li>\n<p>\u95ee\u9898\u63cf\u8ff0&#xff1a;\u5728GPT\u5206\u533a\u8868\u4e0a\u64cd\u4f5c\u65f6\u9047\u5230\u95ee\u9898\u3002<\/p>\n<p>\u89e3\u51b3\u65b9\u6cd5&#xff1a;<\/p>\n<ul>\n<li>\u786e\u4fdd\u4f7f\u7528&#8211;label&#061;gpt\u53c2\u6570\u521b\u5efaGPT\u5206\u533a\u8868<\/li>\n<li>\u6ce8\u610fGPT\u5206\u533a\u8868\u4f7f\u7528\u7684\u7c7b\u578b\u4ee3\u7801\u4e0eMBR\u4e0d\u540c&#xff08;\u4f8b\u5982&#xff0c;Linux\u5206\u533a\u662f8300\u800c\u4e0d\u662f83&#xff09;<\/li>\n<li>\u5bf9\u4e8e\u590d\u6742\u7684GPT\u5206\u533a\u64cd\u4f5c&#xff0c;\u8003\u8651\u4f7f\u7528gdisk\u547d\u4ee4<\/li>\n<\/ul>\n<li>\u4e3b\u5206\u533a\u6570\u91cf\u9650\u5236<\/li>\n<p>\u95ee\u9898\u63cf\u8ff0&#xff1a;\u65e0\u6cd5\u521b\u5efa\u8d85\u8fc74\u4e2a\u4e3b\u5206\u533a\u3002<\/p>\n<p>\u89e3\u51b3\u65b9\u6cd5&#xff1a;<\/p>\n<ul>\n<li>\u8fd9\u662fMBR\u5206\u533a\u8868\u7684\u9650\u5236&#xff0c;\u6700\u591a\u53ea\u80fd\u67094\u4e2a\u4e3b\u5206\u533a<\/li>\n<li>\u521b\u5efa3\u4e2a\u4e3b\u5206\u533a\u548c1\u4e2a\u6269\u5c55\u5206\u533a&#xff0c;\u7136\u540e\u5728\u6269\u5c55\u5206\u533a\u4e2d\u521b\u5efa\u591a\u4e2a\u903b\u8f91\u5206\u533a<\/li>\n<li>\u6216\u8005\u4f7f\u7528GPT\u5206\u533a\u8868&#xff0c;\u5b83\u6ca1\u6709\u8fd9\u4e2a\u9650\u5236<\/li>\n<\/ul>\n<h3>\u4e94\u3001\u603b\u7ed3<\/h3>\n<p>sfdisk\u547d\u4ee4\u662fLinux\u7cfb\u7edf\u4e2d\u4e00\u4e2a\u529f\u80fd\u5f3a\u5927\u7684\u78c1\u76d8\u5206\u533a\u5de5\u5177&#xff0c;\u7279\u522b\u9002\u5408\u5728\u811a\u672c\u548c\u81ea\u52a8\u5316\u573a\u666f\u4e2d\u4f7f\u7528\u3002\u901a\u8fc7\u672c\u6587\u7684\u8be6\u7ec6\u4ecb\u7ecd\u548c\u5b9e\u4f8b&#xff0c;\u76f8\u4fe1\u60a8\u5df2\u7ecf\u638c\u63e1\u4e86sfdisk\u547d\u4ee4\u7684\u57fa\u672c\u7528\u6cd5\u548c\u9ad8\u7ea7\u6280\u5de7&#xff0c;\u5305\u62ec\u5982\u4f55\u67e5\u770b\u5206\u533a\u4fe1\u606f\u3001\u5982\u4f55\u5907\u4efd\u548c\u6062\u590d\u5206\u533a\u8868\u3001\u5982\u4f55\u4ece\u811a\u672c\u521b\u5efa\u5206\u533a\u3001\u5982\u4f55\u590d\u5236\u5206\u533a\u8868\u7b49\u3002<\/p>\n<p>\u5728\u5b9e\u9645\u5de5\u4f5c\u4e2d&#xff0c;sfdisk\u5e38\u7528\u4e8e\u7cfb\u7edf\u5b89\u88c5\u3001\u6279\u91cf\u90e8\u7f72\u548c\u78c1\u76d8\u7ba1\u7406\u7b49\u573a\u666f\u3002\u4f7f\u7528\u65f6&#xff0c;\u8bf7\u6ce8\u610f\u4ee5\u4e0b\u51e0\u70b9&#xff1a;\u59cb\u7ec8\u4ee5root\u6743\u9650\u8fd0\u884c\u547d\u4ee4&#xff0c;\u64cd\u4f5c\u524d\u5907\u4efd\u91cd\u8981\u6570\u636e&#xff0c;\u786e\u4fdd\u78c1\u76d8\u672a\u88ab\u6302\u8f7d&#xff0c;\u4e86\u89e3MBR\u548cGPT\u5206\u533a\u8868\u7684\u533a\u522b\u548c\u9650\u5236&#xff0c;\u4ee5\u53ca\u6b63\u786e\u8ba1\u7b97\u5206\u533a\u5927\u5c0f\u548c\u4f4d\u7f6e\u3002<\/p>\n<p>\u8bb0\u4f4f&#xff0c;\u5206\u533a\u64cd\u4f5c\u5177\u6709\u4e00\u5b9a\u7684\u98ce\u9669\u6027&#xff0c;\u53ef\u80fd\u5bfc\u81f4\u6570\u636e\u4e22\u5931\u3002\u5728\u8fdb\u884c\u4efb\u4f55\u5206\u533a\u64cd\u4f5c\u4e4b\u524d&#xff0c;\u8bf7\u52a1\u5fc5\u5907\u4efd\u6240\u6709\u91cd\u8981\u6570\u636e&#xff0c;\u5e76\u786e\u4fdd\u60a8\u4e86\u89e3\u81ea\u5df1\u6b63\u5728\u6267\u884c\u7684\u64cd\u4f5c&#xff01;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3010Linux\u547d\u4ee4\u5927\u5168\u3011008.\u78c1\u76d8\u7ef4\u62a4\u4e4bsfdisk\u547d\u4ee4&#xff08;\u5b9e\u64cd\u7bc7&#xff09; \u2728 \u672c\u6587\u4e3aLinux\u7cfb\u7edf\u78c1\u76d8\u7ef4\u62a4\u547d\u4ee4\u7684\u5168\u9762\u6c47\u603b\u4e0e\u6df1\u5ea6\u4f18\u5316&#xff0c;\u7ed3\u5408\u56fe\u6807\u3001\u7ed3\u6784\u5316\u6392\u7248\u4e0e\u5b9e\u7528\u6280\u5de7&#xff0c;\u4e13\u4e3a\u9ad8\u7ea7\u7528\u6237\u548c\u7cfb\u7edf\u7ba1\u7406\u5458\u6253\u9020\u3002 (\u5173\u6ce8\u4e0d\u8ff7\u8def\u54c8&#xff01;&#xff01;&#xff01;) \u6587\u7ae0\u76ee\u5f55\u3010Linux\u547d\u4ee4\u5927\u5168\u3011008.\u78c1\u76d8\u7ef4\u62a4\u4e4bsfdisk\u547d\u4ee4&#xff08;\u5b9e\u64cd\u7bc7&#xff09;\u4e00\u3001\u529f\u80fd\u4e0e\u4f5c\u7528\u4e8c\u3001\u57fa\u672c\u7528\u6cd51. \u663e\u793a\u78c1\u76d8\u5206\u533a\u4fe1\u606f2. \u5907\u4efd\u5206\u533a\u88683<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[130,58,87,43,44],"topic":[],"class_list":["post-71195","post","type-post","status-publish","format-standard","hentry","category-server","tag-chrome","tag-linux","tag-87","tag-43","tag-44"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u3010Linux\u547d\u4ee4\u5927\u5168\u3011008.\u78c1\u76d8\u7ef4\u62a4\u4e4bsfdisk\u547d\u4ee4\uff08\u5b9e\u64cd\u7bc7\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/71195.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u3010Linux\u547d\u4ee4\u5927\u5168\u3011008.\u78c1\u76d8\u7ef4\u62a4\u4e4bsfdisk\u547d\u4ee4\uff08\u5b9e\u64cd\u7bc7\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u3010Linux\u547d\u4ee4\u5927\u5168\u3011008.\u78c1\u76d8\u7ef4\u62a4\u4e4bsfdisk\u547d\u4ee4&#xff08;\u5b9e\u64cd\u7bc7&#xff09; \u2728 \u672c\u6587\u4e3aLinux\u7cfb\u7edf\u78c1\u76d8\u7ef4\u62a4\u547d\u4ee4\u7684\u5168\u9762\u6c47\u603b\u4e0e\u6df1\u5ea6\u4f18\u5316&#xff0c;\u7ed3\u5408\u56fe\u6807\u3001\u7ed3\u6784\u5316\u6392\u7248\u4e0e\u5b9e\u7528\u6280\u5de7&#xff0c;\u4e13\u4e3a\u9ad8\u7ea7\u7528\u6237\u548c\u7cfb\u7edf\u7ba1\u7406\u5458\u6253\u9020\u3002 (\u5173\u6ce8\u4e0d\u8ff7\u8def\u54c8&#xff01;&#xff01;&#xff01;) \u6587\u7ae0\u76ee\u5f55\u3010Linux\u547d\u4ee4\u5927\u5168\u3011008.\u78c1\u76d8\u7ef4\u62a4\u4e4bsfdisk\u547d\u4ee4&#xff08;\u5b9e\u64cd\u7bc7&#xff09;\u4e00\u3001\u529f\u80fd\u4e0e\u4f5c\u7528\u4e8c\u3001\u57fa\u672c\u7528\u6cd51. \u663e\u793a\u78c1\u76d8\u5206\u533a\u4fe1\u606f2. \u5907\u4efd\u5206\u533a\u88683\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/71195.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-02-03T03:42:21+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/71195.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/71195.html\",\"name\":\"\u3010Linux\u547d\u4ee4\u5927\u5168\u3011008.\u78c1\u76d8\u7ef4\u62a4\u4e4bsfdisk\u547d\u4ee4\uff08\u5b9e\u64cd\u7bc7\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-02-03T03:42:21+00:00\",\"dateModified\":\"2026-02-03T03:42:21+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/71195.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/71195.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/71195.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u3010Linux\u547d\u4ee4\u5927\u5168\u3011008.\u78c1\u76d8\u7ef4\u62a4\u4e4bsfdisk\u547d\u4ee4\uff08\u5b9e\u64cd\u7bc7\uff09\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u3010Linux\u547d\u4ee4\u5927\u5168\u3011008.\u78c1\u76d8\u7ef4\u62a4\u4e4bsfdisk\u547d\u4ee4\uff08\u5b9e\u64cd\u7bc7\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/71195.html","og_locale":"zh_CN","og_type":"article","og_title":"\u3010Linux\u547d\u4ee4\u5927\u5168\u3011008.\u78c1\u76d8\u7ef4\u62a4\u4e4bsfdisk\u547d\u4ee4\uff08\u5b9e\u64cd\u7bc7\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u3010Linux\u547d\u4ee4\u5927\u5168\u3011008.\u78c1\u76d8\u7ef4\u62a4\u4e4bsfdisk\u547d\u4ee4&#xff08;\u5b9e\u64cd\u7bc7&#xff09; \u2728 \u672c\u6587\u4e3aLinux\u7cfb\u7edf\u78c1\u76d8\u7ef4\u62a4\u547d\u4ee4\u7684\u5168\u9762\u6c47\u603b\u4e0e\u6df1\u5ea6\u4f18\u5316&#xff0c;\u7ed3\u5408\u56fe\u6807\u3001\u7ed3\u6784\u5316\u6392\u7248\u4e0e\u5b9e\u7528\u6280\u5de7&#xff0c;\u4e13\u4e3a\u9ad8\u7ea7\u7528\u6237\u548c\u7cfb\u7edf\u7ba1\u7406\u5458\u6253\u9020\u3002 (\u5173\u6ce8\u4e0d\u8ff7\u8def\u54c8&#xff01;&#xff01;&#xff01;) \u6587\u7ae0\u76ee\u5f55\u3010Linux\u547d\u4ee4\u5927\u5168\u3011008.\u78c1\u76d8\u7ef4\u62a4\u4e4bsfdisk\u547d\u4ee4&#xff08;\u5b9e\u64cd\u7bc7&#xff09;\u4e00\u3001\u529f\u80fd\u4e0e\u4f5c\u7528\u4e8c\u3001\u57fa\u672c\u7528\u6cd51. \u663e\u793a\u78c1\u76d8\u5206\u533a\u4fe1\u606f2. \u5907\u4efd\u5206\u533a\u88683","og_url":"https:\/\/www.wsisp.com\/helps\/71195.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-02-03T03:42:21+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"6 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/71195.html","url":"https:\/\/www.wsisp.com\/helps\/71195.html","name":"\u3010Linux\u547d\u4ee4\u5927\u5168\u3011008.\u78c1\u76d8\u7ef4\u62a4\u4e4bsfdisk\u547d\u4ee4\uff08\u5b9e\u64cd\u7bc7\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-02-03T03:42:21+00:00","dateModified":"2026-02-03T03:42:21+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/71195.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/71195.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/71195.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u3010Linux\u547d\u4ee4\u5927\u5168\u3011008.\u78c1\u76d8\u7ef4\u62a4\u4e4bsfdisk\u547d\u4ee4\uff08\u5b9e\u64cd\u7bc7\uff09"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/71195","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=71195"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/71195\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=71195"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=71195"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=71195"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=71195"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}