Aumentar espacio SIN reiniciar máquina virtual

Aumentar espacio REINICIANDO máquina virtual

http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1006371

Caution: VMware recommends having a complete backup of the virtual machine prior making these changes.

Power off the virtual machine.

Edit the virtual machine settings and extend the virtual disk size. For more information, see Increasing the size of a virtual disk.

Power on the virtual machine. Identify the device name, which is by default /dev/sda, and confirm the new size by running the command:

  # fdisk -l

Create a new extended partition:

   cfdisk /dev/sdX
   Seleccionar el espacio libre y pulsan en Nueva.
   Pulsar en Tipo y seleccionar linux LVM --> 8E
   Para terminar pulsar Escribir.
   Reiniciar la maquina virtual.

Run this command to verify that the changes were saved to the partition table and that the new partition has an 8e type:

  # fdisk -l

Run this command to convert the new partition to a physical volume: Note: The number for the sda can change depending on system setup. Use the sda number that was created in step 5.

  # pvcreate /dev/sdaX

Run this command to extend the physical volume:

  # vgextend centos /dev/sdaX

¡Note: To determine which volume group to extend, use the command vgdisplay.

Run this command to verify how many physical extents are available to the Volume Group:

  # vgdisplay centos | grep "Free"

Run the following command to extend the Logical Volume:

  # lvextend -L+#G /dev/centos/root

Where # is the number of Free space in GB available as per the previous command. Use the full number output from Step 10 including any decimals. Note: to determine which logical volume to extend, use the command lvdisplay.

#resize2fs /dev/centos/root

Run the following command to verify that the / filesystem has the new space available:

  # df -h /