操作步骤
fdisk -l
pvcreate /dev/sdb
pvdisplay 记录VG Name
vgextend centos_{} /dev/sdb
lvextend -l +100%FREE /dev/mapper/centos_{}-home
xfs_growfs /dev/mapper/centos_{}-home
操作示例
[root@node12234 ~]
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/centos-root 54G 1.5G 53G 3% /
devtmpfs 34G 0 34G 0% /dev
tmpfs 34G 0 34G 0% /dev/shm
tmpfs 34G 8.9M 34G 1% /run
tmpfs 34G 0 34G 0% /sys/fs/cgroup
/dev/sda2 1.1G 152M 912M 15% /boot
/dev/mapper/centos-home 2.2T 1.9T 262G 88% /home
tmpfs 6.8G 0 6.8G 0% /run/user/0
[root@node12234 ~]
WARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own discretion.
Disk /dev/sda: 2199.0 GB, 2199023255552 bytes, 4294967296 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
Disk label type: gpt
Disk identifier: B09BCD38-7131-4441-9A50-B522492FAE7B
1 2048 4095 1M BIOS boot
2 4096 2101247 1G Microsoft basic
3 2101248 4294965247 2T Linux LVM
Disk /dev/sdb: 10995.1 GB, 10995116277760 bytes, 21474836480 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
Disk /dev/mapper/centos-root: 53.7 GB, 53687091200 bytes, 104857600 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
Disk /dev/mapper/centos-swap: 33.8 GB, 33822867456 bytes, 66060288 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
Disk /dev/mapper/centos-home: 2110.4 GB, 2110431166464 bytes, 4121935872 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
[root@node12234 ~]
Physical volume "/dev/sdb" successfully created.
[root@node12234 ~]
--- Physical volume ---
PV Name /dev/sda3
VG Name centos
PV Size <2.00 TiB / not usable 0
Allocatable yes
PE Size 4.00 MiB
Total PE 524031
Free PE 1
Allocated PE 524030
PV UUID LvOdeq-j1np-2Ze6-6yMG-THAh-ivkj-tC12AW
"/dev/sdb" is a new physical volume of "10.00 TiB"
--- NEW Physical volume ---
PV Name /dev/sdb
VG Name
PV Size 10.00 TiB
Allocatable NO
PE Size 0
Total PE 0
Free PE 0
Allocated PE 0
PV UUID s22EJr-PL3M-qeWc-ltfj-1uCe-b210-tkwkcV
[root@node12234 ~]
Volume group "centos" successfully extended
[root@node12234 ~]
Size of logical volume centos/home changed from <1.92 TiB (503166 extents) to <11.92 TiB (3124606 extents).
Logical volume centos/home successfully resized.
[root@node12234 ~]
meta-data=/dev/mapper/centos-home isize=512 agcount=4, agsize=128810496 blks
= sectsz=512 attr=2, projid32bit=1
= crc=1 finobt=0 spinodes=0
data = bsize=4096 blocks=515241984, imaxpct=5
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0 ftype=1
log =internal bsize=4096 blocks=251583, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
data blocks changed from 515241984 to 3199596544
[root@node12234 ~]
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/centos-root 54G 1.5G 53G 3% /
devtmpfs 34G 0 34G 0% /dev
tmpfs 34G 0 34G 0% /dev/shm
tmpfs 34G 8.9M 34G 1% /run
tmpfs 34G 0 34G 0% /sys/fs/cgroup
/dev/sda2 1.1G 152M 912M 15% /boot
/dev/mapper/centos-home 14T 1.9T 12T 15% /home
tmpfs 6.8G 0 6.8G 0% /run/user/0
[root@node12234 ~]