Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

VMWare / CentOS 5.x

My CentOS VM system was running low on space so a VMWare admin increased the storage space allocated to the VM. After powering off the system and restarting it, the OS is still showing the same old amount of space.

Can someone please advise on what specific steps I need to complete in order to have CentOS 5 recognize the new space? It's my understanding that I'll likely need to run a partitioning tool in order to incorporate the new space.

If it's helpful, here is the output of fdisk -l:

Disk /dev/sda: 12.8 GB, 12884901888 bytes
255 heads, 63 sectors/track, 1566 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          16      128488+  83  Linux
/dev/sda2              17         277     2096482+  82  Linux swap / Solaris
/dev/sda3             278        1566    10353892+  83  Linux

Here's the contents of /etc/fstab:

LABEL=/                 /                       ext3    defaults        1 1
LABEL=/boot             /boot                   ext3    defaults        1 2
tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
LABEL=SWAP-sda2         swap                    swap    defaults        0 0

Here is the output of the pvs command:

[root@foo ~]# pvs
  /dev/hdc: open failed: No medium found

Here is the output of the pvscan command:

[root@foo ~]# pvscan
  No matching physical volumes found
share|improve this question
up vote 5 down vote accepted

Resizing a partition on Centos:

If you are using LVM, you will have to first pvresize to the desired size, then lvextend the LVs before resizing the partitions.

No need for vgresize, it's for adding PVs, not for resizing the volgroup.

share|improve this answer
How can I confirm if I'm using LVM? Would that show in the output of fdisk -l? – Mike B May 12 '12 at 17:23
from the output you've posted, it looks like /dev/sda is directly formatted, no LVM. to be extra sure, run pvs and see if you have any PVs set up – dyasny May 12 '12 at 17:27
Thanks. When I ran that command, I got an error (added to the description above). – Mike B May 12 '12 at 17:30
nothing related to /dev/sdX meaning you have no PVs set up. Actually, I can be wrong there, pvs is not the right command, better use pvscan. – dyasny May 12 '12 at 17:31
K. pvscan returns that no physical volumes are found. – Mike B May 12 '12 at 17:35

You're not using LVM.

A reboot will recognize the new space added to the disk from the VMWare side. You can also rescan the SCSI bus, but the reboot will work. Use fdisk -l to verify.

From there, it looks like you have everything in a single / partition. Your resizing options are either:

  • manually editing the partition table with fdisk and using resize2fs or...
  • Using parted.

Another option that I prefer for VMs, is examining the utilization on the filesystem (using du or ncdu) and adding mount points as needed. If most of your space is consumed by data in /var, why not make /var its own partition/filesystem? It's beyond the scope of this question, but something to think about.

share|improve this answer

Just thought I would add some actual terminal commands. I had the same scenario as in the original question. My VM was originally created with 10GB, and we increased that (in the VM) to 60GB. I then had to issue the following commands for the space to become available...

sudo pvresize --setphysicalvolumesize 60G /dev/sda2

sudo lvextend -L50G /dev/mapper/vg_vwebcpanel-lv_root

sudo resize2fs /dev/mapper/vg_vwebcpanel-lv_root
share|improve this answer

I followed this link and it worked great for me. Very well documented

share|improve this answer

There's an older post here including shrinking and resizing on the same disk to make space for more LV's all of which touches on the above.


share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.