Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

space issue on docker devmapper and CentOS7

Tags:

docker

I am learning docker and I am using v1.11.0 I am trying to install hadoop but devmapper is complaining about free disk space?

devmapper: Thin Pool has 82984 free data blocks which is less than minimum required 163840 free data blocks. Create more free space in thin pool or use dm.min_free_space option to change behavior 

I have deleted all my images but the problem persists:

[root@localhost hadoop_docker]# docker images REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE debian              latest              47af6ca8a14a        3 weeks ago         125 MB [root@localhost hadoop_docker]# 

and this is my disk configuration:

[root@localhost ~]# lsblk NAME                       MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT sda                          8:0    0    8G  0 disk ├─sda1                       8:1    0  500M  0 part /boot └─sda2                       8:2    0  7.5G  0 part   ├─centos-root            253:0    0  6.7G  0 lvm  /   └─centos-swap            253:1    0  820M  0 lvm  [SWAP] sr0                         11:0    1 1024M  0 rom loop0                        7:0    0  100G  0 loop └─docker-253:0-844682-pool 253:2    0  100G  0 dm loop1                        7:1    0    2G  0 loop └─docker-253:0-844682-pool 253:2    0  100G  0 dm 

QUESTION: How could I free up the disk space?

thank you

like image 596
masber Avatar asked Apr 28 '16 14:04

masber


2 Answers

Just run these three. No need to remove RUNNING containers.

  1. Cleanup exited processes:

    docker rm $(docker ps -q -f status=exited) 
  2. Cleanup dangling volumes:

    docker volume rm $(docker volume ls -qf dangling=true) 
  3. Cleanup dangling images:

    docker rmi $(docker images --filter "dangling=true" -q --no-trunc) 
like image 65
Cokorda Raka Avatar answered Sep 20 '22 17:09

Cokorda Raka


You can use:

docker system prune -a -f --volumes 

where:

  • -a == removes all unused images
  • -f == force
  • --volumes == prune volumes.

see: https://docs.docker.com/engine/reference/commandline/system_prune/#description

as a side note, I had a lot of issues when I used devicemapper driver on my environment. I used to clean as I mentioned, but there were still other devicemapper issues. I strongly recommend moving to overlay2, it solved almost everything completely.

like image 34
Tidhar Klein Orbach Avatar answered Sep 18 '22 17:09

Tidhar Klein Orbach