title: Moving docker root folder to a new drive / partition
body: <p>I am trying to move the "/var/lib/docker" folder from one disk to another since that is taking up too much space. I keep running into some errors relating to permissions!</p>
  
  <p>According to these questions: </p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/21486004/how-do-i-move-a-docker-containers-image-to-a-persistant-disk">How do I move a docker container&#39;s image to a persistent disk?</a></li>
  <li><a href="https://stackoverflow.com/questions/19697648/how-to-run-docker-lxc-containers-on-another-partition">How to run docker LXC containers on another partition?</a></li>
  </ul>
  
  <p>My disk is mounted on "/data" and I copied the "/var/lib/docker" folder to "/data/docker"</p>
  
  <p>This is what I tried:</p>
  
  <ul>
  <li>Tried out the -g flag from DOCKER_OPTS with "/data/docker"</li>
  <li>Tried creating a symbolic link from the new disk drive</li>
  <li>I tried doing a bind mount from /data/docker </li>
  </ul>
  
  <p>However in all the cases, I get an error when I try to launch services inside my container about <strong>missing permissions</strong> to write to "/dev/null" (as user root).</p>
  
  <p>I simply did a copy of the folder to the new disk. This copied all the permissions as well (This is an ext4 system with same filesystem level permissions as the original disk on which docker exists now).</p>
  
  <p>Specs:</p>
  
  <ul>
  <li>The fileystem I am using is aufs. </li>
  <li>Docker version is 0.7.6</li>
  <li>Ubuntu 12.04</li>
  </ul>
  
  <p>How do I move the data properly? Do I need a upgrade first?</p>