# Docker uses root partition, might need more storage space

**URL:** https://meta.discourse.org/t/docker-uses-root-partition-might-need-more-storage-space/69298
**Category:** Self-hosting
**Tags:** server-resources
**Created:** [3. September 2017 um 20:23 UTC](https://meta.discourse.org/t/docker-uses-root-partition-might-need-more-storage-space/69298 "2017-09-03T20:23:49Z")
**Posts on this page:** 1
**Showing post:** 9

<div class="post-metadata">

### Author: ![thabbs](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thabbs/32/82150_2.png) [@thabbs](https://meta.discourse.org/u/thabbs)
#### Post date: [13. Oktober 2017 um 17:04 UTC](https://meta.discourse.org/t/docker-uses-root-partition-might-need-more-storage-space/69298/9 "2017-10-13T17:04:14Z")

</div>

Another solution on OS level can be to mount /var/lib/docker on a dedicated partition.

To do this, please, stop Docker, make sure that no process accesses /var/lib/docker and do the following:

Provide an additional volume. In this example it is /dev/sdx8.  
Format it accordingly, i.e.

```
mkfs.xfs -n ftype=1 /dev/sdx8

```

or

```
mkfs.ext4 /dev/sdx8

```

etc.

If it fails in mkfs.xfs you might run a newer version of mkfs.xfs which has ftype=1 already as default. Just issue

```
mkfs.xfs /dev/sdx8

```

Stop Docker.

```
service docker stop

```

Make sure the directory is not used anymore:

```
lsof | grep /var/lib/docker

```

Prepare directories and mount the new volume:

```
mv /var/lib/docker /var/lib/__docker
mkdir /var/lib/docker
mount /dev/sdx8 /var/lib/docker

```

Move all contents there to:

```
rsync -aH /var/lib/__docker/ /var/lib/docker
# mind the trailing slash. It takes care to copy the whole tree to the right position.

```

Don’t forget to add /dev/sdx8 to /etc/fstab.

Remove the old directory if everything is fine.

```
rm -rf /var/lib/__docker

```

---

_[View the full topic](https://meta.discourse.org/t/docker-uses-root-partition-might-need-more-storage-space/69298)._
