Current size of the disk
-rw------- 1 root root 18G Jan 27 16:43 rac4.vdiThe size of disk seen by the OS using this virutal disk
Disk /dev/sda: 21.4 GB, 21474836480 bytes 255 heads, 63 sectors/track, 2610 cylinders Units = cylinders of 16065 * 512 = 8225280 bytesSize of the partitions
Filesystem Size Used Avail Use% Mounted on /dev/sda3 16G 13G 1.8G 88% / /dev/sda1 99M 12M 83M 13% /boot tmpfs 1006M 0 1006M 0% /dev/shmIncrease the size with modifyhd option
VBoxManage modifyhd rac4.vdi --resize 40960 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%Physical size is unaffected. This will grow as the space is used.
-rw------- 1 root root 18G Jan 27 16:45 rac4.vdiBut the size of the disk seen by the OS has changed
Disk /dev/sda: 42.9 GB, 42949672960 bytes 255 heads, 63 sectors/track, 5221 cylinders Units = cylinders of 16065 * 512 = 8225280 bytesThe additional space is unallocated and linux partitions are not affected after this increase.
Filesystem Size Used Avail Use% Mounted on /dev/sda3 16G 13G 1.8G 88% / /dev/sda1 99M 12M 83M 13% /boot tmpfs 1006M 0 1006M 0% /dev/shmUsing the Gnome Partition Editor (GParted) it is possible to resize the linux partition and allocate the unused space to it effectively increasing the size of it.
Download the Live CD iso of gparted and boot the virtual box server from it.
Select the default option and complete the startup.
GParted shows the size of current partitions (15.9 GB) and the unallocated space (20 GB).
Right click on the partition to resize and select resize/move item from the popup menu.
Resize the partition by either dragging the highlighted box or adjusting the numerical spinners.
Click apply to complete the resizing.
Restart the virtual server and see the size of linux partition changed.
Filesystem Size Used Avail Use% Mounted on /dev/sda3 35G 13G 21G 39% / /dev/sda1 99M 12M 83M 13% /boot tmpfs 1006M 0 1006M 0% /dev/shmSize of the new partition is 35 GB (15 GB previously allocated and 20 GB added with GParted).