Docker Relocate to external USB SSD Problem

Ubuntu 20.04.5 LTS

Docker version 24.0.2

I am trying to relocate the /var/lib/docker directory to my USB SSD flash drive to save memory on the internal storage, however, I am having difficulty doing so.
I have attempted to modify the docker service to set a different data-root, but when I start the service, I get an error and think this is relates to the fact that the relocate destination is a USB flash drive.

I created a copy of the existing docker files by executing

sudo rsync -avxP /var/lib/docker/ /home/myuser/riva/docker/

where /home/myuser/riva is my mounted USB drive (myuser is my username), and then modified docker.service to set the data root to the new location

ExecStart=/usr/bin/dockerd --data-root /home/myuser/riva/docker -H fd:// --containerd=/run/containerd/containerd.sock

However, docker fails to start, producing the following error

time="2024-03-13T02:21:33.996540964-07:00" level=info msg="Starting up"
time="2024-03-13T02:21:34.000771936-07:00" level=info msg="detected nameserver, assuming systemd-resolved, so using resolv.conf: /run/systemd/resolve/resolv.conf"
time="2024-03-13T02:21:34.100456272-07:00" level=error msg="failed to mount overlay: invalid argument" storage-driver=overlay2
time="2024-03-13T02:21:34.100577936-07:00" level=error msg="[graphdriver] prior storage driver overlay2 failed: driver not supported"
failed to start daemon: error initializing graphdriver: driver not supported

For test purposes, I tried the same procedure to relocate to another folder on internal storage and this worked well, so this proves the issue relates to the SSD Flash drive.
When I execute ‘fdisk -l‘, the result reports ntfs, as expected.

/dev/sda1: LABEL="RIVA" UUID="18089E33089E103C" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="5fa27c32-117b-4223-9a76-6297b0fdc625"

Can someone help?


Asked By: user5265160


I resolved my issue. The problem was that storage-driver=overlay2 was not compatible with the NTFS file system. I re-formatted my flash drive to be ext4 and this resolved my issue. I hope someone can benefit from my issue.

For info, prior to formatting my flash drive, I changed storage-driver=fuse-overlayfs but this also failed with the NTFS file system. I also tried VFS, and docker successfully worked, but resulted in an excessively high download.

Answered By: user5265160
Categories: Answers Tags: , , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.