{"id":1241,"date":"2023-06-02T15:40:46","date_gmt":"2023-06-02T07:40:46","guid":{"rendered":"https:\/\/www.linuxdevops.cn\/?p=1241"},"modified":"2023-06-02T15:40:47","modified_gmt":"2023-06-02T07:40:47","slug":"lvm-partition-extension","status":"publish","type":"post","link":"https:\/\/www.linuxdevops.cn\/2023\/06\/lvm-partition-extension\/","title":{"rendered":"LVM \u5206\u533a\u6269\u5c55"},"content":{"rendered":"
LVM\uff08Logical Volume Manager\uff09\u662f\u4e00\u79cd\u903b\u8f91\u5377\u7ba1\u7406\u5668\uff0c\u53ef\u4ee5\u52a8\u6001\u5730\u521b\u5efa\u3001\u8c03\u6574\u548c\u5220\u9664\u903b\u8f91\u5377\uff0c\u4ece\u800c\u5927\u5927\u7b80\u5316\u4e86\u5206\u533a\u7ba1\u7406\u3002\u5f53\u9700\u8981\u6269\u5c55 LVM \u5206\u533a\u65f6\uff0c\u53ef\u4ee5\u6309\u7167\u4ee5\u4e0b\u6b65\u9aa4\u8fdb\u884c\u64cd\u4f5c\u3002<\/p>\n
\u4f7f\u7528 \u5c06\u9700\u8981\u6269\u5c55\u7684\u786c\u76d8\u5206\u533a\uff08\u4f8b\u5982 \u5c06\u65b0\u7684\u7269\u7406\u5377\u6dfb\u52a0\u5230 LVM \u5377\u7ec4\u4e2d\uff0c\u4f7f\u7528\u547d\u4ee4 \u5c06\u65b0\u7684\u7a7a\u95f4\u6dfb\u52a0\u5230\u9700\u8981\u6269\u5c55\u7684\u903b\u8f91\u5377\u4e2d\uff0c\u4f7f\u7528\u547d\u4ee4 \u4f8b\u5982\uff0c\u5047\u8bbe\u8981\u5c06 \u4f7f\u7528\u9002\u5408\u6587\u4ef6\u7cfb\u7edf\u7c7b\u578b\u7684\u6269\u5c55\u547d\u4ee4\u8fdb\u884c\u6587\u4ef6\u7cfb\u7edf\u6269\u5c55\uff0c\u5c06\u65b0\u7684\u7a7a\u95f4\u6dfb\u52a0\u5230\u6587\u4ef6\u7cfb\u7edf\u4e2d\u3002<\/p>\n \u4f8b\u5982\uff0c\u5982\u679c "\/dev\/ubuntu-vg\/ubuntu-lv" \u903b\u8f91\u5377\u662f\u4e00\u4e2a ext4 \u6587\u4ef6\u7cfb\u7edf\uff0c\u90a3\u4e48\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u6269\u5c55\u6587\u4ef6\u7cfb\u7edf\uff1a<\/p>\n \u5b8c\u6210\u4ee5\u4e0a\u6b65\u9aa4\u540e\uff0c\u5c31\u53ef\u4ee5\u6210\u529f\u6269\u5c55 LVM \u5206\u533a\u4e86\u3002<\/p>\n \u8bf7\u6ce8\u610f\uff0c\u5728\u5206\u533a\u6269\u5c55\u8fc7\u7a0b\u4e2d\uff0c\u4e0d\u4ec5\u9700\u8981\u5907\u4efd\u91cd\u8981\u6570\u636e\u4ee5\u907f\u514d\u6570\u636e\u4e22\u5931\uff0c\u800c\u4e14\u8fd8\u9700\u8981\u4e86\u89e3\u64cd\u4f5c\u7cfb\u7edf\u548c\u6587\u4ef6\u7cfb\u7edf\u7684\u7279\u6027\uff0c\u4ee5\u786e\u4fdd\u5206\u533a\u6269\u5c55\u8fc7\u7a0b\u4e0d\u4f1a\u5f71\u54cd\u6570\u636e\u7684\u5b8c\u6574\u6027\u548c\u53ef\u9760\u6027\u3002<\/p>\n \u5e0c\u671b\u8fd9\u7bc7\u6587\u7ae0\u80fd\u5bf9\u4f60\u6709\u6240\u5e2e\u52a9\uff0c\u5982\u6709\u7591\u95ee\uff0c\u8bf7\u968f\u65f6\u8054\u7cfb\u3002<\/p>\n","protected":false},"excerpt":{"rendered":" LVM\uff08Logical Volume Manager\uff09\u662f\u4e00\u79cd\u903b\u8f91\u5377\u7ba1\u7406\u5668\uff0c\u53ef\u4ee5\u52a8\u6001\u5730\u521b\u5efa\u3001\u8c03\u6574\u548c\u5220\u9664\u903b\u8f91\u5377\uff0c\u4ece<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17],"tags":[128,130,129],"yoast_head":"\nsudo lvdisplay<\/code> \u547d\u4ee4\u67e5\u770b\u5f53\u524d LVM \u5206\u533a\u60c5\u51b5\uff0c\u8bb0\u5f55\u9700\u8981\u6269\u5c55\u7684\u5206\u533a\u540d\u79f0\u3002<\/p>\n
sudo lvdisplay<\/code><\/pre>\n
\n
\/dev\/sdb1<\/code>\uff09\u6dfb\u52a0\u5230 LVM \u7269\u7406\u5377\u4e2d\uff0c\u4f7f\u7528\u547d\u4ee4
sudo pvcreate \/dev\/sdb1<\/code> \u6269\u5c55\u7269\u7406\u5377\u3002<\/p>\n
sudo pvcreate \/dev\/sdb1<\/code><\/pre>\n
\n
sudo vgextend <\u5377\u7ec4\u540d\u79f0> \/dev\/sdb1<\/code> \u6269\u5c55\u5377\u7ec4\u3002<\/p>\n
sudo vgextend myvg \/dev\/sdb1<\/code><\/pre>\n
\n
sudo lvextend -L +<\u65b0\u589e\u5bb9\u91cf>G <\u903b\u8f91\u5377\u8def\u5f84><\/code> \u6269\u5c55\u903b\u8f91\u5377\uff08\u6ce8\u610f\uff0c\u5bb9\u91cf\u7684\u5355\u4f4d\u4e3a G\uff09\u3002<\/p>\n
\/dev\/ubuntu-vg\/ubuntu-lv<\/code> \u903b\u8f91\u5377\u7684\u5bb9\u91cf\u6269\u5c55 10GB\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n
sudo lvextend -L +10G \/dev\/ubuntu-vg\/ubuntu-lv<\/code><\/pre>\n
\n
sudo resize2fs \/dev\/ubuntu-vg\/ubuntu-lv<\/code><\/pre>\n