Search code examples
dockerrsyncdiskdocker-volume

Copying docker image folder between partition with rsync


I'd like to move my /var/lib/docker data to another place, and to make it safe, i'd like to use rsync.

But the data are stored with sparse files, and rsync does not seem to handle it properly.

What would be the right parameters for rsync?

  • -a preserves properly the uid/gid+rights
  • -S handle sparse files efficiently, but rsync never seems to end

Without -S, rsync tries to copy more data than the original location can contain (100G on a 48G partition). With the -S, I seem to be stuck forever after about 10G.


Solution

  • It seems that rsync -avXS is working like a charm.