ONTAP Discussions

Expand LVM Disk with Ontap Backed LUNs

darraghos
3,846 Views

We are running RHEL 7 on HP ProLiant hardware with LVM. Currently, we are testing the use of LVM with disk groups (for performance) but a question arose about using a single LUN with an LVM disk group namely:

 

  • With a single LUN in a single logical volume in a single LVM disk group can we extend the LUN online and then run commands in RHEL to extend the partition, logical volume and then filesystem?

We have been told by our storage team the only way to do this is add another LUN in ONTAP9, present back to the RHEL server and add it to the LVM disk group then extend the filesystem. This seems odd to me as on our RHEL VMs we using LVM and can do this on the fly using by expanding the .vmdk then fdisk, lvextend and XFS_Grow. Is vmware tools doing some magic here that a physical server cannot do ?

 

Note: we know one disk in a LVM group does not really give any specific benefit but we have a specific scenario that might require this. 

1 ACCEPTED SOLUTION

MileChen
3,701 Views

Some steps need to scan, identify and adjust the current disk, partition, LVM configuration and file system, so it's more dangerous.

@darraghos 


#The following are the approximate steps for reference.

Check LVM configuration and disk partitioning.
Increase the size of the volume on storage.(if needed)
Increase the size of the LUN on storage.
Rescan the LUN(disk) on physical server.
Check the size of lun(disk).
Modify the partition table.(if using disk partition as pv)
Reboot or partprobe to read the new partition table.(if using disk partition as pv)
Resize the pv using pvresize command.
Check the pv using pvs or pvdisplay command.
Check the free space on vg using vgs or vgdisplay.
Extend the lv using lvextend command.
Resize the file system online.(resize2fs or xfs_grow)

View solution in original post

4 REPLIES 4

darraghos
3,769 Views

Anyone?

MileChen
3,756 Views

The method is feasible, but some steps need to modify the existing disk device, some of them are relatively more risky.

It is important that you backup your data before you attempt to change size of disk or partition.

darraghos
3,739 Views

Thanks @MileChen. We do this on windows all the time (no LVM obviously) and use diskpart to extend the primary partition. What makes this so risky on Linux? In VMware we do this with gparted all the time. 

MileChen
3,702 Views

Some steps need to scan, identify and adjust the current disk, partition, LVM configuration and file system, so it's more dangerous.

@darraghos 


#The following are the approximate steps for reference.

Check LVM configuration and disk partitioning.
Increase the size of the volume on storage.(if needed)
Increase the size of the LUN on storage.
Rescan the LUN(disk) on physical server.
Check the size of lun(disk).
Modify the partition table.(if using disk partition as pv)
Reboot or partprobe to read the new partition table.(if using disk partition as pv)
Resize the pv using pvresize command.
Check the pv using pvs or pvdisplay command.
Check the free space on vg using vgs or vgdisplay.
Extend the lv using lvextend command.
Resize the file system online.(resize2fs or xfs_grow)

Public