RHEL: Adding Disk Space

So your Disk is getting full or worse already full.

Here’s a step-by-step approach to troubleshoot and resolve this issue:

  1. First, verify the current state of your volume group: vgdisplay vc_name

This will show you the details of the ‘rhel’ volume group, including free space. Check the status of the new disk:

lsblk

Ensure that /dev/sdb (the path to the new disk) is visible and not already part of any volume group. Create a physical volume on the new disk:

pvcreate /dev/sdb

If you get the error: ‘Couldn’t create temporary archive name‘ when trying to extend the volume group, it might be due to lack of space in /etc or /var. Check the available space:

df -h /etc /var

If either of these directories is full, try clearing some space. For example, you can clear old log files:

sudo journalctl --vacuum-time=15d

This command will remove journal logs older than 15 days (adjust according to your needs). After clearing some space, try extending the volume group again:

vgextend vg_name /dev/sdb

If successful, verify the new space in the volume group:

vgdisplay vg_name

Now you can extend your logical volume. First, check the current logical volumes:

lvdisplay

Extend the desired logical volume (replace LV_PATH with the actual path):

lvextend -L +5G /dev/vg_name/LV_PATH

Finally, resize the filesystem. If it’s XFS:

xfs_growfs /mount_point

Replace /mount_point with the actual mount point of your filesystem.

Leave a Reply