Xfs_growfs: is not a mounted xfs filesystem when trying to grow ol-root

xfs

I have 25+ VM's running OL7.5. As they grow/get repurposed I sometimes need to add more HDD to them.

I have added space to ol-root and ol-swap many times before, following [in summary] :

fdisk to create partition
partprobe -s
pvcreate /dev/sdb1
vgextend ol /dev/sdb1
pvscan
lvextend /dev/mapper/ol-root /dev/sdb1

but on some VM's I can no longer add that ol-root space to the file system:

xfs_growfs /dev/mapper/ol-root
Error:   xfs_growfs: /dev/mapper/ol-root is not a mounted XFS filesystem

I have done this many many times before with no issue on the same VM's. On this VM I built from scratch and have added sda3 and sda4.

On this particular box I need to upgrade 11g to 18c. I need 10G ol-swap and more HDD to install the 18c database.

$ lsblk
NAME        MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sr0          11:0    1 1024M  0 rom
sda           8:0    0   55G  0 disk
├─sda4        8:4    0   10G  0 part
│ └─ol-root 252:0    0   46G  0 lvm  /
├─sda2        8:2    0   15G  0 part
│ ├─ol-swap 252:1    0    8G  0 lvm  [SWAP]
│ └─ol-root 252:0    0   46G  0 lvm  /
├─sda3        8:3    0   29G  0 part
│ ├─ol-swap 252:1    0    8G  0 lvm  [SWAP]
│ └─ol-root 252:0    0   46G  0 lvm  /
└─sda1        8:1    0    1G  0 part /boot


$ df -Th /dev/mapper/ol-root
Filesystem          Type  Size  Used Avail Use% Mounted on
/dev/mapper/ol-root xfs    46G   45G  1.5G  97% /

Any suggestions please?

Many thanks

Darren

p.s. The box im trying to expand is a clone of the VM above. After multiple attempts to grow the file system i killed the box. The source box shares the same issue with xfs_growfs even when i dont add an sdb partition. The xfs_growfs should return a much different error when there is no space to allocate.

Best Answer

You need to target the mount-point not the LVM mapper for the xfs_growfs command. This seems to be a new "feature" since we used to be able to xfs_growfs on the mapper.

But the man page specifically refers to mount-point:

xfs_growfs(8) System Manager's Manual xfs_growfs(8)

NAME xfs_growfs, xfs_info - expand an XFS filesystem

SYNOPSIS xfs_growfs [ -dilnrx ] [ -D size ] [ -e rtextsize ] [ -L size ] [ -m maxpct ] [ -t mtab ] [ -R size ] mount-point