I've recently moved my default Docker root directory to a new path on my Raspberry Pi 4B running Docker version 29.2.1. I copied all the contents from `/var/lib/docker/` to `/mnt/hdd/docker/`, and I updated the Docker daemon configuration. While most of my containers are functioning well, my Pi-hole container is throwing a lot of SQLite errors, indicating potential write issues. It seems to be a permissions problem, but I'm not sure how to resolve it. Any suggestions on fixing this so that my containers can write to their databases again?
2 Answers
It sounds like you might need to check the permissions on your newly moved database files. The typical user and group for MySQL or MariaDB are `999:999`, so try adjusting the ownership of your database volume to that and see if it makes a difference. Also, for future reference, consider using bind-mounts instead of changing the default Docker location; it simplifies things a lot!
Just a quick question—when you did the copy, did you use the `cp -rp` command? Using just `cp *` may not handle subdirectories properly, leaving some files behind. Make sure you’re preserving permissions as well since that could definitely lead to issues with access.
I did use `cp -r /var/lib/docker/*`, but I didn’t include the `-p` option. Maybe that’s where I went wrong!

But wait, isn't there a chance that the Pi-hole setup doesn't have persistent data? How are you handling volumes in your Docker Compose file?