How can I open files after a restic mount and share with samba?

I want to share a mounted restic archive on the NAS with samba for Windows and OSX.
I can see all the folders and files, but when I try to open a file I get the message that it does not exist.
Everything works on the NAS without any problems. These are my settings:

Directory rights before the mount:
drwxr-xr-x 2 nas nas 4096 11. Nov 07:17 restic

This is the mount command that you execute as root:
restic -r /mnt/disk6/restic-repo-tools mount --no-default-permissions --allow-other --time-template “2006-01-02_15-04-05” /mnt/restic

Directory rights after the mount:
dr-xr-xr-x 1 root root 0 12. Nov 08:43 restic

Samba settings:

path = /mnt/restic/
public = yes
writable = no
comment = smb share
printable = no
guest ok = yes
follow symlinks = yes
wide links = yes
unix extensions = no

This is not really restic problem but some issue related to FUSE shares over SMB. Maybe somebody can give you some hints but in the meantime you can:

  1. on macOS you can mount your repo directly as restic mount is supported on this platform

  2. on Windows (as well as on macOS and Linux) you can try 3rd party solutions like - GitHub - emuell/restic-browser: A GUI to browse and restore restic backup repositories.

1 Like

I have tried something else. If the backup was created under Linux, I can access the files in the mouted restic archive.
But if I take an archive that was created under Windows (0.16.1) it does not work.

I test it also with my OSX. I create the repo with my Mac and I mount it again on Linux.
That works. Only when I create/fill the repo under Windows do I encounter the problem that I cannot read any files. The directories are displayed and I can also navigate.

I think these are interesting observations but at the end not related to restic mount functionality.

restic repo FUSE mount purpose is to browse and copy files out of it - simply for restoring data from repo.

I doubt anybody planed to support opening files. It would require much more work to ensure that it behaves more like regular POSIX filesystem and implementing data caching, seek etc.

You should not treat restic mount as yet another read only disk mount you can do what you would expect from any other local filesystem. It is not this.

Hmm… Sorry but… Can someone else confirm what @kapitainsky just wrote? To me 1) it does not seem to be related to this thread and 2) it does not seem to be a correct statement.

1 Like

This is completely wrong. restic mount should in most regards behave like a regular, read-only filesystem. It may be a bit slow depending on the file access patterns. But you can open / read files just like on a normal filesystem. The mount command also uses a small cache to reduce repeated blob downloads. Opening files and random access (read/seek) work perfectly fine. Otherwise it wouldn’t even be possible to copy files from the FUSE mount.

Snapshots created on Windows contain less metadata than those created on other systems. It’s likely that the Samba problems are related to that.

Thank you for clarification. Always learning something new:)

1 Like

Perhaps you should read this GitHub post, it helped me setup the use Case you described.