LVM扩容根分区
1 添加一块新磁盘
2 创建PV
[root@harbor ~]# pvcreate /dev/vdb WARNING: dos signature detected on /dev/vdb at offset 510. Wipe it? [y/n]: WARNING: Invalid input ''. WARNING: dos signature detected on /dev/vdb at offset 510. Wipe it? [y/n]: y Wiping dos signature on /dev/vdb. Physical volume "/dev/vdb" successfully created.
3 扩容VG
[root@harbor ~]# vgextend /dev/centos /dev/vdb Volume group "centos" successfully extended [root@harbor ~]# [root@harbor ~]# vgs VG #PV #LV #SN Attr VSize VFree centos 2 2 0 wz--n- 538.99g <500.00g
4 扩容LVM
[root@harbor ~]# lvextend -l +100%FREE /dev/centos/root Size of logical volume centos/root changed from <35.00 GiB (8959 extents) to 534.99 GiB (136958 extents). Logical volume centos/root successfully resized.
5 扩展文件系统
[root@harbor ~]# xfs_growfs /dev/centos/root meta-data=/dev/mapper/centos-root isize=512 agcount=4, agsize=2293504 blks = sectsz=512 attr=2, projid32bit=1 = crc=1 finobt=0 spinodes=0 data = bsize=4096 blocks=9174016, imaxpct=25 = sunit=0 swidth=0 blks naming =version 2 bsize=4096 ascii-ci=0 ftype=1 log =internal bsize=4096 blocks=4479, version=2 = sectsz=512 sunit=0 blks, lazy-count=1 realtime =none extsz=4096 blocks=0, rtextents=0 data blocks changed from 9174016 to 140244992
[root@harbor ~]# df -hT Filesystem Type Size Used Avail Use% Mounted on devtmpfs devtmpfs 3.8G 0 3.8G 0% /dev tmpfs tmpfs 3.9G 0 3.9G 0% /dev/shm tmpfs tmpfs 3.9G 11M 3.8G 1% /run tmpfs tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup /dev/mapper/centos-root xfs 535G 1.5G 534G 1% / /dev/vda1 xfs 1014M 171M 844M 17% /boot tmpfs tmpfs 779M 0 779M 0% /run/user/0

浙公网安备 33010602011771号