VMware Cloud Community
Jjv
Enthusiast
Enthusiast
Jump to solution

Expand a VM HDD - ESXi 5.1.0

Hi Guys

I am running VMWare ESXi 5.1.0 with vSphere Client 5.1.0.

I have created a new VM running CentOS 6.5 with HDD capacity of 40 GB.

Now I would like to expand the HDD capacity of that VM from 40GB to 100GB. For that I have already shutdown the VM and edited the VM settings by increasing the HDD size from 40GB to 100GB. This HDD change is not reflected on the OS side.

What is the right procedure for me to follow to make it happen?

The output of command df- H from Centos VM have the following output:

[root@Pantelcent ~]# df -H

Filesystem                         Size  Used Avail Use% Mounted on

/dev/mapper/vg_pantelcent-lv_root   40G 5.6G   33G  15% /

tmpfs                              2.1G   78k 2.1G   1% /dev/shm

/dev/sda1                          508M   59M 424M  13% /boot

[root@Pantelcent ~]#


Looking forward to hearing some useful assistance form the community.


Regards

JJV

0 Kudos
1 Solution

Accepted Solutions
Jjv
Enthusiast
Enthusiast
Jump to solution

This issue has been resolved with the lvextend command and resize2fs command

lvextend -L<how much space you want the hdd to expand.Specify M for MB and G for GB> /followed by the logical volume path that you want to increase.

Ex: lvextend  -L100G  /dev/mapper/vg_pan-lv_root

After that I applied the following command to increase the file system size to match:

resize2fs /dev/mapper/vg_pan-lv_root

It did the trick for me

Thanks again for the recommendations.

View solution in original post

0 Kudos
4 Replies
DavoudTeimouri
Virtuoso
Virtuoso
Jump to solution

OSes can't detect the change, because you've added free space to the disk and it's un-partitioned.

So you should expand your partition in OS by using native tools or some tools like GParted (Live distribution for this purpose).

It's so simple in Windows Vista and above.

-------------------------------------------------------------------------------------
Davoud Teimouri - https://www.teimouri.net - Twitter: @davoud_teimouri Facebook: https://www.facebook.com/teimouri.net/
0 Kudos
EV_Simon
Enthusiast
Enthusiast
Jump to solution

Have a look for PartedMagic as that's what I used in the past (I believe it's gone pay to play now so try and find any older versions which should work for you).

0 Kudos
Jjv
Enthusiast
Enthusiast
Jump to solution

Thanks Davoud for your response.

Few more googling got me the right options and helped me to resolve my issue

0 Kudos
Jjv
Enthusiast
Enthusiast
Jump to solution

This issue has been resolved with the lvextend command and resize2fs command

lvextend -L<how much space you want the hdd to expand.Specify M for MB and G for GB> /followed by the logical volume path that you want to increase.

Ex: lvextend  -L100G  /dev/mapper/vg_pan-lv_root

After that I applied the following command to increase the file system size to match:

resize2fs /dev/mapper/vg_pan-lv_root

It did the trick for me

Thanks again for the recommendations.

0 Kudos