SAS18
Contributor
Contributor

Extending the VMDK partition.

Jump to solution

Hi,

Can anybody point me in the direction of official documentation for extending the partition of a VMDK?

I've found a lot of different methods, but was wondering if there's a supported or best practice method.

Thanks in advance,

Sam.

0 Kudos
1 Solution

Accepted Solutions
Bastien_P
Enthusiast
Enthusiast

Hi. I'm using gparted tool for all my extend needs and for now it never failed me. hope this help.

This procedure is part me and part link found on (praise this site Heart)

  • Shutdown the virtual machine you want to resize

  • Log into the ESX Server console via Putty

  • Change directory to the Virtual machine directory cd /vmfs/volumes/datastorename/vmservername

  • Type "vmkfstools -X vmservername.vmdk

  • New disk size can be specified in kilo, mega or gigabytes and will be the total size of the new disk. So if you want to increase a virtual disk from 20GB to 24GB you would specify either 24000m or 24g

  • Power on the Virtual Machine and make sure it boots properly, load Disk Management and you will see the new unallocated space

  • Now to join the unallocated space to the primary partition, first shutdown the Virtual Machine

  • Connect the Virtual Machine to the GpartEd ISO file and make sure you enable Connected at Power On (generaly on the vmimages datastore and under isotools directory)

  • Power on the Virtual Machine

  • Press ESC at the Bios screen to get to the Boot Menu

  • Select CD-ROM as the Boot device

  • Gnome Partition Editor will load, press Enter at the boot screen

  • Once the partition editor loads, click on /dev/sda1 in the partition list

  • Click the Resize/Move button

  • Click and drag the arrow to extend the size of the partition, make sure you do a resize (double arrow) and not a move (four way arrow) so you should 0 free space preceding and following and then click the Resize/Move button

  • Next click the Apply button and then the operation will start, you can expand Details to see the progress, once completed click the Close button

  • Click the power button in the bottom right corner, then select reboot

  • Edit the VM and remove the ISO from the CD/ROM device (change to Client)

  • When the server restarts it will do a Check Disk, let this complete, Windows will prompt for a reboot after you login

  • Reboot and load Disk Management and your Primary Partion will be the new size without any unallocated space

Remember: If you find this information useful, please award points for "correct" or "helpful".

View solution in original post

0 Kudos
4 Replies
dkfbp
Expert
Expert

Turn off the server

ssh to the server and CD to directory of VM

vmkfstools - X 100G vm_name.vmdk (100GigaByte is the new size of the vmdk - you are not adding 100G to the file)

If it is windows then use diskpart to make the new space available.

If you are running VC 2.5 and ESX 3.5 you can do it from Virtual Center. Just edit the VM.

Best regards Frank Brix Pedersen blog: http://www.vfrank.org
AWo
Immortal
Immortal

VI 3 Online Documentation, vmkfstools:

http://pubs.vmware.com/vi35/server_config/sc_cover.1.1.html#949594

Using vmkfstools

Option -X

AWo

vExpert 2009/10/11 [:o]===[o:] [: ]o=o[ :] = Save forests! rent firewood! =
0 Kudos
troberts
VMware Employee
VMware Employee

Adding Space to an ESX Server Virtual Disk

http://kb.vmware.com/kb/994

Bastien_P
Enthusiast
Enthusiast

Hi. I'm using gparted tool for all my extend needs and for now it never failed me. hope this help.

This procedure is part me and part link found on (praise this site Heart)

  • Shutdown the virtual machine you want to resize

  • Log into the ESX Server console via Putty

  • Change directory to the Virtual machine directory cd /vmfs/volumes/datastorename/vmservername

  • Type "vmkfstools -X vmservername.vmdk

  • New disk size can be specified in kilo, mega or gigabytes and will be the total size of the new disk. So if you want to increase a virtual disk from 20GB to 24GB you would specify either 24000m or 24g

  • Power on the Virtual Machine and make sure it boots properly, load Disk Management and you will see the new unallocated space

  • Now to join the unallocated space to the primary partition, first shutdown the Virtual Machine

  • Connect the Virtual Machine to the GpartEd ISO file and make sure you enable Connected at Power On (generaly on the vmimages datastore and under isotools directory)

  • Power on the Virtual Machine

  • Press ESC at the Bios screen to get to the Boot Menu

  • Select CD-ROM as the Boot device

  • Gnome Partition Editor will load, press Enter at the boot screen

  • Once the partition editor loads, click on /dev/sda1 in the partition list

  • Click the Resize/Move button

  • Click and drag the arrow to extend the size of the partition, make sure you do a resize (double arrow) and not a move (four way arrow) so you should 0 free space preceding and following and then click the Resize/Move button

  • Next click the Apply button and then the operation will start, you can expand Details to see the progress, once completed click the Close button

  • Click the power button in the bottom right corner, then select reboot

  • Edit the VM and remove the ISO from the CD/ROM device (change to Client)

  • When the server restarts it will do a Check Disk, let this complete, Windows will prompt for a reboot after you login

  • Reboot and load Disk Management and your Primary Partion will be the new size without any unallocated space

Remember: If you find this information useful, please award points for "correct" or "helpful".

View solution in original post

0 Kudos