title: How to change the dir root of docker image storage
body: <p>I using docker to build some images. To space drive space I decide to change the default docker images and containers storage ('/var/lib/docker') to my additional drive ('/mnt') </p>
  
  <p>I change the '/lib/systemd/system/docker.service', and add </p>
  
  <p><code>'ExecStart=/usr/bin/dockerd -H fd:// -g /mnt/data'</code></p>
  
  <p>The problem is when I indicate dir root like that it works like a charm, but if I want to go deeper, for example </p>
  
  <pre><code>'ExecStart=/usr/bin/dockerd -H fd:// -g /mnt/data/subFolder/AABB'
  </code></pre>
  
  <p>When I <code>'systemctl daemon-reload'</code> and <code>'service docker restart'</code>
  I got error:</p>
  
  <pre><code>● docker.service - Docker Application Container Engine
     Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
     Active: inactive (dead) (Result: exit-code) since Wed 2017-08-16 16:25:28 EDT; 46s ago
       Docs: https://docs.docker.com
    Process: 4543 ExecStart=/usr/bin/dockerd -H fd:// -g /mnt/data/subFolder/AABB (code=exited, status=1/FAILURE)
   Main PID: 4543 (code=exited, status=1/FAILURE)
  
  Aug 16 16:25:28 myserver systemd[1]: Failed to start Docker Application Container Engine.
  Aug 16 16:25:28 myserver systemd[1]: docker.service: Unit entered failed state.
  Aug 16 16:25:28 myserver systemd[1]: docker.service: Failed with result 'exit-code'.
  Aug 16 16:25:28 myserver systemd[1]: docker.service: Service hold-off time over, scheduling restart.
  Aug 16 16:25:28 myserver systemd[1]: Stopped Docker Application Container Engine.
  Aug 16 16:25:28 myserver systemd[1]: docker.service: Start request repeated too quickly.
  Aug 16 16:25:28 myserver systemd[1]: Failed to start Docker Application Container Engine.
  </code></pre>
  
  <p>I have check the ownership and right for them which are</p>
  
  <pre><code>drwxr-xr-x 3 root root 4096 Aug 16 16:23 data
  &amp;
  drwxrwxrwx 4 root  root 49 Aug  8 10:23 AABB
  </code></pre>
  
  <p>Does anyone have idea why that happens?
  Any help appreciated!</p>
  
  <p>A bit update, I find after I change the root (e.g."/mnt/data")
  the right of this folder is changed as well</p>
  
  <pre><code>drwx--x--x 12 root root 4096 Aug 16 16:40 data
  </code></pre>
  
  <p>Although it is doable to change it back, It would be great if you can give me some clue</p>
  
  <p>Here is more update, the <code>/subFolder/</code> seems to be NFS share folder, that might be the reason.</p>
  
  <p>So it there any way that I can use the folder as docker image and container storage? </p>