Data migration for docker storage management
background:
It is often found that the docker in the server has been used for a long time, and the data is stacked too much, causing the disk to burst. Then backing up the data of the docker service has become a problem that needs to be solved.
status quo:
It can be seen in the figure that /dev/vda1 has occupied 99% of the disk root directory
View docker resource usage:
docker system df
By default, docker resource data is stored in:
/var/lib/docker
A) Link method of data migration:
1) Find a free disk and mount it to /mnt
2) Move /var/lib/docker to /mnt (stop docker in advance)
3) Create a soft connection: ln -s /mnt/docker /var/lib/docker
4) Restart the docker service and check: docker images
Finally: the server disk has been vacated