systemd / casync

Content-Addressable Data Synchronization Tool
1.51k stars 117 forks source link

[Question] Is it possible to update chunk store #150

Open elfgoh opened 6 years ago

elfgoh commented 6 years ago

Say I have an image a.img which I used to create a chunk store: casync make foobar.caibx a.img.

Later on, I have another img, b.img. b.img is meant to be an upgraded version of a.img.

How do I update the chunk store that was created based on a.img? What is the workflow like?

mihais commented 6 years ago
  1. Create the chunk store (default saved in folder default.castr) from a.img: casync make foobar-a.caibx a.img
  2. Update the chunk store with the b.img file chunks (it uses the same default.castr folder and only the new/non-duplicated chunks are saved): casync make foobar-b.caibx b.img
  3. Reconstruct the a.img or b.img: casync extract [path-to-caibx-files]/foobar-a.caibx a-copy.img casync extract [path-to-caibx-files]/foobar-b.caibx b-copy.img
elfgoh commented 6 years ago

I see. So the chunk store default.castr gets bigger over time. Say I am certain that I no longer need a.img. Is there a way to update the chunk store so that unnecessary chunks can be discarded?

mihais commented 6 years ago

If you have a default.castr that contains a.img, b.img, c.img and you want to keep only b.img and c.img: casync -v gc b.img c.img