{"id":105,"date":"2024-01-09T14:00:32","date_gmt":"2024-01-09T06:00:32","guid":{"rendered":"https:\/\/cn.hidandelion.com\/?p=105"},"modified":"2024-01-10T23:23:57","modified_gmt":"2024-01-10T15:23:57","slug":"how-to-enpand-linux-system-partition","status":"publish","type":"post","link":"https:\/\/cn.hidandelion.com\/?p=105","title":{"rendered":"\u5982\u4f55\u6269\u5c55 Linux \u7684\u7cfb\u7edf\u5206\u533a"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">\u80cc\u666f<\/h2>\n\n\n\n<p>\u5f53\u6211\u4eec\u4e3a Linux \u8fdb\u884c\u78c1\u76d8\u8fd8\u539f\u6216\u4e3a\u4e3b\u673a\u66f4\u6362\u66f4\u5927\u5bb9\u91cf\u786c\u76d8\u65f6\uff0c\u6211\u4eec\u901a\u5e38\u4f1a\u9047\u5230\u7cfb\u7edf\u5206\u533a\u5c0f\u4e8e\u78c1\u76d8\u5927\u5c0f\u7684\u60c5\u51b5\uff0c\u4ece\u800c\u65e0\u6cd5\u6709\u6548\u5229\u7528\u6574\u5757\u78c1\u76d8\uff0c\u8fd9\u65f6\u6211\u4eec\u9700\u8981\u6269\u5c55 Linux \u7684\u7cfb\u7edf\u5206\u533a\u3002\u4e3a\u4e86\u6700\u5927\u53ef\u80fd\u7b80\u5316\u64cd\u4f5c\uff0c\u6211\u4eec\u5c06\u91c7\u7528\u5728\u7ebf\u6269\u5c55\u7684\u65b9\u5f0f\uff0c\u5373\u53ef\u4ee5\u5148\u8fdb\u5165\u7cfb\u7edf\uff0c\u5728\u5206\u533a\u5df2\u6302\u8f7d\u7684\u60c5\u51b5\u4e0b\u8fdb\u884c\u6269\u5c55\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u64cd\u4f5c<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">1. \u67e5\u770b\u78c1\u76d8\u548c\u5206\u533a<\/h3>\n\n\n\n<p>\u4f7f\u7528\u4ee5\u4e0b\u6307\u4ee4\u4ee5\u67e5\u770b\u78c1\u76d8\u4fe1\u606f<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>fdisk -l<\/code><\/pre>\n\n\n\n<p>\u8f93\u51fa\u78c1\u76d8\u548c\u5206\u533a\u4fe1\u606f<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Disk \/dev\/vda: 2 TiB, 2199023255552 bytes, 4294967296 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: gpt\nDisk identifier: 744D726A-2AC1-7744-89B3-072E6920B57A\n\nDevice       Start      End  Sectors Size Type\n\/dev\/vda1     2048     6143     4096   2M BIOS boot\n\/dev\/vda2     6144  2103295  2097152   1G Linux filesystem\n\/dev\/vda3  2103296 20971486 18868191   9G Linux filesystem<\/code><\/pre>\n\n\n\n<p>\u5728\u8fd9\u91cc\uff0c\/dev\/vda \u662f\u6211\u4eec\u7684\u78c1\u76d8\uff0c\u53ef\u89c1\u6211\u4eec\u7684\u78c1\u76d8\u7a7a\u95f4\u4e3a 2T\u3002<\/p>\n\n\n\n<p>\u4f7f\u7528\u4ee5\u4e0b\u6307\u4ee4\u4ee5\u67e5\u770b\u5206\u533a\u4fe1\u606f<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>df -h<\/code><\/pre>\n\n\n\n<p>\u8f93\u51fa\u5206\u533a\u548c\u76ee\u5f55\u4fe1\u606f<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Filesystem      Size  Used Avail Use% Mounted on\nudev             24G     0   24G   0% \/dev\ntmpfs           4.8G  524K  4.8G   1% \/run\n\/dev\/vda3       8.8G  2.2G  6.2G  27% \/\ntmpfs            24G     0   24G   0% \/dev\/shm\ntmpfs           5.0M     0  5.0M   0% \/run\/lock\n\/dev\/vda2       974M   87M  820M  10% \/boot\ntmpfs           4.8G     0  4.8G   0% \/run\/user\/0<\/code><\/pre>\n\n\n\n<p>\u53ef\u89c1\uff0c\/dev\/vda3 \u662f\u6839\u76ee\u5f55\u6240\u5728\u5206\u533a\uff0c\u4e5f\u662f\u6211\u4eec\u7684\u76ee\u6807\u7cfb\u7edf\u5206\u533a\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">2. \u8c03\u6574\u5206\u533a\u8868<\/h3>\n\n\n\n<p>\u4f7f\u7528 growpart \u6307\u4ee4\u6269\u5c55\u5206\u533a\uff0c\u9700\u8981\u6307\u5b9a\u78c1\u76d8\u548c\u5206\u533a\u7f16\u53f7\u3002\u7531\u4e8e\u5728\u4e0a\u9762\u7684\u6b65\u9aa4\u6211\u4eec\u5df2\u786e\u8ba4\u78c1\u76d8\u4e3a \/dev\/vda\uff0c\u5206\u533a\u4e3a \/dev\/vda3\uff0c\u4f7f\u7528\u4ee5\u4e0b\u6307\u4ee4\u4ee5\u6269\u5c55 \/dev\/vda3<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>growpart \/dev\/vda 3<\/code><\/pre>\n\n\n\n<p>\u8f93\u51fa\u8c03\u6574\u5185\u5bb9<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>CHANGED: partition=3 start=2103296 old: size=18868191 end=20971486 new: size=4292863967 end=4294967262<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">3. \u5199\u5165\u6587\u4ef6\u7cfb\u7edf<\/h3>\n\n\n\n<p>\u4f7f\u7528\u4ee5\u4e0b\u6307\u4ee4\u5c06\u5bf9 \/dev\/vda3 \u7684\u66f4\u6539\u5199\u5165\u6587\u4ef6\u7cfb\u7edf<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>resize2fs \/dev\/vda3<\/code><\/pre>\n\n\n\n<p>\u8f93\u51fa\u8c03\u6574\u5185\u5bb9<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>resize2fs 1.47.0 (5-Feb-2023)\nFilesystem at \/dev\/vda3 is mounted on \/; on-line resizing required\nold_desc_blocks = 2, new_desc_blocks = 256\nThe filesystem on \/dev\/vda3 is now 536607995 (4k) blocks long.<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u68c0\u67e5<\/h2>\n\n\n\n<p>\u518d\u6b21\u4f7f\u7528\u4ee5\u4e0b\u6307\u4ee4\u68c0\u67e5\u66f4\u6539<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>fdisk -l<\/code><\/pre>\n\n\n\n<p>\u8f93\u51fa\u78c1\u76d8\u548c\u5206\u533a\u4fe1\u606f<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Disk \/dev\/vda: 2 TiB, 2199023255552 bytes, 4294967296 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: gpt\nDisk identifier: 744D726A-2AC1-7744-89B3-072E6920B57A\n\nDevice       Start        End    Sectors Size Type\n\/dev\/vda1     2048       6143       4096   2M BIOS boot\n\/dev\/vda2     6144    2103295    2097152   1G Linux filesystem\n\/dev\/vda3  2103296 4294967262 4292863967   2T Linux filesystem<\/code><\/pre>\n\n\n\n<p>\u53ef\u89c1\u7cfb\u7edf\u5206\u533a\u5df2\u66f4\u6539\u4e3a\u76ee\u6807\u5927\u5c0f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5f53\u6211\u4eec\u4e3a Linux \u8fdb\u884c\u78c1\u76d8\u8fd8\u539f\u6216\u4e3a\u4e3b\u673a\u66f4\u6362\u66f4\u5927\u5bb9\u91cf\u786c\u76d8\u65f6\uff0c\u6211\u4eec\u901a\u5e38\u4f1a\u9047\u5230\u7cfb\u7edf\u5206\u533a\u5c0f\u4e8e\u78c1\u76d8\u5927\u5c0f\u7684\u60c5\u51b5\uff0c\u4ece\u800c\u65e0\u6cd5\u6709\u6548\u5229\u7528\u6574\u5757\u78c1\u76d8\uff0c\u8fd9\u65f6\u6211\u4eec\u9700\u8981\u6269\u5c55 Linux \u7684\u7cfb\u7edf\u5206\u533a\u3002\u672c\u6587\u5c06\u4ecb\u7ecd\u5982\u4f55\u91c7\u7528\u5728\u7ebf\u6269\u5c55\u7684\u65b9\u5f0f\uff0c\u5373\u53ef\u4ee5\u5148\u8fdb\u5165\u7cfb\u7edf\uff0c\u5728\u5206\u533a\u5df2\u6302\u8f7d\u7684\u60c5\u51b5\u4e0b\u8fdb\u884c\u6269\u5c55\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-105","post","type-post","status-publish","format-standard","hentry","category-developer"],"blocksy_meta":[],"_links":{"self":[{"href":"https:\/\/cn.hidandelion.com\/index.php?rest_route=\/wp\/v2\/posts\/105","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cn.hidandelion.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cn.hidandelion.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cn.hidandelion.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cn.hidandelion.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=105"}],"version-history":[{"count":3,"href":"https:\/\/cn.hidandelion.com\/index.php?rest_route=\/wp\/v2\/posts\/105\/revisions"}],"predecessor-version":[{"id":108,"href":"https:\/\/cn.hidandelion.com\/index.php?rest_route=\/wp\/v2\/posts\/105\/revisions\/108"}],"wp:attachment":[{"href":"https:\/\/cn.hidandelion.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=105"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cn.hidandelion.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=105"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cn.hidandelion.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=105"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}