diff --git a/changelog/unreleased/issue-4868 b/changelog/unreleased/issue-4868 new file mode 100644 index 000000000..001f7618b --- /dev/null +++ b/changelog/unreleased/issue-4868 @@ -0,0 +1,14 @@ +Enhancement: Include repository id in filesystem name used by `mount` + +The filesystem created by restic's `mount` command now includes the repository +id in the filesystem name. The repository id is printed by restic when opening +a repository or can be looked up using `restic cat config`. + +``` +[restic-user@hostname restic]$ df ./test-mount/ +Filesystem 1K-blocks Used Available Use% Mounted on +restic:d3b07384d1 0 0 0 - /mnt/my-restic-repo +``` + +https://github.com/restic/restic/issues/4868 +https://github.com/restic/restic/pull/5243 \ No newline at end of file diff --git a/cmd/restic/cmd_mount.go b/cmd/restic/cmd_mount.go index 15760c6b7..d2c905460 100644 --- a/cmd/restic/cmd_mount.go +++ b/cmd/restic/cmd_mount.go @@ -5,6 +5,7 @@ package main import ( "context" + "fmt" "os" "strings" "time" @@ -148,9 +149,11 @@ func runMount(ctx context.Context, opts MountOptions, gopts GlobalOptions, args return err } + fuseMountName := fmt.Sprintf("restic:%s", repo.Config().ID[:10]) + mountOptions := []systemFuse.MountOption{ systemFuse.ReadOnly(), - systemFuse.FSName("restic"), + systemFuse.FSName(fuseMountName), systemFuse.MaxReadahead(128 * 1024), }