OK - so I diligently attempted to follow all of the instructions above and in other areas of this Forum, alas to no avail - I was unable to move my docker storage location and have everything work afterwards.
However... in the end, success! Shockingly, from Google Gemini of all places. For posterity and in case it might help someone else in the future, I thought I would reproduce the steps here. The biggest difference I see here compared to previous advice, is that "systemctl stop docker" did not actually stop any of my containers. I had to individually stop them using the OMV GUI.
Forum admins - please feel free to delete this post if I inadvertently have provided bad advice. All I can say is that after following it, everything worked well afterwards, and my Docker storage is now independent of my system disk!
1. Prepare the Data Disk
Mount the disk: Ensure your data disk is properly mounted in OMV. You can do this through the OMV web interface under Storage > File Systems. Create a mount point for the disk, for example, /srv/dev-disk-by-id-yourdiskid. You could also just use an existing mounted file system.
Create a Docker directory: Inside the mount point, create a directory to store your Docker data. For example, /srv/dev-disk-by-id-yourdiskid/docker.
2. Stop Docker and Containers
Stop the Docker daemon: Use the following command in the OMV command line interface (CLI) to stop the Docker daemon:
Stop all running containers: Make sure all your Docker containers are stopped before proceeding. You can use the following command to list running containers:
And then stop them individually using:
docker stop <container_name_or_ID>
3. Copy Docker Data
Use rsync to copy data: It's essential to preserve file permissions and links when moving Docker data. The rsync command is ideal for this:
rsync -aHv /var/lib/docker /srv/dev-disk-by-id-yourdiskid
This command recursively copies all files and directories from the current Docker storage location (/var/lib/docker) to the new location on your data disk. The -a option ensures that permissions, ownership, and symbolic links are preserved. The -H option preserves hard links, and -v provides verbose output so you can see the progress.
4. Configure Docker to Use the New Location
OMV Web Interface: Go to the OMV web interface and navigate to Services > Compose > Settings.
Change Docker storage path: In the "Docker storage path" field, enter the new path to your Docker data directory on the data disk (e.g., /srv/dev-disk-by-id-yourdiskid/docker).
Save and Apply: Save the changes in the OMV web interface.
5. Restart Docker
Restart the Docker daemon:
Verify Docker: Check if Docker is running correctly and using the new storage location:
docker info | grep "Docker Root Dir"
6. Verify Functionality
Start your containers: Start your Docker containers and ensure they are functioning as expected. This can be done in the OMV GUI
Check container data: Verify that the data within your containers is accessible and consistent.
7. Clean Up (only after you are positive everything is working!)
Remove old Docker directory: Once you've confirmed everything is working correctly, you can safely remove the old Docker directory (/var/lib/docker) to free up space on your system drive.