Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to remove a directory of out the Docker root #33800

rvernica opened this issue Jun 23, 2017 · 6 comments

Unable to remove a directory of out the Docker root #33800

rvernica opened this issue Jun 23, 2017 · 6 comments


Copy link

@rvernica rvernica commented Jun 23, 2017


Due to poor default partitioning scheme, I am forced to store the Docker volumes in a different directory and add a symbolic link to it from /var/lib/docker:

> ls -l /var/lib/docker
rwxrwxrwx. 1 root root 13 Sep 29  2016 volumes -> /home/volumes

This works fine, except when I want to remove volumes. I get:

Error response from daemon: unable to remove volume: remove 06a9724d58196f4657e5f546dd08f62797bfef71699c5129984f09604f067812: 
Unable to remove a directory of out the Docker root /var/lib/docker: /home/volumes/06a9724d58196f4657e5f546dd08f62797bfef71699c5129984f09604f067812/_data

The workaround is to go a manually remove the /home/volumes/... directory. Then, removing the volume works.

Describe the results you expected:

I would expect Docker to be more consistent. If it can create directories and files outside the root, how come it cannot delete them.

Output of docker version:

> docker version
 Version:      17.04.0-ce-rc2
 API version:  1.28
 Go version:   go1.7.5
 Git commit:   2f35d73
 Built:        Wed Mar 29 07:43:44 2017
 OS/Arch:      linux/amd64

 Version:      17.04.0-ce-rc2
 API version:  1.28 (minimum version 1.12)
 Go version:   go1.7.5
 Git commit:   2f35d73
 Built:        Wed Mar 29 07:43:44 2017
 OS/Arch:      linux/amd64
 Experimental: false

Output of docker info:

> docker info
Containers: 0
 Running: 0
 Paused: 0
 Stopped: 0
Images: 70
Server Version: 17.04.0-ce-rc2
Storage Driver: devicemapper
 Pool Name: centos-dockerpool
 Pool Blocksize: 65.54kB
 Base Device Size: 10.74GB
 Backing Filesystem: xfs
 Data file: 
 Metadata file: 
 Data Space Used: 45.15GB
 Data Space Total: 214.7GB
 Data Space Available: 169.6GB
 Metadata Space Used: 53.43MB
 Metadata Space Total: 104.9MB
 Metadata Space Available: 51.43MB
 Thin Pool Minimum Free Space: 21.47GB
 Udev Sync Supported: true
 Deferred Removal Enabled: false
 Deferred Deletion Enabled: false
 Deferred Deleted Device Count: 0
 Library Version: 1.02.135-RHEL7 (2016-11-16)
Logging Driver: json-file
Cgroup Driver: cgroupfs
 Volume: local
 Network: bridge host macvlan null overlay
Swarm: active
 NodeID: 0bn9wp5zz6tcgd7kdwhrjoezx
 Is Manager: true
 ClusterID: f372pdcfok6r9i1se60lqp6jn
 Managers: 1
 Nodes: 3
  Task History Retention Limit: 10
  Snapshot Interval: 10000
  Number of Old Snapshots to Retain: 0
  Heartbeat Tick: 1
  Election Tick: 3
  Heartbeat Period: 5 seconds
 CA Configuration:
  Expiry Duration: 3 months
 Node Address:
 Manager Addresses:
Runtimes: runc
Default Runtime: runc
Init Binary: 
containerd version: 422e31ce907fd9c3833a38d7b8fdd023e5a76e73
runc version: 9c2d8d184e5da67c95d601382adf14862e4f2228
init version: 949e6fa
Security Options:
  Profile: default
Kernel Version: 3.10.0-327.36.1.el7.x86_64
Operating System: CentOS Linux 7 (Core)
OSType: linux
Architecture: x86_64
CPUs: 4
Total Memory: 23.37GiB
Name: blu-03
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Http Proxy: http://...
Experimental: false
Insecure Registries:
Live Restore Enabled: false

WARNING: bridge-nf-call-ip6tables is disabled

Additional environment details (AWS, VirtualBox, physical, etc.):


Copy link

@cpuguy83 cpuguy83 commented Jun 23, 2017

Here's the offending code:
I'm not sure why it is setup like this... Have you tried a bind-mount instead of a symlink?

Probably the best option is to provide a way to configure the data root for the local volume driver.

Copy link

@rvernica rvernica commented Jun 27, 2017

Bind-mount works well. Thanks.

Copy link

@eperov eperov commented Jan 18, 2018

Would you please explain how you did bind-mount to the directory?
I tried with ElasticSearch:
docker volume create --name edikvol --opt type=none --opt device=/edik --opt o=local
ES starts up, but does not work, returns an authentication error.

Copy link

@cpuguy83 cpuguy83 commented Jan 18, 2018

@eperov this seems like a problem with ES and not related here. Feel free to hop on the Docker community slack if you'd like help troubleshooting.

Closing anyhow since it looks like the OP has solved the issue.

@cpuguy83 cpuguy83 closed this Jan 18, 2018
Copy link

@tarfeef101 tarfeef101 commented Jul 1, 2019

I have this issue as well, and unlike OP just using bind mounts instead is not a solution for me. I believe that there should be a way for docker to be able to clean up volumes even if /var/lib/docker/volumes is symlinked to another directory (which might be, say, on a larger disk than /var since a docker volume could store large amounts of data better suited to a mass storage disk than the O/S drive of a system).

Is there any chance of this being looked at for a fix?

Copy link

@thaJeztah thaJeztah commented Jul 1, 2019

Could you open a new issue with details about your setup and steps to reproduce?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
6 participants