Unable to extend disk size of /sysroot

Latest response

Hello All,

I have installed OCP 4.8 on vcenter with RHCOS version 48.84.202107202156-0.
The /sysroot partition on the default RHCOS ova image is 16G only, which fills up pretty quickly and leaves the nodes in Not Ready state. So i wanted to increase the disk size.

I increased the disk size from vCenter, but when i try to increase it on the OS, it does not take effect. Can anyone please tell what is the issue?

lsblk shows that extended disk size to be 60G

[root@master-1 core]# lsblk
NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda      8:0    0   60G  0 disk
|-sda1   8:1    0    1M  0 part
|-sda2   8:2    0  127M  0 part
|-sda3   8:3    0  384M  0 part /boot
`-sda4   8:4    0 15.5G  0 part /sysroot

Current sysroot size

[root@master-1 core]# df -hT /
Filesystem     Type  Size  Used Avail Use% Mounted on
/dev/sda4      xfs    16G  9.8G  5.8G  63% /
[root@master-1 core]# sudo xfs_growfs /sysroot/
meta-data=/dev/sda4              isize=512    agcount=20, agsize=208384 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=1        finobt=1, sparse=1, rmapbt=0
         =                       reflink=1
data     =                       bsize=4096   blocks=4062971, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0, ftype=1
log      =internal log           bsize=4096   blocks=2560, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0

After this also the size does not change

[root@master-1 core]# df -hT /
Filesystem     Type  Size  Used Avail Use% Mounted on
/dev/sda4      xfs    16G  9.8G  5.8G  63% /

Tried to run the command on the FS name as well

[root@master-1 core]# sudo xfs_growfs /dev/sda4
meta-data=/dev/sda4              isize=512    agcount=20, agsize=208384 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=1        finobt=1, sparse=1, rmapbt=0
         =                       reflink=1
data     =                       bsize=4096   blocks=4062971, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0, ftype=1
log      =internal log           bsize=4096   blocks=2560, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
[root@master-1 core]# df -hT /
Filesystem     Type  Size  Used Avail Use% Mounted on
/dev/sda4      xfs    16G  9.8G  5.8G  63% /

Responses

Can you try this as root

parted /dev/sda print free

Hello India Test, and welcome here.

It seems that you are in a rescue environment since you are dealing with /sysroot.

When you are not in a rescue environment, what is the actual file system you wish to grow?

Given the potential potentially dire nature of the issue you face, and you tagged this with Red Hat OpenShfit, I'd actually recommend you open a case directly with Red Hat. Read this Red Hat solution for general reference on growing a filesystem, but please open a case

Kind Regards,
RJ

The OS is RedHat CoreOS. I am not in rescue environment.

Hello India test,

Did you try sudo xfs_growfs /?

I guess sysroot is not the mount point, but the partition label.

xfs_growfs works on mount points.

The mount point is the directory in df -hT output, named in the column Mounted on.

Regards,

Jan Gerrit

When i try to extend the filesystem i get below error. To overcome this i had to change it and give it RW permissions

xfs_growfs: XFS_IOC_FSGROWFSDATA xfsctl failed: Read-only file system

These are the commands that i used to extend the /sysroot filesystem in RedHat CoreOS version 4.8

SOLUTION

sudo su
growpart /dev/sda 4
sudo su -
unshare --mount
mount -o remount,rw /sysroot
xfs_growfs /sysroot

thanks for sharing the solution

India Test, thanks for the additional updates. We're glad you got this resolved.

Regards,
RJ