Docker Community Forums

Share and learn in the Docker community.

Docker for Windows: Pull of images fails on external drive

Hello Everybody;

I’m running Windows 10, version 21H1 and Docker 20.10.8.

I’m finding that I’m unable to use an external drive to host my Docker directory.

First off, here’s my daemon.json:

  "registry-mirrors": [],
  "insecure-registries": [],
  "debug": true,
  "experimental": false,
  "data-root": "D:\\Docker",
  "log-driver": "json-file",
  "log-opts": {
    "max-size": "10m",
    "max-file": "3"

When I pull images here’s the output:

 D:› docker pull hello-world
    Using default tag: latest
    latest: Pulling from library/hello-world
    3585a81ca503: Extracting [==================================================>]  
    a25c4ee2d18d: Download complete
    ee745e5dec32: Download complete
    failed to register layer: re-exec error: exit status 1: output: link \\? 
\D:\Docker\windowsfilter\4aacd926ced0ef65daecccf6f632ea567bc2d0e3bc930c0256980b203b8a7aab\Files\Windows\INF\PERFLIB\0000\perfc.dat \\? 
\D:\Docker\windowsfilter\4aacd926ced0ef65daecccf6f632ea567bc2d0e3bc930c0256980b203b8a7aab\Files\Windows\INF\PERFLIB\0000\perfd.dat: Incorrect function.

The same docker pull hello-world command succeeds if I do not specify the "data-root": "D:\\Docker", parameter in my daemon.json file. I.e.: The hello-world image is installed to C:\ProgramData\Docker\windowsfilter\

Upon comparing the contents of the two directories: C:\ProgramData\Docker\windowsfilter\ (The default location) and D:\Docker\windowsfilter\ (My custom location), I believe the reason for this error is that the docker engine is adding a suffix to all downloaded image directories of “-removing”:

Therefore, after successfully downloading the image the expected path of:
D:\Docker\windowsfilter\2e65ba59943609de28b0ec85e31e11ef1ff2f50a69d1ee3f6081fdf4e965db90\ (Without “-removing”),
is not found and Docker is unable to find the downloaded image.

Examining the Docker engine source code, we find a few places where this suffix is added to the directory name:

  1. aufs.go atomicRemove(source string), line 337
  2. windows.go Remove(id string), line 364
  3. layer_store.go deleteLayer(layer *roLayer, metadata *Metadata), line 424

Might anyone have some insight as to how I might be able to leverage the data-root configuration without such errors?

Thank you,

Hello Everybody;

I’ve just solved my issue.

It turns out that my external drive came out-of-the-box formatted as exFAT. After re-formatting the external drive to NTFS, everything is working as expected.

Thank you,