diff --git a/cmd/restic/cmd_mount.go b/cmd/restic/cmd_mount.go index eb86cbada..96f217880 100644 --- a/cmd/restic/cmd_mount.go +++ b/cmd/restic/cmd_mount.go @@ -196,12 +196,12 @@ func runMount(ctx context.Context, opts MountOptions, gopts global.Options, args PathTemplates: opts.PathTemplates, } root := fuse.NewRoot(repo, cfg) - - printer.S("Now serving the repository at %s", mountpoint) - printer.S("Use another terminal or tool to browse the contents of this folder.") - printer.S("When finished, quit with Ctrl-c here or umount the mountpoint.") - - debug.Log("serving mount at %v", mountpoint) + // load repository before reporting the mountpoint + printer.S("Loading snapshots...") + _, err = root.ReadDirAll(ctx) + if err != nil { + return err + } done := make(chan struct{}) @@ -210,6 +210,11 @@ func runMount(ctx context.Context, opts MountOptions, gopts global.Options, args err = fs.Serve(c, root) }() + printer.S("Now serving the repository at %s", mountpoint) + printer.S("Use another terminal or tool to browse the contents of this folder.") + printer.S("When finished, quit with Ctrl-c here or umount the mountpoint.") + debug.Log("serving mount at %v", mountpoint) + select { case <-ctx.Done(): debug.Log("running umount cleanup handler for mount at %v", mountpoint)