kimono-koans / httm

Interactive, file-level Time Machine-like tool for ZFS/btrfs/nilfs2 (and even actual Time Machine backups!)
https://crates.io/crates/httm
Mozilla Public License 2.0
1.24k stars 28 forks source link

httm on mounted restic repository? #124

Open voh9eepah opened 4 days ago

voh9eepah commented 4 days ago

restic is a backup program that is fast, efficient and secure.

Is it possible with some trickery to use httm on mounted restic repository? Restore using mount

The structure of mounted restic repository is similar to zfs snaphots directory.

kimono-koans commented 4 days ago

Is it possible with some trickery to use httm on mounted restic repository? Restore using mount

Yes, it's possible for restic and borg and kopia.

The structure of mounted restic repository is similar to zfs snaphots directory.

One issue I see/one question I have is: How does one relate the live filesystem to the restic repo? If it's as simple as, there is a single machine/namespace/top level at the repo (as opposed to a hierarchy of many filesystems like btrfs/ZFS), then that is very much like a Time Machine backup (something we already do), and adding support would be similar to the Time Machine method.

What I don't want is to install restic and find out it has nothing like the ZFS directory structure, or there is some other impediment to use. btrfs support was a nightmare, whereas nilfs2 was a breeze, and the reason why is even btrfs users could not explain to me how it worked, and left me to figure out on my own.

So re: your support request -- if you or others want support, one could provide, 1) the FUSE mount info for a restic mount, and 2) a precise explanation as to how to find the snapshots from the base mount point (here /srv/timemachine).

Like so --

~ mount | grep zfs | grep timemachine
rpool/timemachine on /srv/timemachine type zfs (rw,noatime,xattr,posixacl,casesensitive)
~ cd /srv/timemachine
~ ls -1 .zfs/snapshots
...
snap_2024-07-05-04:54:16_postmountSnap
snap_2024-07-05-04:54:17_premountSnap
snap_2024-07-05-05:36:45_postmountSnap
snap_2024-07-05-06:39:17_premountSnap
snap_2024-07-05-06:47:22_postmountSnap
snap_2024-07-05-07:40:07_premountSnap
snap_2024-07-05-07:47:14_postmountSnap
snap_2024-07-05-08:40:19_premountSnap
snap_2024-07-05-08:47:31_postmountSnap
snap_2024-07-05-09:41:20_premountSnap
snap_2024-07-05-10:17:21_postmountSnap
syncoid_montrose_2024-07-05:00:02:16-GMT-05:00
voh9eepah commented 3 days ago
~ mount | grep '^restic'
restic on /tmp/05-restic/mnt (fusefs, read-only)
~ cd /tmp/05-restic/mnt
~ ls -1 snapshots/
2024-07-05T23:17:59+03:00
2024-07-05T23:18:33+03:00
2024-07-05T23:18:52+03:00
latest
kimono-koans commented 1 day ago

You can try a dev branch by installing via: cargo install --locked --git https://github.com/kimono-koans/httm.git --branch restic_support

One impediment to use right now is restic support will fail with a warning, if there is already a supported root mount (like a btrfs or ZFS mount with snapshots). This works like the Time Machine support. I understand this is non-ideal and the solution may be to use the --map-alias support, or to provide a toggle. I haven't decided yet.

Feel free to try. If it doesn't work for you re: a basic command, please feel free to let me know here and provide the --debug output.