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
Copy Code
.
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
Copy Code
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)
Copy Code
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
Copy Code
like this:
- Stop Docker
sudo systemctl stop docker
Copy Code - Open the Docker daemon file
sudo vi /etc/docker/daemon.json
Copy Code - Add the following to the daemon file and save it
{ "storage-driver": "aufs" }
Copy Code - Start Docker again
sudo systemctl start docker
Copy Code
Solution for errors after removing
/var/lib/docker/aufs
Copy Code
, 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
Copy Code
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
Copy Code
in /etc/docker/daemon.json
Copy Code
{
"storage-driver": "vfs"
}
Copy Code
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
and if found any then stop docker,/var/lib/docker/aufs/
Copy Code
them.umount
Copy Code
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
Copy Code
and docker-engine
Copy Code
:
apt-get purge docker docker-engine
Copy Code
Make sure everything from
/var/lib/docker
Copy Code
is removed.
rm -rf /var/lib/docker
Copy Code
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