Sunday, March 13, 2011

Adding a disk to VMWare Centos

First add the disk from the VMWare server manager
  1. From the VMWare Server select the VM.
  2. Choose "Add Hardware"
  3. Create a new virtual disk.
  4. Choose the capacity for the example 20GB.
  5. Finish off
Next to get the Linux guest to recognize the disk. Assuming you already have one physical volume mounted using LVM the new disk should be /dev/sdb NB I had to reboot before the new disk was recognised. I wanted to add the new drive as an extra block of contiguous space.
  1. fdisk /dev/sdb
  2. n
  3. primary partition
  4. 1
  5. accept the defaults for first and last cylinders 
  6. w
Add the disk to the LVM Volume. The current disk is 20GB and I am adding an additional 20GB
  1. vgextend VolGroup00 /dev/sdb1
  2. lvextend -l 40GB /dev/VolGroup00/LogVol00
  3. resize2fs /dev/VolGroup00/LogVol00