To extend a logical volume:
Note : These steps apply only to the EXT3 file system.
warning : VMware recommends a full backup of the virtual machine before these changes are performed.
- Shut down the virtual machine.
- Edit the virtual machine settings and expand the virtual disk size. For more information, see increasing Virtual disk size (1004047) (increasing the size of a virtual disk (1004047)).
- Start the virtual machine.
- Identify the device name, default to/DEV/SDA, and run the following command to confirm the new size:
- # fdisk-l
- To create a new primary partition:
-
- Run the following command:
# FDISK/DEV/SDA (depending on the result of step 4)
- Press p to print the partition table to determine the number of partitions. By default there are two: Sda1 and Sda2.
- Press N to create a new primary partition.
- Press p to get the primary partition information.
- Press 3 to get the partition number, depending on the partition table printout.
- Press two times to Enter.
- Press W to write the changes to the partition table.
- Restart the virtual machine.
- Run the command to verify that the changes have been saved to the partition table, and that the new partition type is 83:
# fdisk-l
- Run the command to convert the new partition to a physical volume:
# Pvcreate/dev/sda3
- Run the command to extend the physical volume:
# Vgextend Volgroup00/dev/sda3
Note : To determine which volume group to extend, use the command vgdisplay.
- Run the command to confirm the number of physical data areas available for the volume group:
# Vgdisplay VolGroup00 | grep "Free"
- Run the following command to extend the logical volume:
# lvextend-l+ #G/dev/volgroup00/logvol00
Where # is the amount of free space (in gigabytes) that can be provided based on the preceding command.
Note : To determine which logical volume to extend, use the command lvdisplay.
- Run the following command to extend the Ext3 file system online within the logical volume:
-
# ext2online/dev/volgroup00/logvol00
Note : If you are not a Red Hat virtual machine, use RESIZE2FS instead of ext2online.
- Run the following command to verify/filesystem if there is new free space:
- # Df-h/
Extending a logical volume in a virtual machine running Red Hat or Cent OS