Permissions using mount to restore via rsync

Hello dear community!

First of all I would like to thank all for the work of restic.
As a longtime Borg user I have now become aware of restic and I am thrilled.

I want to use restic to backup a complete Linux-Root-Filesystem.
The “restore” function does its job, but I’m used to being able to copy data back directly from the backup mount with rsync like borgbackup-mounts.
Restic works very fast at this point and also works perfectly with rsync. Unfortunately, the permissions of the folders and files in the fuse mount are not like the backedup data. The restored files therefore always have the user as owner and group, which executes the mount command. This is unfortunately not suitable for a restore, because system files do not always have e.g. root as owner and group.

Is there a way to fix this, so that I can also use rsync to restore files and folders from the mount, that have the correct owner permissions from the backup?

Thanks for your opinions and feedback

Why do you prefer mount + rsync over restore?
restore should do the restore job much faster! Is there any functionality you are missing in restore?

Thanks for your reply.

I think that restore is optimal for full folder backups.
In restore case of only a few files in an folder, restore can`t be used. Message “Folder not empty” comes up. The include- or exclude-pattern is to complicated to match all necessary files.
The only way is to restore the folder to a other new empty folder and copy it with rsync. There are functions like “–ignore-existing or --delete”. A Dry-Run function is important too for me.

This is what I like to see for restic restore or right owner and groups in mount :slight_smile:

1 Like

I think the issue with mount is not a restic issue, but a permission issue of the user who runs restic mount. If I mount with user root, I see the right users and groups.

If you want to just restore some single files, mount (using user root) can be an adequate solution. Keep in mind that access to files in the mounted dir actually means that the content data must be downloaded from the repo which can be expensive e.g for remote repositories. This also holds when using rsync - even when parts of the file in the repo and in the destination match, all data must be read by rsync to find out what actually matches. With single files I guess it’s ok - unless your single files are huge, like e.g. disc image files.

As an alternative you can try rustic restore (see https://forum.restic.net/t/a-restic-client-written-in-rust) which allows to restore single files or dirs, supports restoring to existing content (using what’s there to only restore needed file parts) and has a --delete and --dry-run option.

Hi @rbchris and welcome to the Restic community! :slight_smile:

The restic mount command’s goal is to make all data which is in the snapshots accessible to whoever has access to the repo - which makes sense.
So for you, I only see the restic restore command or similar as the only one/s which 1:1 restores permissions as they were when you made the snapshot. Sorry :confused:

edit: Ah and the restic mount command has some flags you can utilize in the case this would help:

Flags:
      --allow-other              allow other users to access the data in the mounted directory
      --no-default-permissions   for 'allow-other', ignore Unix permissions and allow users to read all snapshot files
      --owner-root               use 'root' as the owner of files and dirs

Thaks all for your feedback and tips.
I think it´s okay by me to restore first into an temporary folder and “merge” missing files to target with rsync.
Fortunately, restorations are not an everyday occurrence and full restore works fine with restore
(except for rclone http GET write errors while restore, but other story and still works) :slight_smile: