{"id":363,"date":"2019-06-27T10:39:54","date_gmt":"2019-06-27T02:39:54","guid":{"rendered":"http:\/\/www.inhhh.com\/blog\/?p=363"},"modified":"2019-06-27T10:39:54","modified_gmt":"2019-06-27T02:39:54","slug":"%e8%a7%a3%e5%86%b3%e8%bf%98%e5%8e%9fcentos%e5%90%8e-%e6%a0%b9%e7%9b%ae%e5%bd%95%e7%a9%ba%e9%97%b4%e4%b8%8d%e8%b6%b3%e7%9a%84%e6%83%85%e5%86%b5","status":"publish","type":"post","link":"http:\/\/www.inhhh.com\/blog\/?p=363","title":{"rendered":"\u89e3\u51b3\u8fd8\u539fcentos\u540e \u6839\u76ee\u5f55\u7a7a\u95f4\u4e0d\u8db3\u7684\u60c5\u51b5"},"content":{"rendered":"\n<p>\u73af\u5883\uff1akvm<br>\u7cfb\u7edf\uff1aCentOS7<br>\u6545\u969c\u63cf\u8ff0\uff1a10g\u7684ssd\uff0c\u53ef\u4f7f\u7528\u5927\u5c0f\u4ec5\u67092g<br>\u89e3\u51b3\u8fc7\u7a0b\uff1a<\/p>\n\n\n\n<p>&nbsp; &nbsp; \u67d0\u6b21\u91cd\u88c5\u7cfb\u7edf\u540e\uff0c\u5b89\u88c5\u8f6f\u4ef6\u603b\u63d0\u793a\u78c1\u76d8\u7a7a\u95f4\u4e0d\u8db3\uff0c\u68c0\u67e5\u4e4b\u4e0b\u53d1\u73b0\u4ec5\u67092G\u7a7a\u95f4\uff0c\u5b9e\u5219\u660e\u660e\u662f10G\u7684ssd\uff0c\u4ee5\u4e0b\u4e3a\u6392\u9519\u8fc7\u7a0b\uff1a<\/p>\n\n\n\n<p><strong>1\u3001df -h\u67e5\u770bvda1\u5927\u5c0f\u4e3a2.7G<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#df -h\nFilesystem Size Used Avail Use% Mounted on\n\/dev\/vda1 2.7G 2.4G 236M 91% \/\ndevtmpfs 234M 0 234M 0% \/dev\ntmpfs 244M 0 244M 0% \/dev\/shm\ntmpfs 244M 4.5M 240M 2% \/run\ntmpfs 244M 0 244M 0% \/sys\/fs\/cgroup\ntmpfs 49M 0 49M 0% \/run\/user\/0<\/code><\/pre>\n\n\n\n<p><strong>2\u3001fdisk\u67e5\u770bvda1\u4e00\u51719959232\u4e2ablock\uff0c\u5927\u5c0f\u5e94\u4e3a9959232KB=9.725.8GB<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#fdisk -l\nDisk \/dev\/vda: 10.7 GB, 10737418240 bytes, 20971520 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\nDisk label type: dos\nDisk identifier: 0x000f3770\n\u00a0\u00a0 Device Boot\u00a0\u00a0\u00a0\u00a0\u00a0 Start\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 End\u00a0\u00a0\u00a0\u00a0\u00a0 Blocks\u00a0\u00a0 Id\u00a0 System\n\/dev\/vda1\u00a0\u00a0 *\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 2048\u00a0\u00a0\u00a0 19920511\u00a0 \u00a0\u00a0\u00a09959232\u00a0\u00a0 83\u00a0 Linux\n\/dev\/vda2\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 19920512\u00a0\u00a0\u00a0 20969087\u00a0\u00a0\u00a0\u00a0\u00a0 524288\u00a0\u00a0 82\u00a0 Linux swap \/ Solaris<\/code><\/pre>\n\n\n\n<p><strong>3\u3001\u5c1d\u8bd5\u80fd\u5426\u901a\u8fc7\u65b0\u5efa\u5206\u533a\u89e3\u51b3\u7684\u65f6\u5019\uff0c\u53d1\u73b0\u4e86\u53e6\u4e00\u4e2abug\uff0c\u5c45\u7136\u80fd\u770b\u5230\u4e3b\u673a\u7684\u771f\u5b9e\u78c1\u76d8\u5927\u5c0f\uff01<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#fdisk \/dev\/vda\nWelcome to fdisk (util-linux 2.23.2).\n\nChanges will remain in memory only, until you decide to write them.\nBe careful before using the write command.\n\nCommand (m for help): u\nChanging display\/entry units to cylinders (DEPRECATED!).\n\nCommand (m for help): n\nPartition type:\np primary (2 primary, 0 extended, 2 free)\ne extended\nSelect (default p): p\nPartition number (3,4, default 3): 3\nFirst cylinder (1306-20805, default 1306): \nUsing default value 1306\nLast cylinder, +cylinders or +size{K,M,G} (1306-20805, default 20805): \nUsing default value 20805\nPartition 3 of type Linux and of size 149.4 GiB is set\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\n\n\/\/\u5269\u4f59149.4G\uff0c\u52a0\u4e0a\u6211\u81ea\u5df1\u768410G,\u8fd9\u5757SSD\u7684\u5927\u5c0f\u5e94\u8be5\u662f160G\u7684\uff0c\u5f53\u7136\u4ec5\u6b64\u800c\u5df2\u4e86\uff0c\u60f3\u8981\u76d7\u7528\u8fd8\u662f\u4e0d\u53ef\u80fd\u7684\uff0c\u81f3\u5c11\u6211\u529e\u4e0d\u5230\u3002\u56e7\n\nCommand (m for help): q\n\nfdisk -l\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\n\n\/\/\u867d\u7136fdisk\u770b\u5230\u7684vda3\u8c8c\u4f3c\u5f88\u5389\u5bb3\u7684\u6837\u5b50\n\nDisk \/dev\/vda: 10.7 GB, 10737418240 bytes, 20971520 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\nDisk label type: dos\nDisk identifier: 0x000f3770\n\nDevice Boot Start End Blocks Id System\n\/dev\/vda1 * 2048 19920511 9959232 83 Linux\n\/dev\/vda2 19920512 20969087 524288 82 Linux swap \/ Solaris\n\/dev\/vda3 20969088 334232324 156631618+ 83 Linux<\/code><\/pre>\n\n\n\n<p><strong>4\u3001partprobe\u7684\u65f6\u5019\u679c\u7136\u62a5\u9519\u4e86\u54c8\u54c8\u54c8<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#partprobe \nError: Can't have a partition outside the disk!<\/code><\/pre>\n\n\n\n<p><strong>5\u3001fdisk\u770b\u5230\u7684vda1\u5927\u5c0f\u6b63\u5e38\uff0c\u5e76\u4e14\u4e5f\u6ca1\u6709\u591a\u4f59\u7684\u53ef\u7528\u7a7a\u95f4\u6765\u65b0\u5efa\u5206\u533a\uff0c\u8bf4\u660e\u95ee\u9898\u4e0d\u662f\u51fa\u5728\u78c1\u76d8\u7a7a\u95f4\u5206\u914d\u4e0a\uff0c\u6b64\u8def\u4e0d\u901a\u3002<\/strong><\/p>\n\n\n\n<p><strong>\u6240\u4ee5\u5220\u9664\u90a3\u4e2a\u5947\u8469\u7684vda3\uff0c\u5c1d\u8bd5resize\u65b9\u6cd5<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">#resize2fs \/dev\/vda1 \uff08\u5176\u5b9e\u6838\u5fc3\u5c31\u662f\u8fd9\u4e2a\u547d\u4ee4\uff09<br> resize2fs 1.42.9 (28-Dec-2013) Filesystem at \/dev\/vda1 is mounted on \/; on-line resizing required old_desc_blocks = 1, new_desc_blocks = 2 The filesystem on \/dev\/vda1 is now 2489808 blocks long.<\/pre>\n\n\n\n<p><strong>6\u3001fdisk\u6570\u636e\u5e76\u65e0\u53d8\u5316\uff0c\u4f46df\u663e\u793a\u78c1\u76d8\u7a7a\u95f4\u7ec8\u4e8e\u6b63\u5e38\u4e86\uff0c\u5b89\u88c5\u7a0b\u5e8f\u4e5f\u4e0d\u4f1a\u518d\u63d0\u793a\u78c1\u76d8\u7a7a\u95f4\u4e0d\u8db3\uff0c\u6545\u969c\u6392\u9664\u3002<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>fdisk -l\n\nDisk \/dev\/vda: 10.7 GB, 10737418240 bytes, 20971520 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\nDisk label type: dos\nDisk identifier: 0x000f3770\n\nDevice Boot Start End Blocks Id System\n\/dev\/vda1 * 2048 19920511 9959232 83 Linux\n\/dev\/vda2 19920512 20969087 524288 82 Linux swap \/ Solaris\n\n# df -h\nFilesystem Size Used Avail Use% Mounted on\n\/dev\/vda1 9.3G 2.4G 6.6G 27% \/\ndevtmpfs 234M 0 234M 0% \/dev\ntmpfs 244M 0 244M 0% \/dev\/shm\ntmpfs 244M 4.5M 240M 2% \/run\ntmpfs 244M 0 244M 0% \/sys\/fs\/cgroup\ntmpfs 49M 0 49M 0% \/run\/user\/0<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u73af\u5883\uff1akvm\u7cfb\u7edf\uff1aCentOS7\u6545\u969c\u63cf\u8ff0\uff1a10g\u7684ssd\uff0c\u53ef\u4f7f\u7528\u5927\u5c0f\u4ec5\u67092g\u89e3\u51b3\u8fc7\u7a0b\uff1a &nbsp; &#038;nbs<\/p>\n<div class=\"more-link\">\n\t\t\t\t <a href=\"http:\/\/www.inhhh.com\/blog\/?p=363\" class=\"link-btn theme-btn\"><span>Read More <\/span> <i class=\"fa fa-caret-right\"><\/i><\/a>\n\t\t\t<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-363","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"http:\/\/www.inhhh.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/363","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.inhhh.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.inhhh.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.inhhh.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.inhhh.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=363"}],"version-history":[{"count":1,"href":"http:\/\/www.inhhh.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/363\/revisions"}],"predecessor-version":[{"id":364,"href":"http:\/\/www.inhhh.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/363\/revisions\/364"}],"wp:attachment":[{"href":"http:\/\/www.inhhh.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=363"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.inhhh.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=363"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.inhhh.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=363"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}