参考:https://blog.csdn.net/qq_39450259/article/details/115518524
https://blog.csdn.net/jiabinzhang4310/article/details/100183731
1. 格式化4T硬盘
# fdisk -lDisk /dev/sdb: 4000.8 GB, 4000787030016 bytes, 7814037168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
parted /dev/sdb
(选择硬盘)
(parted) mklabel gpt
(转换gpt分区)
2.分区,格式化
# fdisk /dev/sdb
划分4T到一个分区
# mkfs -t xfs /dev/sdb1
3.扩容根目录
# lvsLV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Converthome centos -wi-ao---- <150.21g root centos -wi-ao---- 50.00g swap centos -wi-ao---- <22.36g
# pvcreate /dev/sdb1
# pvdisplay
# pvs
# vgextend centos /dev/sdb1
# lvextend -l +100%FREE /dev/centos/root
# df -H