Skip to content

Mount docker data on a different SSD

vdo edited this page Apr 10, 2019 · 6 revisions

If you want to store DAppNode data on a different device, to have more space or any other reason, follow these steps, as root user or using sudo.

  • Stop Docker service

    systemctl stop docker

  • Create a new mountpoint for docker data. As an example:

    mkdir /data

  • Add your partition on the new device to /etc/fstab. You can identify its UUID using the blkid tool. Make sure your device is properly partitioned first. Your new line in /etc/fstab should look like this:

    UUID=b311b983-bda6-4e9f-835c-266d40d64f07 /data/ ext4 defaults 0 0

  • Mount your SSD drive

    mount /data

  • Move docker data to the mountpoint

    mv /var/lib/docker/* /data/

  • Edit Docker settings to use the alternative location. Edit /etc/docker/daemon.json as follows:

{
  "data-root": "/data"
}
  • Restart docker

    systemctl start docker

You can’t perform that action at this time.