LVM 在线扩容
默认系统的home分区容量很大,需要重新分配。
卸载home分区
#如果home分区有数据,提前备份到其他目录。
umount /home
删除逻辑卷
[root@localhost ~]# lvremove /dev/centos/home
将空余的100% 都加到root里面,具体视情况而定
[root@localhost ~]# lvextend -l+100%FREE /dev/mapper/centos-root
调整逻辑卷大小(参考)
- 容量增加至固定大小 1G :
lvextend -L 1G /dev/vg_groupname/lv_name
- 容量额外增加 300M :
lvextend -L +300M /dev/vg_groupname/lv_name
- 容量减小至固定大小 :
lvreduce -L 500M /dev/vg_groupname/lv_name
- 容量额外减少 200M :
lvreduce -L -200M /dev/vg_groupname/lv_name
- 按剩余百分增加 :
lvextend -l +100%FREE /dev/vg_groupname/lv_name