step 1
Frist edit harddisk on ESXi or VCSA
setp 2
then login the Linux server, check “fdisk -l” command.
root@eve-ng:~# fdisk -l
Disk /dev/sdb: 800 GiB, 858993459200 bytes, 1677721600 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
if Disk /dev/sdx eq your set harddisk, please go to setp 3.
if disk not eq set harddisk, please use "partprobe /dev/sdx" command tell kernel re-read the harddisk.
root@eve-ng:~# partprobe /dev/sdb
root@eve-ng:~# fdisk -l
Disk /dev/sdb: 900 GiB, 966367641600 bytes, 1887436800 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
setp 3
Expansion PV
root@eve-ng:~# pvdisplay /dev/sdb
--- Physical volume ---
PV Name /dev/sdb
VG Name eve-ng-vg
PV Size <800.00 GiB / not usable 3.00 MiB
Allocatable yes (but full)
PE Size 4.00 MiB
Total PE 204799
Free PE 0
Allocated PE 204799
PV UUID KqNZmM-AvG0-68yt-WBXa-DMvO-jorh-nCUzyH
root@eve-ng:~# pvresize /dev/sdb
Physical volume "/dev/sdb" changed
1 physical volume(s) resized / 0 physical volume(s) not resized
root@eve-ng:~# pvdisplay /dev/sdb
--- Physical volume ---
PV Name /dev/sdb
VG Name eve-ng-vg
PV Size <900.00 GiB / not usable 3.00 MiB
Allocatable yes
PE Size 4.00 MiB
Total PE 230399
Free PE 25600
Allocated PE 204799
PV UUID KqNZmM-AvG0-68yt-WBXa-DMvO-jorh-nCUzyH
root@eve-ng:~#
step 4
Check VG
root@eve-ng:~# vgdisplay eve-ng-vg
--- Volume group ---
VG Name eve-ng-vg
System ID
Format lvm2
Metadata Areas 2
Metadata Sequence No 11
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 2
Open LV 2
Max PV 0
Cur PV 2
Act PV 2
VG Size 949.99 GiB
PE Size 4.00 MiB
Total PE 243198
Alloc PE / Size 217598 / 849.99 GiB
Free PE / Size 25600 / 100.00 GiB
VG UUID M1Jx3e-XvsF-HMDR-HOi5-9vur-FakF-GWfMMl
Setp 5
extend LV
root@eve-ng:~# lvextend -l +100%FREE /dev/eve-ng-vg/root
Size of logical volume eve-ng-vg/root changed from <849.04 GiB (217353 extents) to <949.04 GiB (242953 extents).
Logical volume eve-ng-vg/root successfully resized.
root@eve-ng:~# lvdisplay /dev/eve-ng-vg/root
--- Logical volume ---
LV Path /dev/eve-ng-vg/root
LV Name root
VG Name eve-ng-vg
LV UUID X7yq2F-TVJR-58Tw-mOt2-3RVi-CegE-4hZjZn
LV Write Access read/write
LV Creation host, time eve-ng, 2020-06-26 04:21:37 +0800
LV Status available
# open 1
LV Size <949.04 GiB
Current LE 242953
Segments 2
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:0
root@eve-ng:~#
Step 6
resize LV
root@eve-ng:~# df -h
Filesystem Size Used Avail Use% Mounted on
udev 63G 0 63G 0% /dev
tmpfs 13G 20M 13G 1% /run
/dev/mapper/eve--ng--vg-root 836G 801G 470M 100% /
tmpfs 63G 0 63G 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 63G 0 63G 0% /sys/fs/cgroup
overlay 836G 801G 470M 100% /var/lib/docker/overlay2/17794a2f84f5ddf30ed690cc8b0e50753b385c0d845fd60bf9fc5e3a3f037aeb/merged
tmpfs 13G 0 13G 0% /run/user/0
root@eve-ng:~# resize2fs /dev/eve-ng-vg/root
resize2fs 1.44.1 (24-Mar-2018)
Filesystem at /dev/eve-ng-vg/root is mounted on /; on-line resizing required
old_desc_blocks = 107, new_desc_blocks = 119
The filesystem on /dev/eve-ng-vg/root is now 248783872 (4k) blocks long.
root@eve-ng:~# df -h
Filesystem Size Used Avail Use% Mounted on
udev 63G 0 63G 0% /dev
tmpfs 13G 20M 13G 1% /run
/dev/mapper/eve--ng--vg-root 934G 801G 95G 90% /
tmpfs 63G 0 63G 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 63G 0 63G 0% /sys/fs/cgroup
overlay 934G 801G 95G 90% /var/lib/docker/overlay2/17794a2f84f5ddf30ed690cc8b0e50753b385c0d845fd60bf9fc5e3a3f037aeb/merged
tmpfs 13G 0 13G 0% /run/user/0
root@eve-ng:~#
Done