Make Linux VirtualBox Guest use all Virtual Disk Available (no snapshots)

Using -modifyhd the storage on a vmdk was increased from 20 to 50GB. However the Centos client does not take advantage of it.

A prior question doubling virtual disk size does not change fdisk -l report does not address this directly because they had snapshots. As shown in screenshot no snapshots exist /are active in this case.

Here are details from guest-os

fdisk -l

[root@localhost ~]# fdisk -l

Disk /dev/sda: 56.3 GB, 56308531200 bytes
255 heads, 63 sectors/track, 6845 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000b625d

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          64      512000   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2              64        2611    20458496   8e  Linux LVM

Disk /dev/mapper/VolGroup-lv_root: 14.6 GB, 14638120960 bytes
255 heads, 63 sectors/track, 1779 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/mapper/VolGroup-lv_root doesn't contain a valid partition table

Disk /dev/mapper/VolGroup-lv_swap: 6308 MB, 6308233216 bytes
255 heads, 63 sectors/track, 766 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/mapper/VolGroup-lv_swap doesn't contain a valid partition table

pvdisplay

[root@localhost ~]# pvdisplay
  --- Physical volume ---
  PV Name               /dev/sda2
  VG Name               VolGroup
  PV Size               19.51 GiB / not usable 3.00 MiB
  Allocatable           yes (but full)
  PE Size               4.00 MiB
  Total PE              4994
  Free PE               0
  Allocated PE          4994
  PV UUID               68d5TH-51cq-VbiL-D0ki-Bz9E-BZj3-DqVNRd

df -k

[root@localhost ~]# df -k
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/mapper/VolGroup-lv_root
                      14070560  12795616    560192  96% /
tmpfs                  4168992        76   4168916   1% /dev/shm
/dev/sda1               495844     54226    416018  12% /boot
/dev/sr0                 58236     58236         0 100% /media/VBOXADDITIONS_4.2.16_86992

Mounts

[root@localhost ~]# mount
/dev/mapper/VolGroup-lv_root on / type ext4 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw)
/dev/sda1 on /boot type ext4 (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
/dev/sr0 on /media/VBOXADDITIONS_4.2.16_86992 type iso9660 (ro,nosuid,nodev,uhelper=udisks,uid=500,gid=500,iocharset=utf8,mode=0400,dmode=0500)

Device: disk by id

[root@localhost ~]# ll /dev/disk/by-id
total 0
drwxr-xr-x 6 root root 120 Sep 29 07:11 ..
drwxr-xr-x 2 root root 240 Sep 29 07:11 .
lrwxrwxrwx 1 root root  10 Sep 29 07:11 dm-uuid-LVM-ZNoRaHmQP5Q0vOttkofYrMdrBe1ouy9gT5SiHgxSwJJcKcK25RRTAERfIffUtgBe -> ../../dm-0
lrwxrwxrwx 1 root root  10 Sep 29 07:11 dm-name-VolGroup-lv_root -> ../../dm-0
lrwxrwxrwx 1 root root  10 Sep 29 07:11 dm-uuid-LVM-ZNoRaHmQP5Q0vOttkofYrMdrBe1ouy9gO5Nd7kMVEqxxpnSc455XW5SGmOQeoaEZ -> ../../dm-1
lrwxrwxrwx 1 root root  10 Sep 29 07:11 dm-name-VolGroup-lv_swap -> ../../dm-1
lrwxrwxrwx 1 root root   9 Sep 29 07:11 scsi-SATA_VBOX_HARDDISK_VB34dd657d-2336283c -> ../../sda
lrwxrwxrwx 1 root root   9 Sep 29 07:11 ata-VBOX_HARDDISK_VB34dd657d-2336283c -> ../../sda
lrwxrwxrwx 1 root root  10 Sep 29 07:11 scsi-SATA_VBOX_HARDDISK_VB34dd657d-2336283c-part2 -> ../../sda2
lrwxrwxrwx 1 root root  10 Sep 29 07:11 ata-VBOX_HARDDISK_VB34dd657d-2336283c-part2 -> ../../sda2
lrwxrwxrwx 1 root root  10 Sep 29 07:11 scsi-SATA_VBOX_HARDDISK_VB34dd657d-2336283c-part1 -> ../../sda1
lrwxrwxrwx 1 root root  10 Sep 29 07:11 ata-VBOX_HARDDISK_VB34dd657d-2336283c-part1 -> ../../sda1

VBox storage details

Evidence that NO snapshots exist for this vmdk


You will have to resize the partitions from within the VM. You should use a live distro on a usb stick to do that, just like the VM were a physical machine. Put the stick in, start the VM instructing it to boot from the stick, resize the partition. The fact that you are using LVM changes nothing in this plan.