昨天,今天,明天,每天的每天,你是否都多懂得一点点...

星期三, 十月 09, 2019

How to increase docker toolbox disk size

Today, when I tried to pull a pandoc docker image, I got the following error. Simply, I ran out of the disk.

image.png

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.

image.png

image.png

image.png

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.

https://www.dengnz.com/2019/03/25/increase-azure-linux-vm-disk-size/ 

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.

image.png

You are done!

没有评论:

其它博客地址

此博客的同步博客地址: http://fengnz.wordpress.com
这里进入我的MSN SPACE.