VMware Cloud Community
amrsaeed
Contributor
Contributor
Jump to solution

Resizing Virtual Disk

I have virtual machine that is around 25GB. I increased the hard disk space of the VM to 60GB using VMware Vsphere client. I have Ubuntu 9.10 installed on the VM. From the VM when I type "fdisk -l" it still shows the primary partition set to 25GB. and one extended and sawp partition. I do not see the additional 35GB increase. Using the command "gparted" (graphical display) in VM instead of fdisk I can see the new unallocated partition of 35G. I then assigned the file system and formatted the new partition. NOW when I type "fdisk -l " I could see the new 35GB partition.

My question is that when the size of the VM is increased using Vmware Vsphere client how come using "fdisk -l" does not show the new unllocated partition. What command can be used inside the VM to see the new unallocated disk space? if I dont want to use the graphical command "gparted". Any tip would be nice.

0 Kudos
1 Solution

Accepted Solutions
Borja_Mari
Virtuoso
Virtuoso
Jump to solution

Hi,

you can use the parted utility that works in text mode, you must run "parted /dev/whatever"

Then inside parted to be able to see the free space run "print free"

(Another way more easy is to run "parted /dev/whatever print free")

Anyway after growing the partition is you run "fdisk -l" with just some calculations is easy to find the free space.

Just take special attention to the (total) number of the vdisk cylinders (start and end columns) and the size of the partitions (blocks column).

For example, you know the real vdisk size (at the top of the "fdisk -l" output). The total sum of the bytes blocks partitions less the vdisk size will be the free space. Easy, right? Smiley Wink

Hope this answer your doubt Smiley Happy

Regards/Saludos,

Pablo

Please consider awarding any helpful answer. Thanks!! - Por favor considera premiar las respuestas útiles. ¡¡Muchas gracias!!

Virtually noob blog

------------------------------------------------------------------------------------------------- PLEASE CONSIDER AWARDING any HELPFUL or CORRECT reply. Thanks!! Por favor CONSIDERA PREMIAR cualquier respuesta ÚTIL o CORRECTA . ¡¡Muchas gracias!! VCP3, VCP4, VCP5-DCV (VCP550), vExpert 2010, 2014 BLOG: http://communities.vmware.com/blogs/VirtuallyAnITNoob

View solution in original post

0 Kudos
4 Replies
jsbarber
Enthusiast
Enthusiast
Jump to solution

You could try these alternatives (assuming they're available in Ubuntu - I only know RH):

sfdisk

du -h

parted /dev/sda print (assuming sda is your disk).

JB

0 Kudos
AntonVZhbankov
Immortal
Immortal
Jump to solution

I suppose fdisk -l shows only existing partitions, so you have to run fdisk in interactive mode and see if there is unallocated space.


---

MCSA, MCTS, VCP, VMware vExpert '2009

http://blog.vadmin.ru

EMCCAe, HPE ASE, MCITP: SA+VA, VCP 3/4/5, VMware vExpert XO (14 stars)
VMUG Russia Leader
http://t.me/beerpanda
0 Kudos
Borja_Mari
Virtuoso
Virtuoso
Jump to solution

Hi,

you can use the parted utility that works in text mode, you must run "parted /dev/whatever"

Then inside parted to be able to see the free space run "print free"

(Another way more easy is to run "parted /dev/whatever print free")

Anyway after growing the partition is you run "fdisk -l" with just some calculations is easy to find the free space.

Just take special attention to the (total) number of the vdisk cylinders (start and end columns) and the size of the partitions (blocks column).

For example, you know the real vdisk size (at the top of the "fdisk -l" output). The total sum of the bytes blocks partitions less the vdisk size will be the free space. Easy, right? Smiley Wink

Hope this answer your doubt Smiley Happy

Regards/Saludos,

Pablo

Please consider awarding any helpful answer. Thanks!! - Por favor considera premiar las respuestas útiles. ¡¡Muchas gracias!!

Virtually noob blog

------------------------------------------------------------------------------------------------- PLEASE CONSIDER AWARDING any HELPFUL or CORRECT reply. Thanks!! Por favor CONSIDERA PREMIAR cualquier respuesta ÚTIL o CORRECTA . ¡¡Muchas gracias!! VCP3, VCP4, VCP5-DCV (VCP550), vExpert 2010, 2014 BLOG: http://communities.vmware.com/blogs/VirtuallyAnITNoob
0 Kudos
PaulSvirin
Expert
Expert
Jump to solution

To identify gaps in the partition allocations using fdisk get the disk size from the first "fdisk -l" outuput line and compare it to the greatest ending block number for the partitions in the list. WARNING:

*Partition table entries are not in disk order*

IMHO, not very convenient. Try parted et al. for your needs.

---

iSCSI SAN software

http://www.starwindsoftware.com

--- iSCSI SAN software http://www.starwindsoftware.com