How to move Docker data to another disk?

I use docker extensively and fear the constant threat of “no space left on device”. Using LVM setup my system has btrfs. I created and mounted to system logical device formatted as ext4 (which might be fail on my side, because docker seems to use btrfs, I mean /var/lib/doker/btrfs). So the idea was to copy data from /var/lib/docker to the directory on the new logical device and replace /var/lib/docker with a link to new folder. This didn’t work (Docker complained about btrfs folder) and I reverted the changes.

What is a proper way to move docker to another volume?

And there is another issue with btrfs. Seems that I’m facing problem describes here - docker doesn’t clean up subvolumes in btrfs directory even after docker system prune -a. So my question extended: how to move docker data to another volume **and **get turn off its usage of btrfs?

Figured that out. First of all pruned all docker data (on a descktop PC had to manually clean btrfs folder btrfs subvolume delete... ) and enabled overlay2 instead of btrfs for docker. Then moved docker directory to another volume and created in /var/lib a link to its location. Everything works now :slight_smile:

Thanks. It’s great when people solve their own problem. And, better still, you have left some hints for anyone with similar issues.