Today, when I tried to pull a pandoc docker image, I got the following error. Simply, I ran out of the disk.
But my harddrive still have more than 100G space left. So what’s the problem.
The reason is that docker toolbox is actually running in a linux VM hosted by virtual box. The default disk size of the VM is 20G.
Increase Virtualbox vdisk
So things become clear, I need to increase the VM disk size. So that I stopped my VM and run the following command to get a bigger VM disk.
cd C:\Users\dengy\.docker\machine\machines\default\
set path=C:\Program Files\Oracle\VirtualBox;%path%
vboxmanage clonehd “disk.vmdk” “virtualdisk.vdi” –format vdi
vboxmanage modifyhd “virtualdisk.vdi” –resize 65536
Then replace the old disk with the new one.
Re-partition the disk in linux
So far so good, but it didn’t work. I restarted the machine, still lack of space.
Now, the “physical” disk has been increased, but the partition in linux system is still the old size. Follow this blog to re-partition the disk.
You will get permission denied, that’s ok, restart the vm and run sudo resize2fs /dev/sda1
then you will get your disk size correct.
You are done!