mirror of
https://github.com/restic/restic.git
synced 2025-04-22 13:31:28 +00:00
Merge pull request #5243 from zmanda/feat-gh-4868-show-repo-id-in-df-and-mount
mount: append the repository ID to the name of the FUSE mount
This commit is contained in:
commit
0dffa1208d
14
changelog/unreleased/issue-4868
Normal file
14
changelog/unreleased/issue-4868
Normal file
@ -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
|
@ -5,6 +5,7 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
@ -148,9 +149,11 @@ func runMount(ctx context.Context, opts MountOptions, gopts GlobalOptions, args
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fuseMountName := fmt.Sprintf("restic:%s", repo.Config().ID[:10])
|
||||||
|
|
||||||
mountOptions := []systemFuse.MountOption{
|
mountOptions := []systemFuse.MountOption{
|
||||||
systemFuse.ReadOnly(),
|
systemFuse.ReadOnly(),
|
||||||
systemFuse.FSName("restic"),
|
systemFuse.FSName(fuseMountName),
|
||||||
systemFuse.MaxReadahead(128 * 1024),
|
systemFuse.MaxReadahead(128 * 1024),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user