Error response from daemon: error creating overlay mount to /media/new/path/docker/overlay2/cf4XXXX9/merged: invalid argument

Hello,
I’m getting this error message when trying to the following to run docker from a media USB storage device. [Reference: https://linuxconfig.org/how-to-move-docker-s-default-var-lib-docker-to-another-directory-on-ubuntu-debian-linux].
Open file /lib/systemd/system/docker.service with your favorite text editor and replace the following line where /new/path/docker is a location of your new chosen docker directory:
FROM:
ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
TO:
ExecStart=/usr/bin/dockerd --data-root /media/new/path/docker -H fd:// --containerd=/run/containerd/containerd.sock

stop docker service: # systemctl stop docker

Hi Nmev,

Welcome to our forums.

What filesystem do you have on that media USB storate device?

You can verify it by running

# sudo fdisk -l

For example, my output would be the following for my NTFS formatted external disk:

Disk /dev/sdb: 931.5 GiB, 1000170586112 bytes, 1953458176 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x210f61fa

Device     Boot Start        End    Sectors   Size Id Type
/dev/sdb1        2048 1953458175 1953456128 931.5G  7 HPFS/NTFS/exFAT