I recently created a mongodb docker instance running on boot2docker on windows.
Unfortunately during my experimenting with kitematic I managed to accidentally remove
I usually register the path (in a file) of any data volume container I create, precisely in that case. See "Docker volumes for persistent data - is it enough to pass container path only?" and my script updateDataContainerPath.
What I have seen is that:
That will be enough for the new data volume container to give you access to your old data.
In your case, since you didn't register the path of your previous data volume container, you will have to do a search in /mnt/sda1/var/lib/docker/volumes/
for a known file.
This answer is probably just a rewrite of @VonC's, but I feel the need to sum things up a bit. Here are the steps I followed in order to put back a volume that got 'detached' after the container had been removed and recreated.
docker volume ls -f 'dangling=true'
to see all detached volumesdocker volume inspect <volume_hash>
on each to see where they sit (/var/lib/docker/volumes/
in my case)/_data
folder to guess who's who.docker volume prune
will remove all dangling volumes (and therefore make a potential future search for the right dangling volume easier ^^)Thanks for your reply it got me on the right track, I managed to start a new mongo container using the following command
docker run -d -v 571284fbe08a3f2b675af299ec14e55550bad623f6316914d465843fa12d6f18:/data/db mongo
where 571284fbe08a3f2b675af299ec14e55550bad623f6316914d465843fa12d6f18 is the dangling volume identified by using
docker volume ls