大网数据广告活动
服务器运维问答

xfs_growfs: is not a mounted xfs filesystem when trying to extend XFS partition on LVM

· 52CE 我爱测

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 pvcr…

问题原文

原帖链接 · David Janes · CC BY-SA 4.0

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?

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

社区高分解答

原帖链接 · Jason Richling · CC BY-SA 4.0

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

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2019-06-21)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。