How can I get CentOS 5 to recognize an increase in drive space on my VM?

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

Resizing a partition on Centos: http://www.centos.org/docs/5/html/5.2/Deployment_Guide/s2-disk-storage-parted-resize-part.html

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.


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.