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 endWithout -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.
It seems that rsync -avXS
is working like a charm.
Should you rsync a /var/lib/docker
to a remote server be sure to tell rsync to do no mapping of the uids
and gids
between the two systems. Otherwise you could end up with wrong ownerships of files in your containers.
so this would create an exact copy:
rsync -avHXS --numeric-ids /var/lib/docker/. [email protected]:/var/lib/docker
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With