cancel
Showing results for 
Search instead for 
Did you mean: 
TudorRaduta
Community Manager
Community Manager
  • 337 Views

RHCSA Practice: Extending an LVM Volume

Friday Challenge: Let's Resize a Live Filesystem!

Happy Friday, everyone!

Let's wrap up the study week with a practical, hands-on scenario. This is a task you will absolutely have to perform as a sysadmin and a key skill for the RHCSA exam: extending a logical volume that's running low on space.

The Scenario:

You've received an alert that a server is running out of disk space. Here are the details:

  • An existing logical volume, /dev/vg_apps/lv_data, is mounted on /srv/appdata.
  • The LV is currently 10GB and needs to be extended to 15GB.
  • You've already confirmed the volume group vg_apps has plenty of free space.
  • The filesystem is XFS.
  • The change must be done **online**, without unmounting the filesystem.

How would you solve it?

What are the commands you would use to safely extend both the logical volume and the XFS filesystem? Let's see your step-by-step process!

  • Bonus Question: What command would you use to resize the filesystem if it was ext4 instead of XFS?

Drop your solutions in the comments. Have a fantastic weekend!

0 Kudos
6 Replies
  • 251 Views

Below is the command need to be fired:

lvextend -L +5G /dev/mapper/vg_apps-lv_data

xfs_growfs /dev/mapper/vg_apps-lv_data

 

Thats it now verify with df -Th space will be increased from 10G to 15G online. No unmounting is required.

TudorRaduta
Community Manager
Community Manager
  • 178 Views

@Debasis_roy77  awesome, that's a solid and correct solution. Thanks for sharing!

You've laid out the classic two-step process perfectly: resize the LV, then resize the filesystem. It's safe and it works every time.

For everyone following along, have you ever seen a way to combine those two steps into a single, time-saving command? It's a useful flag to know.

You nailed the XFS part. Let's dig a little deeper on that second step: Why do we need a specific command like xfs_growfs at all? What does that tell us about what we'd need to do for a different filesystem, like ext4?

Great stuff for getting the ball rolling on this. Let's see what everyone else thinks!

0 Kudos
Ben
Cadet
Cadet
  • 82 Views

For ext4, to resize mountpoint of extend LV, it would be fsadm -l resize /dev/mapper/vg_apps-lv_data instead of xfs_growfs, other wise ext4 can be done using  lvextend -L  -r +5G /dev/mapper/vg_apps-lv_data

 

Chetan_Tiwary_
Community Manager
Community Manager
  • 68 Views

fsadm will be a new thing to learn for many learners : 

https://man7.org/linux/man-pages/man8/fsadm.8.html 

0 Kudos
Ben
Cadet
Cadet
  • 89 Views

lvextend -L  -r +5G /dev/mapper/vg_apps-lv_data

Chetan_Tiwary_
Community Manager
Community Manager
  • 68 Views

@Ben spot on ! from the lvextend man page : 

-r, --resizefs
     Resize underlying filesystem together with the logical volume using
0 Kudos
Join the discussion
You must log in to join this conversation.