I’m running out of disk space on my laptop. I use Ubuntu as my workhorse installed on a 120GB SSD.

I also have a Windows OS on dual boot just in case I need it (I very very seldom do) which means my 1TB HDD needs to be NTFS (unfortunately) so I can use the disk from any OS.

Now as the projects at work pile up, Docker seems to taking up most of the space of my poor little SSD.

Not as straightforward as it seems but luckily stackoverflow was there to help.

After moving /var/lib/docker to the NTFS filesystem:

sudo rsync -avxP /var/lib/docker/ /mnt/hdd/var/lib/docker/

All that’s needed to do is to update the file: /etc/docker/daemon.json

{
    "data-root": "/mnt/hdd/var/lib/docker",
    "storage-driver": "devicemapper"
}

Then start the docker service and voila!

Now, if only I could do something similar to node_modules.