Today I started getting errors on simple operations, like creating small files in vim
, the bash completion started to complain as well.
Here is the result of df -h
:
vagrant@machine:/vagrant$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 40G 38G 249M 100% /
none 4.0K 0 4.0K 0% /sys/fs/cgroup
udev 2.0G 12K 2.0G 1% /dev
tmpfs 396M 396K 395M 1% /run
none 5.0M 0 5.0M 0% /run/lock
none 2.0G 0 2.0G 0% /run/shm
none 100M 0 100M 0% /run/user
overflow 1.0M 148K 876K 15% /tmp
192.168.50.1:/Users/nha/repo/assets 233G 141G 93G 61% /var/www/assets
vagrant 233G 141G 93G 61% /vagrant
So apparently /
doesn`t have space anymore ? Isn't it weird since I have space in the other filesystems (or am I misreading something) ?
How do I get more space on my vm ?
Even though you have space on your Guest OS, the VM is limited.There are couple of steps required in order to increase the size of your disk:
first,
vagrant halt
to close your VMresize disk
start Virtual box and change configuration of the VM to associate the new disk
use fdisk to resize disk
you need to create a new partition with the new space and allocate it, so first start the VM and logged on as super user
the command (as illustrated from my instance) are
note you might need to change /dev/sda compare to your configuration
create a new partition (again logged on as super user
su -
)You can increase space in your box, without losing data or creating new partitions.
Halt your VM;
Go to
/home_dir/VirtualBox VMs
Change file format from
.vmdk
to.vdi
. Then use command from the answer above to increase space.Change the file extension back and change the file name.
Attach an extended disk to your VM.
In your VirtualBox application go to Your_VM -> Settings -> Storage. Click on the controller and choose 'add new disk' below. Choose from existing disks the one you have just expanded.
Here's a step by step instruction how to expand the space in your vagrant box or virtual machine.