Address: http://blog.csdn.net/ariesjzj/article/details/7269784
If there is insufficient disk space in the guest system in virtualbox, the most convenient way is to increase the existing hard disk. Many methods can be found on the Internet to expand the hard disk capacity when guest is windows, but it is slightly different when guest is Linux. In fact, there are more than one method. The following uses the adjustment tool provided by virtualbox as an example.
Step 1:
For example, if the VDI of the guest system is debian_work.vdi, the original size is 10 Gb. To expand it to 20 GB, run it in the virtualbox installation path:
Vboxmanage modifyhd debian_work.vdi -- resize 20000
Note:
1. Only dynamic extensions selected when VDI is created are valid.
2. The resize parameter is measured in MB and can only be larger than the original space.
3. In practice, you may need to add a path to VDI.
This is a description in the official document:
"The -- resize option allows you to expand the capacity of an existing image; this increasesLogicalSize of a virtual disk without affecting the physical size much. [32] This
Currently works only for the VDI and vhd formats, and only for the dynamically expanding variants. for example, if you originally created a 10g disk which is now full, you can use the -- resize command to add more space to the virtual disk without having
Create a new image and copy all data from within a virtual machine ."
Step 2:
If Step 1 is successful, the virtual size of the vdi file is 20 GB on the virtualbox management interface, but the actual size is less than 10 Gb. Run the command in the guest system (Linux ).
# Fdisk-l
You will find that there is no space allocated in/dev/SDA.
# Fdisk/dev/SDA
For allocation, input in sequence according to instructions
N (new), P (primary partition), x (number, representing/dev/sdax), the start position is generally the default, and the last W is saved and exited.
Step 3:
After restart, you can see the new partition (such as/dev/sda3), and then mount it to a directory (such as/workspace ). Run
# Blkid
Obtain the uuid of the new partition/dev/sda3, edit/etc/fstab, and add
UUID = xxxxxx/workspace ext3 errors = remount-ro 0 1
Enter the actual parameters as needed. After restart, you can access the expanded disk through/workspace.