Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make mount command available on more platforms #971

Open
darkdragon-001 opened this issue Dec 21, 2023 · 9 comments · Fixed by #973
Open

Make mount command available on more platforms #971

darkdragon-001 opened this issue Dec 21, 2023 · 9 comments · Fixed by #973
Labels
A-commands Area: Related to commands in `rustic` A-core Area: Generally related to `rustic_core` C-enhancement Category: New feature or request

Comments

@darkdragon-001
Copy link

There is fuse-rs and this is one of the few missing features to feature parity with Restic. I sometimes find it very handy to just browse a snapshot with all my available tools.

@github-actions github-actions bot added the S-triage Status: Waiting for a maintainer to triage this issue/PR label Dec 21, 2023
@simonsan
Copy link
Contributor

FUSE is a *nix solution, we discussed on discord a while ago how to go forward on mount. There are two different possible (non mutually exclusive) solutions. FUSE and WebDAV. The idea was to build a VFS-Layer that you can be used with both, FUSE and WebDAV.

@simonsan simonsan changed the title Add FUSE mount command mount command Dec 22, 2023
@simonsan simonsan added C-enhancement Category: New feature or request A-commands Area: Related to commands in `rustic` A-core Area: Generally related to `rustic_core` and removed S-triage Status: Waiting for a maintainer to triage this issue/PR labels Dec 22, 2023
@aawsome
Copy link
Member

aawsome commented Dec 26, 2023

@darkdragon-001 If you are willing to self-compile rustic in combination with a local `rustic_core', you can try #973 in combination with rustic-rs/rustic_core#106. Note this is WIP, but I'm happy to get feedback on it!

WebDAV should be almost as easy to implement, but the API is async Rust and needs a bit more boilerplate...

@aawsome
Copy link
Member

aawsome commented Jan 10, 2024

webdav is now also implemented in #973

@robsmith11
Copy link

If I want to try this, should I just build rustic-rs with #973?
Looks like the rustic-core patch was already merged.

@aawsome
Copy link
Member

aawsome commented Jun 16, 2024

@robsmith11 There is another PR in rustic_core needed for mount: rustic-rs/rustic_core#156.

I updated #973 and it now uses the needed rustic_core branch. So, to try out the mount command it is now sufficient to manually build #973.

@fgimian
Copy link

fgimian commented Oct 29, 2024

Just an FYI that sadly WebDAV is not very usable on Windows, it is extremely slow and there are limits on file sizes that can be copied from a WebDAV share.

I wonder if WinFsp could be explored for Windows users as it likely will provide a better experience.

Cheers
Fotis

@simonsan
Copy link
Contributor

WinFSP is on the radar, though for now, I think the focus is on implementing mount for Linux and FreeBSD so there are options on these operating systems. You might be able to mount via WSL2 then on Windows, before a more native solution is being released.

@aawsome
Copy link
Member

aawsome commented Oct 29, 2024

@fgimian There is the vfs support in rustic_core which is already used in webdav and in the mount implementation, see #973.

For WinSFP, there seems to be the winfsp crate https://crates.io/crates/winfsp. So, to support it, it should be sufficient to implement the FileSystemContext trait using the vfs support (check e.g. the mount command for details how to actually use that; note that only the read-only part can/needs to be implemented) and add some copy&paste boilerplate code to some new winfsp command or adapt the mount command to use that on windows OS. If anyone is interested, a PR is very welcome.

The other issue (like with the mount command) is how to actually integrate the dependencies into the build-pipelines for tests and automatic release, but IMO this can be separated.

github-merge-queue bot pushed a commit that referenced this issue Nov 10, 2024
This PR adds the `mount` command to rustic to access snapshot contents
as a read-only filesystem when the feature-flag `mount` is chosen.

As for the `webdav` command, there are following options:
- Access to a concrete snapshot/path, e.g. `rustic mount /mnt
37a63e5b:/my/path`.
- Access to all snapshots (maybe restricted by filters) by using
templates to define a virtual directory structure where snapshots are
located. Example: `rustic mount /mnt --path-template
"[{hostname}]/[{label}]/{time}" --time-template "%Y-%m-%d_%H-%M-%S"`
(these are also defined as default). Note that for all dirs containing
only snapshots, also a `latest` entry is generated. `latest` and
identical subsequent snapshots are symlinks when using `mount`.

This PR uses fuse_mt which is not optimal as it introduces some overhead
(e.g. needs to save whole Paths in-memory).

Note: Requires rustic-rs/rustic_core#331 to
properly show all data of files (without it builds and runs, but files
are truncated and return error when reading).

Note: Building with the `mount` feature flag requires special
dependencies and is only possible on supported platforms, see
https://github.com/cberner/fuser

closes #971

---------

Co-authored-by: simonsan <[email protected]>
@simonsan simonsan reopened this Nov 11, 2024
@simonsan
Copy link
Contributor

simonsan commented Nov 11, 2024

Reopening, as I think this should probably not be closed, until we have widespread platform support, at least for the main missing one's - OSX and Windows. Support for x86_64-unknown-linux-gnu will land with the next rustic version. If you want to test it, you can download rustic-nightly-x86_64-unknown-linux-gnu.tar.gz from https://github.com/rustic-rs/nightly/tree/main/rustic

⚠️ All the other builds don't contain it, due to incompatibilities and cross-compilation issues.

@simonsan simonsan changed the title mount command Make mount command available on more platforms Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-commands Area: Related to commands in `rustic` A-core Area: Generally related to `rustic_core` C-enhancement Category: New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants