Extending a logical volume online

Posted by & filed under Server Admin, VMWare.

I’ve written about this in past posts. Here is an updated article straight from VMWare: https://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1006371


  1. Power off the virtual machine.
  3. Power on the virtual machine.

    # fdisk -l

  5. Create a new primary partition:
    1. Run the command:


    3. Press n to create a new primary partition.
    4. Press p for primary.
    6. Press Enter two times.
    7. Press t to change the system’s partition ID.
    8. Press 3 to select the newly creation partition.
  6. Restart the virtual machine.

    # fdisk -l

  8. Run this command to convert the new partition to a physical volume:


    # pvcreate /dev/sda3

  9. Run this command to extend the physical volume:

    # vgextend VolGroup00 /dev/sda3



    # vgdisplay VolGroup00 | grep “Free”

  11. Run the following command to extend the Logical Volume:

    # lvextend -L+#G /dev/VolGroup00/LogVol00




    # ext2online /dev/VolGroup00/LogVol00


    • Use resize2fs instead of ext2online if it is not a Red Hat virtual machine.
    • By default, Red Hat and CentOS 7 use the XFS file system you can grow the file system by running the xfs_growfs command.

    # df -h /