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

fuse mount: mounting without user interaction #1331

Closed
mungomat opened this issue Oct 5, 2017 · 6 comments
Closed

fuse mount: mounting without user interaction #1331

mungomat opened this issue Oct 5, 2017 · 6 comments
Labels
type: feature enhancement improving existing features

Comments

@mungomat
Copy link
Contributor

mungomat commented Oct 5, 2017

Currently mounting a restic repository is started via 'restic mount' and after mounting restic waits for the user to hit control-c.
You can however unmount it on a different terminal with 'fusermount -u'. In this case restic stops with 'unable to umount (maybe already umounted?): exit status 1: fusermount: entry for /mnt/restic not found in /etc/mtab'

This is in contrast to other mounting mechanisms where you have one program for mounting and another for unmounting.

Wouldn't it be better to have 'restic mount' and 'restic unmount'?

@fd0 fd0 added the type: feature enhancement improving existing features label Oct 5, 2017
@fd0
Copy link
Member

fd0 commented Oct 5, 2017

Yes, good idea, at least for mount that's rather easy: Start restic in a subprocess and exit the main process.

@darioseidl
Copy link

Hi,
I'm new to restic and currently evaluating it. It looks really promising!
I was quite confused by the mount command, I assumed there was a bug and it was hanging/sleeping here:

sudo restic -r /mnt/backup/restic-local/ mount /mnt/restic/
enter password for repository: 
Now serving the repository at /mnt/restic/
Don't forget to umount after quitting!

Just to confirm, this is expected behavior, i.e. it is done mounting at this point and it is save to stop the process with Ctrl+C?

@fd0
Copy link
Member

fd0 commented Nov 6, 2017

Yes, that's the expected behavior (at least for now).

@darioseidl
Copy link

Okay, thanks for confirming. All good.

As you can guess, I agree that an unmount command would be nicer.

@darioseidl
Copy link

I'm back at using restic and remembered this (and saw that it was still open).

I think the easiest way to avoid confusion would be to add an example to the documentation showing how to safely mount and unmount in one shell:

Run restic mount in the background (with &):

$ restic -r /tmp/backup mount /mnt/restic &
enter password for repository:
Now serving /tmp/backup at /tmp/restic
Don't forget to umount after quitting!

Do some work with the mounted backup:

$ ls /mnt/restic/snapshots/latest/
...

Send SIGINT to restic to unmount:

$ pkill -2 restic

That's the way I do it at least.

@mholt
Copy link
Contributor

mholt commented Nov 11, 2018

FWIW, I've been automating restic mount for a while now with no problems. Simply signal it when you're done to unmount it (as you suggested above).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature enhancement improving existing features
Projects
None yet
Development

No branches or pull requests

4 participants