Tuesday, December 29, 2009

How to resize a VMware Linux virtual disk?

On your host


resize the virtual device’s virtual disk (example for create 10GB disk).

command: vmware-vdiskmanager -x 10GB myvirtual.vmdk



On your virtual server


resize filesystem (example for default instalation of CentOS 5).

Check filesystem data

command: df -h




  1. Add a new partition

    command: fdisk /dev/sda



    (p - print the partition table; n - add a new partition; t - change a partition's system id, e.g. 8e Linux LVM; w - write table to disk and exit)

  2. Reboot

    command: reboot




  3. Create physical volume

    command: pvcreate /dev/sda3




  4. Extend volume group

    command: vgextend VolGroup00 /dev/sda3




  5. Extend logical volume

    command: lvextend -l +100%free /dev/VolGroup00/LogVol00 /dev/sda3




  6. Resize filesystem

    command: resize2fs /dev/VolGroup00/LogVol00





Check filesystem data

command: df -h

No comments:

Post a Comment