RHEL7 extend a LVM managed XFS File System

Most virtualization/linux administrators will have to continually expand certain virtual disks from time to time to increase free space.  Here is my simple step-by-step procedure to expand these volumes.  This process assumes that the volume you want to expand is contained within a LVM, and the file system used is XFS (New default file system for RHEL 7).

#SSM currently does not the +100%FREE option. So we use a combination of ssm and lvm commands.  System Storage Manager commands are available when you run the following command:

yum install system-storage-manager

Add new space to virtual machine drive.  If using VMWare, open vCenter and locate the desired hard drive. Expand the drive to size needed.

ssm list //list volumes, devices, pools…

partprobe //informs the operating system kernel of partition table changes, by requesting that the operating system re-read the partition table

pvdisplay  //find the physical device that you want to extend

pvresize <Device Path>

pvdisplay  //verify the pv has been extended, in my case I had increased it by 1 TB of space

LVM <LV Path> example = /dev/rhel_data_pool/rhel_data_volume

lvextend -L +100%FREE <LV Path>

lvdisplay

ssm list //verify ssm can now see volume size increase

#Now we extend the file system

xfs_info <LV Path>  //write down blocks
xfs_growfs <LV Path> // Grow XFS file system to the largest possible size
xfs_info <LV Path>  //verify block number increases

ssm list //verify FS size matches Volume size
df -h //verify FS size

Advertisements

About Parker Jardine

Manager of Systems Administration in the Information Technology Higher Education space. I enjoy biking, climbing, hockey, camping, mountaineering, hunting, paragliding, and just being outdoors. You can read my Make Magazine project articles about a diy solar panel and solar systems design in volumes 12 and 14.
This entry was posted in Linux, RHEL7. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s