{"id":348,"date":"2019-04-28T11:41:41","date_gmt":"2019-04-28T03:41:41","guid":{"rendered":"https:\/\/www.linuxcool.com\/?p=348"},"modified":"2022-05-06T17:27:09","modified_gmt":"2022-05-06T09:27:09","slug":"fdisk","status":"publish","type":"post","link":"https:\/\/www.linuxcool.com\/fdisk","title":{"rendered":"fdisk\u547d\u4ee4 – \u7ba1\u7406\u78c1\u76d8\u5206\u533a"},"content":{"rendered":"\n

fdisk\u547d\u4ee4\u6765\u81ea\u4e8e\u82f1\u6587\u8bcd\u7ec4\u201cPartition table manipulator for Linux\u201d\u7684\u7f29\u5199\uff0c\u5176\u529f\u80fd\u662f\u7528\u4e8e\u7ba1\u7406\u78c1\u76d8\u7684\u5206\u533a\u4fe1\u606f\u3002\u5982\u679c\u4e00\u5957\u51e0\u767e\u5e73\u7c73\u7684\u623f\u5b50\u5185\u90e8\u6ca1\u6709\u5899\u58c1\uff0c\u867d\u7136\u770b\u8d77\u6765\u4f1a\u5f88\u655e\u4eae\uff0c\u4f46\u662f\u5404\u79cd\u58f0\u97f3\u3001\u6c14\u5473\u3001\u7269\u54c1\u4f1a\u968f\u610f\u5145\u65a5\u5728\u6574\u4e2a\u623f\u5b50\u5185\uff0c\u8ba9\u4eba\u6781\u4e0d\u8212\u9002\uff0c\u56e0\u6b64\u9700\u8981\u7528\u5899\u58c1\u6309\u7167\u529f\u80fd\u8fdb\u884c\u5212\u5206\uff0c\u4f8b\u5982\u5367\u5ba4\u3001\u5395\u6240\u3001\u53a8\u623f\u3001\u9633\u53f0\u7b49\u7b49\u3002<\/p>\n\n\n\n

fdisk\u547d\u4ee4\u53ef\u4ee5\u7528\u4e8e\u5bf9\u78c1\u76d8\u8fdb\u884c\u5206\u533a\u64cd\u4f5c\uff0c\u7528\u6237\u53ef\u4ee5\u6839\u636e\u5b9e\u9645\u60c5\u51b5\u8fdb\u884c\u5408\u7406\u5212\u5206\uff0c\u8fd9\u6837\u540e\u671f\u6302\u8f7d\u548c\u4f7f\u7528\u65f6\u4f1a\u65b9\u4fbf\u5f88\u591a\u3002<\/p>\n\n\n\n

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

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

-b<\/td>\u6307\u5b9a\u6bcf\u4e2a\u5206\u533a\u7684\u5927\u5c0f<\/td><\/tr>
-l<\/td>\u5217\u51fa\u6307\u5b9a\u7684\u5916\u56f4\u8bbe\u5907\u7684\u5206\u533a\u8868\u72b6\u51b5<\/td><\/tr>
-s<\/td>\u5c06\u6307\u5b9a\u7684\u5206\u533a\u5927\u5c0f\u8f93\u51fa\u5230\u6807\u51c6\u8f93\u51fa\u4e0a\uff0c\u5355\u4f4d\u4e3a\u533a\u5757 <\/td><\/tr>
-u<\/td>\u642d\u914d”-l”\u53c2\u6570\u5217\u8868\uff0c\u4f1a\u7528\u5206\u533a\u6570\u76ee\u53d6\u4ee3\u67f1\u9762\u6570\u76ee\uff0c\u6765\u8868\u793a\u6bcf\u4e2a\u5206\u533a\u7684\u8d77\u59cb\u5730\u5740<\/td><\/tr>
-v<\/td>\u663e\u793a\u7248\u672c\u4fe1\u606f<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n

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

\u67e5\u770b\u5f53\u524d\u7cfb\u7edf\u7684\u5206\u533a\u60c5\u51b5\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# fdisk -l<\/strong>\nDisk \/dev\/sda: 20 GiB, 21474836480 bytes, 41943040 sectors\nUnits: sectors of 1 * 512 = 512 bytes\nSector size (logical\/physical): 512 bytes \/ 512 bytes\nI\/O size (minimum\/optimal): 512 bytes \/ 512 bytes\nDisklabel type: dos\nDisk identifier: 0x5f1d8ee5\n\nDevice     Boot   Start      End  Sectors Size Id Type\n\/dev\/sda1  *       2048  2099199  2097152   1G 83 Linux\n\/dev\/sda2       2099200 41943039 39843840  19G 8e Linux LVM\n\u2026\u2026\u2026\u2026\u2026\u2026\u7701\u7565\u90e8\u5206\u8f93\u51fa\u4fe1\u606f\u2026\u2026\u2026\u2026\u2026\u2026\n<\/pre>\n\n\n\n

\u7ba1\u7406\u6307\u5b9a\u786c\u76d8\u7684\u5206\u533a\uff08\u8fc7\u7a0b\u7701\u7565\uff0c\u4ee5\u300aLinux\u5c31\u8be5\u8fd9\u4e48\u5b66\u300b\u7b2c6\u7ae0\u8282\u4e3a\u51c6\uff09\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# fdisk \/dev\/sd<\/strong>a\nWelcome to fdisk (util-linux 2.32.1).\nChanges will remain in memory only, until you decide to write them.\nBe careful before using the write command.\n\nCommand (m for help): n <\/strong>\nAll space for primary partitions is in use.\nCommand (m for help): m <\/strong>\n\nHelp:\n  DOS (MBR)\n   a   toggle a bootable flag\n   b   edit nested BSD disklabel\n   c   toggle the dos compatibility flag\n\n  Generic\n   d   delete a partition\n   F   list free unpartitioned space\n   l   list known partition types\n   n   add a new partition\n   p   print the partition table\n   t   change a partition type\n   v   verify the partition table\n   i   print information about a partition\n\n  Misc\n   m   print this menu\n   u   change display\/entry units\n   x   extra functionality (experts only)\n\n  Script\n   I   load disk layout from sfdisk script file\n   O   dump disk layout to sfdisk script file\n\n  Save & Exit\n   w   write table to disk and exit\n   q   quit without saving changes\n\n  Create a new label\n   g   create a new empty GPT partition table\n   G   create a new empty SGI (IRIX) partition table\n   o   create a new empty DOS partition table\n   s   create a new empty Sun partition table\n\u2026\u2026\u2026\u2026\u2026\u2026\u7701\u7565\u90e8\u5206\u8f93\u51fa\u4fe1\u606f\u2026\u2026\u2026\u2026\u2026\u2026<\/pre>\n","protected":false},"excerpt":{"rendered":"

fdisk\u547d\u4ee4\u6765\u81ea\u4e8e\u82f1\u6587\u8bcd\u7ec4\u201cPartition table manipulator for Linux\u201d\u7684\u7f29 […]<\/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\/348"}],"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=348"}],"version-history":[{"count":12,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/348\/revisions"}],"predecessor-version":[{"id":9313,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/348\/revisions\/9313"}],"wp:attachment":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/media?parent=348"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/categories?post=348"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/tags?post=348"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}