AI, startup hacks, and engineering miracles from your friends at Faraday

Deleting /var/lib/docker with devicemapper

Seamus Abshere on

If you're running docker with devicemapper as the storage driver, there are a few steps to recover after deleting /var/lib/docker:

$ sudo service docker stop
$ sudo rm -rf /var/lib/docker
$ sudo lvremove docker
$ docker-storage-setup
$ sudo service docker start

This will help you recover from errors like

Error starting daemon: error initializing graphdriver: devicemapper: Non existing device docker-docker–pool  

or

Error starting daemon: error initializing graphdriver: Unable to take ownership of thin-pool (dockerVG-docker--pool) that already has used data blocks  

Thanks to hints from redhat bugzilla and docker forums.