OK so doing -L and xxfs_growfs has worked.
VM had ol-root 6GB free
Code for the actual VM, step by step:
Adding 16GB to new HDD in vSphere
# fdisk -l
Disk /dev/sda: 59.1 GB, 59055800320 bytes, 115343360 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: dos
Disk identifier: 0x000cbfb1
Device Boot Start End Blocks Id System
/dev/sda1 * 2048 2099199 1048576 83 Linux
/dev/sda2 2099200 33554431 15727616 8e Linux LVM
/dev/sda3 33554432 94371839 30408704 8e Linux LVM
/dev/sda4 94371840 115343359 10485760 8e Linux LVM
Disk /dev/sdb: 17.2 GB, 17179869184 bytes, 33554432 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/ol-root: 49.4 GB, 49379540992 bytes, 96444416 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/ol-swap: 8589 MB, 8589934592 bytes, 16777216 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
# ls /sys/class/scsi_device
1:0:0:0 2:0:0:0 2:0:1:0
# echo 1 > /sys/class/scsi_device/1\:0\:0\:0/device/rescan
# echo 1 > /sys/class/scsi_device/2\:0\:0\:0/device/rescan
# echo 1 > /sys/class/scsi_device/2\:0\:1\:0/device/rescan
fdisk /dev/sdb,
n, p, 1, t, 1, 8e, w
# fdisk -l
Disk /dev/sda: 59.1 GB, 59055800320 bytes, 115343360 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: dos
Disk identifier: 0x000cbfb1
Device Boot Start End Blocks Id System
/dev/sda1 * 2048 2099199 1048576 83 Linux
/dev/sda2 2099200 33554431 15727616 8e Linux LVM
/dev/sda3 33554432 94371839 30408704 8e Linux LVM
/dev/sda4 94371840 115343359 10485760 8e Linux LVM
Disk /dev/sdb: 17.2 GB, 17179869184 bytes, 33554432 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: dos
Disk identifier: 0x86979f60
Device Boot Start End Blocks Id System
/dev/sdb1 2048 33554431 16776192 8e Linux LVM
Disk /dev/mapper/ol-root: 49.4 GB, 49379540992 bytes, 96444416 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/ol-swap: 8589 MB, 8589934592 bytes, 16777216 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
Partprobe
# partprobe -s
/dev/sda: msdos partitions 1 2 3 4
/dev/sdb: msdos partitions 1
pvcreate
# pvcreate /dev/sdb1
Physical volume "/dev/sdb1" successfully created.
vgextend
# vgextend ol /dev/sdb1
Volume group "ol" successfully extended
pvscan
# pvscan
PV /dev/sda2 VG ol lvm2 [<15.00 GiB / 0 free]
PV /dev/sda3 VG ol lvm2 [<29.00 GiB / 0 free]
PV /dev/sda4 VG ol lvm2 [<10.00 GiB / 0 free]
PV /dev/sdb1 VG ol lvm2 [<16.00 GiB / <16.00 GiB free]
Total: 4 [69.98 GiB] / in use: 4 [69.98 GiB] / in no VG: 0 [0 ]
lvextend
# lvextend -L+16380M /dev/mapper/ol-root /dev/sdb1
Size of logical volume ol/root changed from <45.99 GiB (11773 extents) to 61.98 GiB (15868 extents).
Logical volume ol/root successfully resized.
xfs_growfs
# xfs_growfs /
meta-data=/dev/mapper/ol-root isize=256 agcount=14, agsize=877824 blks
= sectsz=512 attr=2, projid32bit=1
= crc=0 finobt=0 spinodes=0 rmapbt=0
= reflink=0
data = bsize=4096 blocks=12055552, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0 ftype=1
log =internal bsize=4096 blocks=2560, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
data blocks changed from 12055552 to 16248832
# df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 4.8G 0 4.8G 0% /dev
tmpfs 4.8G 0 4.8G 0% /dev/shm
tmpfs 4.8G 9.4M 4.8G 1% /run
tmpfs 4.8G 0 4.8G 0% /sys/fs/cgroup
/dev/mapper/ol-root 62G 42G 21G 68% /
/dev/sda1 1014M 419M 596M 42% /boot
tmpfs 973M 12K 973M 1% /run/user/42
tmpfs 973M 0 973M 0% /run/user/0
I followed this: https://ma.ttias.be/increase-expand-xfs-filesystem-in-red-hat-rhel-7-cento7/
Why would it work before but not now ?
lvextend -L+10GB /dev/mapper/ol-root
(for example) to add 10GB to the LVxfs_growfs
state that argument is mount point. (e.g.xfs_growfs /
)