VMware Cloud Community
jonas1701e
Contributor
Contributor

Increased VM hard drive but still the same size

Hi

On ESXi 6.7.0 Update 3 (Build 16773714) I had a Debian 9 64but VM with a single 200Go harddrive.

From the ESXi web browser interface I could upgrade the size of the VM to 400 Go

However when I boot the VM there is no change on the VM: If I run a 'df' command I still see that /dev/sda1 is still 200 Go wide.

(there is no /dev/sda2 either)

What should I do please?

thanks

 

0 Kudos
6 Replies
a_p_
Leadership
Leadership

Resizing is a two steps procedure. The first step is to resize the virtual disk, and the second step is to resize the guest OS partition(s) as needed from within the guest OS using either guest OS utilities, or 3rd party tools.

André

0 Kudos
Tibmeister
Expert
Expert

Most OS's do not automatically grow the partition.  You will need to manually do that.  There is several ways of doing this in the VM while running, each depending on the OS itself, and wither you have LVM or not.  That you will need to use Google-Fu on for your specific OS and partition/disk layout config.  If it's LVM, it's able to do online but has several specific steps.

If you can take the outage, you can download GParted ISO and boot the VM into that to grow the partition to the new disk size.  This is by far the easiest and safest as it does several checks before doing anything.

0 Kudos
jonas1701e
Contributor
Contributor

Thanks

if I log in ssh to the increased VM and run cfdisk I can read that the whole disk is now 400G instead of the former 200 G BUT the new 200 Go are in a FREE SIZE

 

Disque : /dev/sda
Taille : 400 GiB, 429496729600 octets, 838860800 secteurs
Étiquette : dos, identifiant : 0xa2469178

Périphérique Amorçage Début Fin Secteurs Taille Id Type
>> /dev/sda1 * 2048 415238143 415236096 198G 83 Linux
/dev/sda2 415240190 419428351 4188162 2G 5 Étendue
└─/dev/sda5 415240192 419428351 4188160 2G 82 partition d'échange Linux / Solaris
FREE SPACE 419428352 838860799 419432448 200G

I read that I need to switch sda1 type from LINUX to LVM LINUX and only after I could add the free extra 200G to sda1

The question is : will this change of type destroy all the data on sda1 ??

 

thanks

 

 

 

0 Kudos
Tibmeister
Expert
Expert

I don't even know that you can switch to LVM from non-LVM partition layout.  Since you can see the freespace, that's good, but you still need to grow the partition, which isn't the simplest at times.  I still say, use gParted, it's the safest way to expand that partition to fill the space.

0 Kudos
jonas1701e
Contributor
Contributor

Thanks but where should  I install gParted please? on the VM itsellf ? on the ESXi shell ?

0 Kudos
a_p_
Leadership
Leadership

gParted can be downloaded as a Live-CD (ISO image), from which you can then boot the VM.

André

0 Kudos