Difference between revisions of "How to resize a VirtualBox VDI disk"

From Ittichai Chammavanijakul's Wiki
Jump to navigation Jump to search
(Created page with "How to resize a VirtualBox VDI disk 1. Backup the current disk. (Optional but highly recommended). <pre> $ cd ~/VirtualBox\ VMs/OL6 $ ls -al |grep OL6.vdi -rw------- 1 ichamm...")
 
 
(One intermediate revision by the same user not shown)
Line 7: Line 7:
 
$ ls -al |grep OL6.vdi
 
$ ls -al |grep OL6.vdi
 
-rw-------  1 ichamma1  1089479487  26034171904 May 16 09:18 OL6.vdi
 
-rw-------  1 ichamma1  1089479487  26034171904 May 16 09:18 OL6.vdi
</pre>
 
  
  
 
$ VBoxManage clonehd OL6.vdi OL6_cloned.vdi
 
$ VBoxManage clonehd OL6.vdi OL6_cloned.vdi
 +
 
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
 
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
 
Clone hard disk created in format 'VDI'. UUID: c0ee892e-add5-4c6f-8deb-1a7c04d2a2ae
 
Clone hard disk created in format 'VDI'. UUID: c0ee892e-add5-4c6f-8deb-1a7c04d2a2ae
</pre>
 
  
ICHAMMA1-04M:OL6 ichamma1$ VBoxManage modifyhd OL6.vdi --resize 61440
+
 
 +
# http://www.virtualbox.org/manual/ch08.html#vboxmanage-modifyvdi
 +
# $ VBoxManage modifyhd <path to your vdi> --resize <new size in megabytes>
 +
 
 +
$ VBoxManage modifyhd OL6.vdi --resize 61440
 
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
 
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
  
 +
</pre>
  
 
After you’ve physically resized your drive, both VirtualBox and your OS should know about the changes.
 
After you’ve physically resized your drive, both VirtualBox and your OS should know about the changes.
  
 
+
<pre>
 
[oracle@ol6 ~]$ df -k
 
[oracle@ol6 ~]$ df -k
 
Filesystem          1K-blocks      Used Available Use% Mounted on
 
Filesystem          1K-blocks      Used Available Use% Mounted on
 
/dev/mapper/vg_ol6-lv_root
 
/dev/mapper/vg_ol6-lv_root
 
                       25907508  20923632  3667832  86% /
 
                       25907508  20923632  3667832  86% /
                     
+
</pre>
 
                        
 
                        
 
If your VM OS is Windows, you may have to run the Disk Management too to refresh the disk size.
 
If your VM OS is Windows, you may have to run the Disk Management too to refresh the disk size.

Latest revision as of 15:55, 9 October 2013

How to resize a VirtualBox VDI disk

1. Backup the current disk. (Optional but highly recommended).

$ cd ~/VirtualBox\ VMs/OL6
$ ls -al |grep OL6.vdi
-rw-------   1 ichamma1  1089479487  26034171904 May 16 09:18 OL6.vdi


$ VBoxManage clonehd OL6.vdi OL6_cloned.vdi

0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Clone hard disk created in format 'VDI'. UUID: c0ee892e-add5-4c6f-8deb-1a7c04d2a2ae


# http://www.virtualbox.org/manual/ch08.html#vboxmanage-modifyvdi
# $ VBoxManage modifyhd <path to your vdi> --resize <new size in megabytes>

$ VBoxManage modifyhd OL6.vdi --resize 61440
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%

After you’ve physically resized your drive, both VirtualBox and your OS should know about the changes.

[oracle@ol6 ~]$ df -k
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/mapper/vg_ol6-lv_root
                      25907508  20923632   3667832  86% /

If your VM OS is Windows, you may have to run the Disk Management too to refresh the disk size.

References: