Linux扩容分区
检查 df -h fdisk -l 建分区 fdisk /dev/sdb 确认分区是sdb fdisk /dev/sdb1 mkfs.ext4 /dev/sdb1 格式化 df -h fdisk -l pvcreate /dev/sdb1 建立物理卷 vgdisplay 查看当前卷VolGroup vgextend /dev/VolGroup /dev/sdb1 扩展卷组VolGroup vgdisplay lvextend -L +100G /dev/mapper/VolGroup-lv_root 增加根目录容量 resize2fs /dev/mapper/VolGroup-lv_root 重置根分区容量 df-h umount /home df -h lvremove /dev/centos/home y lvscan vgdisplay =======================================CentOS7 移除/home目录 umount /home lvremove /dev/mapper/centos-root y fdisk -l 添加至根目录 vgdisplay Free PE / Size 114082 / 445.63 GiB lvextend -L +50G /dev/mapper/centos-root resize2fs /dev/mapper/centos-root lvextend -L +100G /dev/mapper/centos-root lvextend -l +100%FREE /dev/mapper/centos-root xfs_growfs /dev/mapper/centos-root
本文为张军原创文章,转载无需和我联系,但请注明来自张军的军军小站,个人博客http://www.zhangjunbk.com