15

I am no longer able to use docker or effectively run new images -- it is reporting that I have 100% disk usage. Here, you can see I am launching a pristine copy of ubuntu, and yet it is telling me I have no disk space left:

$ docker run -t -i ubuntu /bin/bash
root@3838b70bd76e:/# df -h 
Filesystem      Size  Used Avail Use% Mounted on
rootfs           19G   18G     0 100% /
none             19G   18G     0 100% /
tmpfs          1005M     0 1005M   0% /dev
shm              64M     0   64M   0% /dev/shm
/dev/sda1        19G   18G     0 100% /etc/hosts
tmpfs          1005M     0 1005M   0% /proc/kcore

Separately, I am trying to start a mysql instance and it is giving me error messages that I believe are connected to the fact that I have no available disk. When I try to run orchardup/mysql, I get:

ERROR: 1030  Got error 28 from storage engine

Which means it has run out of storage space.

Given this, how should I interpret the above df -h report, and how can I determine what is consuming 100% of my disk? I am running docker 1.3, running on OSX 10.9.4, using boot2docker.

Thanks.


Edit: As a workaround, I have run boot2docker delete, and then boot2docker init, and it appears to have trashed all of my images (fortunately I can rebuild them with my dockerfiles). Now, when I start a fresh ubuntu image:

root@f53d637e3d33:/# df -h
Filesystem      Size  Used Avail Use% Mounted on
rootfs           19G  373M   17G   3% /
none             19G  373M   17G   3% /
tmpfs          1005M     0 1005M   0% /dev
shm              64M     0   64M   0% /dev/shm
/dev/sda1        19G  373M   17G   3% /etc/hosts
tmpfs          1005M     0 1005M   0% /proc/kcore

So much better. But, I am still confused, there must be some kind of shared global disk across all images hosted by boot2docker that previously got filled up?


Edit 2: I just downloaded a bunch of images, and now here is what I see when I run the ubuntu image and check free disk space:

root@f53d637e3d33:/# df -h
Filesystem      Size  Used Avail Use% Mounted on
rootfs           19G  2.7G   15G  16% /
none             19G  2.7G   15G  16% /
tmpfs          1005M     0 1005M   0% /dev
shm              64M     0   64M   0% /dev/shm
/dev/sda1        19G  2.7G   15G  16% /etc/hosts
tmpfs          1005M     0 1005M   0% /proc/kcore

From 3% to 16% consumed! Clearly there is some kind of shared disk between all of my images that I am not understanding...

1
  • How are you using the Docker containers and how are users/groups dispersed (more to the mysql errors) Also, for docker are they sharing anything on the host or are they purely self contained? Apr 10, 2015 at 2:14

4 Answers 4

1

On windows hosts, boot2docker works by creating a virtual machine using virtual box. when you run boot2docker init, it creates a virtual machine and, by default, assigns 20G to the root disk. this virtual machine runs a minimal Linux OS which in turn runs the actual docker daemon (docker daemon does not run natively on windows - yet).

the disk attached to the virtual machine provides storage for the docker images. so you could look at additional options to boot2docker init command to increase the initial disk size. this will increase the disk size available for use in the virtual machine, but as Queasy pointed out, you need to add the additional options to the docker daemon to increase the available storage for the images.

when you run "df -h" in the container, the total disk size reported is that of the disk space allocated to docker daemon using "dm.basesize" option.

note: boot2docker is now deprecated in favour of Docker Toolbox. you might want to upgrade to that version, in which case you would use "docker-machine create" instead of "boot2docker init". i have switched over to docker-toolbox so cannot test the command options needed for boot2docker init

0

Modify the docker config in /etc/sysconfig/docker-storage and add the line:

DOCKER_STORAGE_OPTIONS= --storage-opt dm.basesize=30G

Remember to backup your docker before proceeding with this task because it will remove your data once initialized.

1
  • --storage-opt is not supported on OSX
    – Quanlong
    Nov 18, 2016 at 11:22
0

Consider that the drive may be bad. Hitachi (Drive Fitness Test), Seagate (Seatools), and Western Digital (Western Digital Data Lifeguard) all offer free diagnostic software to help you determine this.

As an example of how a bad drive can screw with disk space, I've backed up 1TB drives that report to Windows that they still have PETABYTES of data left to transfer.

In the event that your drive is fine, use du (Disk Usage) to see which folder is the large one. du -h /usr/bin, du -h /var or du -h /home/[username]/Downloads to help pinpoint it.

Edit: I saw you're using OS X: You'll need to use the HDD tools mentioned above as their bootable options or in something like the free Windows PE, which you can then boot to and run these tools.

0

The devicemapper is docker's default storage engine. It tries to preallocate 100Gb by default in /var/lib/docker. Not all of this space is really used though, and you can configure it in the options. Docker docs

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .