How to copy a volume with Docker not running

Hi everyone,
I don’t know what happened but today a Ubuntu server crashed and after restarting it Docker is no longer working. When I try to boot it, I get

~$sudo service docker start
Job for docker.service failed because the control process exited with error code.
See "systemctl status docker.service" and "journalctl -xe" for details.

~$ systemctl status docker.service
● docker.service - Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
Drop-In: /etc/systemd/system/docker.service.d
└─startup_options.conf
Active: failed (Result: exit-code) since Mon 2025-12-15 20:32:17 CET; 4s ago
TriggeredBy: ● docker.socket
Docs: https://docs.docker.com
Process: 827 ExecStart=/usr/bin/dockerd -H fd:// -H tcp://0.0.0.0:2376 (code=exited, status=1/FAILURE)
Main PID: 827 (code=exited, status=1/FAILURE)

Dec 15 20:32:15 inlab05-20 systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE
Dec 15 20:32:15 inlab05-20 systemd[1]: docker.service: Failed with result ‘exit-code’.
Dec 15 20:32:15 inlab05-20 systemd[1]: Failed to start Docker Application Container Engine.
Dec 15 20:32:17 inlab05-20 systemd[1]: docker.service: Scheduled restart job, restart counter is at 3.
Dec 15 20:32:17 inlab05-20 systemd[1]: Stopped Docker Application Container Engine.
Dec 15 20:32:17 inlab05-20 systemd[1]: docker.service: Start request repeated too quickly.
Dec 15 20:32:17 inlab05-20 systemd[1]: docker.service: Failed with result ‘exit-code’.
Dec 15 20:32:17 inlab05-20 systemd[1]: Failed to start Docker Application Container Engine.

After a bit of googling, I’m afraid I have to reinstall Docker but I can’t lose the volumes with the data.
Will I lose the volume if I reinstall Docker?
Is there a way to copy the volume to another location without having Docker running?

I run my stack using compose

services:
db:
container_name: ‘mysql’
image: mysql:5.7
volumes:
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
- mysql-data-volume:/var/lib/mysql
env_file: db.env
ports:
- 3306:3306
networks:
- net
restart: unless-stopped

….



volumes:
mysql-data-volume:

Thanks,

Sig

Not unless you knowingly delete the docker root-dir /var/lib/docker.

The data of local named volumes is located in /var/lib/docker/volumes/<volume name>/_data. Generally, it is not recommended to tinker with anything underneath the docker root-dir. Though, in this case you only want to read from it, so it should be fine.

When a named volume is created from docker compose, the <volume name> will consists of <project name>_<volume name from the compose file>. If no project name is provided when using docker compose, the folder name where the compose file is located will be the project name.

You can try to reinstall, but if there is something with the Docker Data root, you will have the same problem after reinstalling. I think the docker daemon config is kept as well so if everything is the same after reinstalling, it will not help. Of course, you could backup the volume data and delete the docker data root when you have nothing to keep in it anymore. Then you can reinstall.

I would try to look for the actual error message in the logs. I wanted to write a blogpost about it so many times, and I started it, but I could never reproduce an error where the actual useful error message is not viisble after I scroll up a little in the journalctl log. I remember cases in the past, but I could never inentionally reproduce it.

You only shared the output if the systemctl status command, but there is another command in the error message after trying to start docker. The journalctl command. Despite what it says, I would just run

journalctl -e 

which shows all the logs without extra metadta that (for me) just makes it harder to notice error messages. If there are too many logs, you can try

journalctl -e -u docker

When systemd tries to restart Docker, it is not allowed to try too many times, so you start to see the error message about that, not about what the original error was, but it must be there when you scroll up in the output of journalctl.

You can also just run dockerd manually without systemd. That will likely show the same error message, unless it was caused by a parameter added to a systemd service file or a config file read only by systemd..

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.