Troubleshooting Resizing your devbox

From Koha Wiki
(Redirected from Resizing your devbox)
Jump to navigation Jump to search



Sometimes when cloning or rebasing files the operation fails due to lack of disk space in your devbox to write files in.

The following guide will explain how to increase the disk space, allowing you to continue working.

Find out how much space exists now

write in the command:

df -l


Increase the size of the virtual disk file


1. Shut down the virtual machine you are working in, 

vagrant halt


2. In VirtualBox right click on your VM and go to Settings->Storage.

Look what type of virtual disk file you are using, it is likely to be a vmdk file or a vdi file. If if is a vdi file ignore steps 3 and 5.


3. Because we cannot directly resize a vmdk file we must convert it to a vdi file first, to do this write in:

VBoxManage clonehd "vmdkfilename.vmdk" "vdifilename.vdi" --format vdi

Note: The filename needs to include the file path if you are not already in the vm directory inside VirtualBox VMs

e.g. VBoxManage clonehd "VirtualBox VMs/kohadevbox_jessie_1480447304841_9124/Box-disk1.vmdk" "VirtualBox VMs/kohadevbox_jessie_1480447304841_9124/resize.vdi" --format vdi


4. Now set the size you want the file to be (in GB):

VBoxManage modifyhd "vdifilename.vdi" --resize xxxxx

e.g. of setting the size to 19Gb

VBoxManage modifyhd "VirtualBox VMs/kohadevbox_jessie_1480447304841_9124/resize.vdi" --resize 19000


5. Now convert back to vmdk file format

VBoxManage clonehd "VirtualBox VMs/kohadevbox_jessie_1480447304841_9124/resize.vdi" "VirtualBox VMs/kohadevbox_jessie_1480447304841_9124/newbox1.vmdk" --format vmdk

NOTE: For this clone operation to work we will be creating a new vmdk file and so make sure you write a different name for the vdmk file.


6. In VirtualBox, select the controller your VM uses, select 'Adds hard disk'->'Choose existing disk'->appropriate vdi OR vmdk file you created/cloned


7. Remove the old vdi or vmdk file


8. Download GParted from http://gparted.org/download.php


9. In VirtualBox select "Adds optical drive"->"Choose existing disk"->GParted iso file


10. Start your vm

vagrant up


11. In Virtualbox select the 'Show' button


12. Follow the steps in this link which graphically shows how you can increase the size of the dev/sda1 directory using GParted

https://www.rootusers.com/use-gparted-to-increase-disk-size-of-a-linux-native-partition/


13. Remove the Gparted optical drive you added in VirtualBox before powering up vagrant