Does rustic handle filesystem snapshots? #974
-
Good practice for backups is to use modern filesystem (BTRFS, ZFS, APFS or LVM) snapshots . Does rustic handles it or does it have restic inherited problem (restic/restic#3041)? In a nutshell restic relies on device ID (which is not stable for snapshots) and it causes breaking snapshots inheritance - deduplication of course works but all content metadata is treated as changed. It leads to extra space usage and performance degradation - maybe not critical for small datasets but very painful for big and frequent backups. I see that there is an option available:
which sounds like maybe the option to use. However I could not find anything more specific, e.g. by using this option does rustic is still able to handle hard links? |
Beta Was this translation helpful? Give feedback.
Replies: 17 comments 5 replies
-
I actually tried to answer some of my questions empirically. I have used macOS APFS filesystem and Time Machine snapshots. I can share details if anybody is interested. My findings:
And now loudly thinking - wouldn't it make sense instead (or maybe in addition) of Let's say I have
And backup would use my physical device ID (derived from Limitation of Advantage would be that as I understand restic/rustic internals it would nicely fit into existing logic - no need to create completely new dev path how to nicely handle filesystem snapshots. And resulting repo would be 100% compatible with existing restic/rustic format. Overall I think that it is problem worth to tackle at last. I can see on restic forum more and more people trying to use filesystem snapshots. I do not think that restic can have it sorted anytime soon (given that restic/restic#3041 is many years old). Maybe rustic can come for the rescue here? |
Beta Was this translation helpful? Give feedback.
-
@kapitainsky Thanks for opening this topic and thanks for sharing your results. About file system snapshots - you already found what rustic currently supports 👍 About the hard links: This is not yet supported in rustic. The point is that the repository format doesn't support hardlinks and even restic just uses a heuristic during About
This behavior is actually not expected. Can you try to dig deeper into this and help with debugging the problem? For instance, if you have a dir which is not correctly restored by restic, can you run About the |
Beta Was this translation helpful? Give feedback.
-
And many more things: I have been keeping an eye on this project for some time but since started playing with it I can see myself leaving
Very clear now re hard links. Another reason why two different programs are great to have:) So far I am happy with my tests and restic hard links heuristic. I do not mind to mix usage of both programs - whichever suits my needs better in given scenario.
Will do. No single object is restored correctly by restic.... Content is OK but if I backup
and restore using restic then
All content of Downloads have correct permissions but missing ownership, e.g. (but hard links are here):
when I do the same restore using restic all is OK:
no hard links but all permissions are OK
Ok - it is also clear now. If hard-link topic is cleared than maybe |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
The same as above but using
|
Beta Was this translation helpful? Give feedback.
-
Actually I think there is no issue with ownership/permissions on
when using |
Beta Was this translation helpful? Give feedback.
-
Thanks for digging into it! The point is that these top level dirs are soly virtual dirs which are set by When restoring using rustic, To do the same restore with restic, use |
Beta Was this translation helpful? Give feedback.
-
Yes it is clear now... but I keep finding more weird issues, e.g. I create new repo, backup stuff. Then I remove from source big folder. Create second snapshot and forget the first one. I would expect now
It shows packs marked for deletion and does nothing... I've tried But then when I run old good
All is done and and repo size is now what I would expect. It is even worst. When I repeat all the process but before running
repo size on disk is 6GB - it should be 3GB.... And again to clean the mess it is enough to run It is not what I ever experienced with |
Beta Was this translation helpful? Give feedback.
-
I am sorry for spamming:) But I keep testing:) I think I got now why But now I have strong suspicion that packs marked for deletion are not reused if needed. Like in my test - before they are physically deleted by |
Beta Was this translation helpful? Give feedback.
-
Still to keep compatibility we
then |
Beta Was this translation helpful? Give feedback.
-
Exactly. rustic implements the two-phase pruning in order to make
No, they are not reused once they are marked. Reusing them would require unmarking them and this is a "change" operation which violates the principle that |
Beta Was this translation helpful? Give feedback.
-
Fully agree! I'll change this. |
Beta Was this translation helpful? Give feedback.
-
Thank you for your explanations. I think I am happy to start using It would be nice if these things are mentioned at least in docs - e.g. now https://rustic.cli.rs/docs/commands/forget/customize_pruning.html looks like only covering the same options as in |
Beta Was this translation helpful? Give feedback.
-
BTW - I am more than happy to help with whatever possible. I think Definitely would like to add section in docu how to use filesystem snapshots - especially now when I have it working and understand more. Also to correct some obviously wrong or missing parts in other sections. However so far I failed with basics - rustic-rs/docs#49 (comment) I am not a guru but fairly familiar with github so a bit surprised that it is not straightforward. I will try to figure it out next year:) Thank you for everything! |
Beta Was this translation helpful? Give feedback.
-
About hard links: I think rustic-rs/rustic_core#16 is the better place for disussing solutions. |
Beta Was this translation helpful? Give feedback.
-
For anybody interested this is how I handle backing up from filesystem snapshots (BTRFS, ZFS, APFS, LVM) using This is my config:
Now I run
What goes to my backup is determined by
Please note that |
Beta Was this translation helpful? Give feedback.
-
@kapitainsky Thanks a lot for sharing! |
Beta Was this translation helpful? Give feedback.
I actually tried to answer some of my questions empirically. I have used macOS APFS filesystem and Time Machine snapshots. I can share details if anybody is interested.
My findings:
rustic backup /path/to/mounted/snapshot/mydata --as-path /mydata --ignore-devid
seems to do the trick for backup. Subsequent runs with different APFS snapshots but with no data changes result with identical backup snapshots - no extra metadata uploaded.rustic
any pre existing hard links are gone (replaced by individual files), everything else seems to be ok. Not ideal - this is probably what missing devID leads too.restic
hard links are preserved but fil…