I'm running CentOS 6.1 as a guest in VirtualBox 4.1.18 on a Mac OS X (Snow Leopard) host. Since 50 GB for my CentOS guest proved to be insufficient, I resolved to double its available disk space. After extensively searching the internet for a viable course of action, I settled on the following:
- Double size of VDI file through "vboxmanage modifyhd centos6.1.vdi --resize 102400"
- Verify in VirtualBox GUI that disk size is now indeed 100 GB
- Download Parted Magic ISO file and boot VM into Parted Magic
- In Parted Magic, fire up Partition Editor
- In Partition Editor, see ~ 50 GB of "unallocated" space
- In Partition Editor, resize /dev/sda2 (managed by LVM in my case) to use up all unallocated space, effectively increasing its size by 50 GB
- Shut down VM
- Boot VM into CentOS 6.1 and use lvm tools to grow existing volumes.
However, I fail at step 5. Partition Editor shows /dev/sda's size to still be 50 GB, NOT 100 GB. There is no "unallocated" space I could use to grow /dev/sda2's size. This is consistent with the output of fdisk -l, run either in Parted Magic or CentOS:
[root@dev ~]# fdisk -l
Disk /dev/sda: 53.7 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 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: 0x0006702c
Device Boot Start End Blocks Id System
/dev/sda1 * 1 32 256000 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 32 6528 52171776 8e Linux LVM
In step 2 above, I verified that VirtualBox' GUI does indeed show my VM's virtual hard drive to be 100 GB in size. Could someone explain why neither fdisk
nor Parted Magic see those extra 50 GB?