Let’s have a look at the Docker error creating AUFS mount and its solution by our Docker Hosting Support Services at Bobcares.
Docker error creating AUFS mount
AUFS is a Docker storage driver. Docker storage drivers have control over how images and containers are stored on your filesystem. They’re the mechanism that allows you to create images, start containers, and modify writable layers, the aufs was one among the default storage drivers before overlay2
.
Live USB is certainly not ext4 or one of the other supported filesystems. Most likely it’s doing an overlay and here we are not sure if can mount overlayfs on top of an overlayfs. However, you can look up on to your current filesystem for /var/lib/docker with a mount
command.
# df /var/lib/docker/.
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/bmitch--vg-homelv 720798904 437701948 246459468 64% /home
# mount | grep /dev/mapper/bmitch
/dev/mapper/bmitch--vg-homelv on /home type ext4 (rw,relatime,data=ordered)
Now maybe an issue occurs if your Docker configuration has a different setup for the storage driver, then the solution to fix that configuration is to use aufs
like this:
- Stop Docker
sudo systemctl stop docker
- Open the Docker daemon file
sudo vi /etc/docker/daemon.json
- Add the following to the daemon file and save it
{ "storage-driver": "aufs" }
- Start Docker again
sudo systemctl start docker
Solution for errors after removing /var/lib/docker/aufs
, which a couple of extra steps cleared up.
# Cleaning up through docker avoids these errors
# ERROR: Service 'master' failed to build:
# open /var/lib/docker/aufs/layers/<container_id>: no such file or directory
# ERROR: Service 'master' failed to build: failed to register layer:
# open /var/lib/docker/aufs/layers/<container_id>: no such file or directory
docker rm -f $(docker ps -a -q)
docker rmi -f $(docker images -a -q)
sudo service docker stop
sudo rm -rf /var/lib/docker/aufs
# Removing the linkgraph.db fixed this error:
# Conflict. The name "/jenkins_data_1" is already in use by container <container_id>.
# You have to remove (or rename) that container to be able to reuse that name.
sudo rm -f /var/lib/docker/linkgraph.db
sudo service docker start
If you try to use docker inside a persistent enable Live CD, then you may encounter an error due to the fact that you can’t mount AUFS inside overlayfs, which is the persistent layer.
The solution was simply using a different driver. here we have used vfs
in /etc/docker/daemon.json
{
"storage-driver": "vfs"
}
If you get AUFS unable to mount the docker container filesystem. This is either because the path already mounted or there’s a race condition in docker’s interaction with AUFS, due to a large number of existing volumes.
To solve this, try the following:
- Try to restart the docker service or daemon and then try again.
- Check for aufs mounted on any paths under
/var/lib/docker/aufs/
and if found any then stop docker,umount
them.
If your system could not resolve this with the above answers and docker administration keeps remembering a certain file in the aufs layer that it couldn’t reach anymore. Then you could try the following fix: uninstall/purge docker
and docker-engine
:
apt-get purge docker docker-engine
Make sure everything from /var/lib/docker
is removed.
rm -rf /var/lib/docker
Finally, install the docker once again.
[Looking for a solution to another query? We are just a click away.]
Conclusion
Docker error creating AUFS mount is either because the path already mounted or there’s a race condition in docker’s interaction with AUFS. Docker storage drivers have control over the images and containers stored on the filesystem.
PREVENT YOUR SERVER FROM CRASHING!
Never again lose customers to poor server speed! Let us help you.
Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.
0 Comments