From 0606b59a3e546ee5a2b1d777350dbe5e2529b8b5 Mon Sep 17 00:00:00 2001 From: chrislu Date: Fri, 7 Jul 2023 09:30:32 -0700 Subject: [PATCH] mount: create mount root on filer fix https://github.com/seaweedfs/seaweedfs-csi-driver/issues/127 --- weed/command/mount_std.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/weed/command/mount_std.go b/weed/command/mount_std.go index 5f67bbad3..dff53f25e 100644 --- a/weed/command/mount_std.go +++ b/weed/command/mount_std.go @@ -241,6 +241,14 @@ func RunMount(option *MountOptions, umask os.FileMode) bool { DisableXAttr: *option.disableXAttr, }) + // create mount root + mountRootPath := util.FullPath(mountRoot) + mountRootParent, mountDir := mountRootPath.DirAndName() + if err = filer_pb.Mkdir(seaweedFileSystem, mountRootParent, mountDir, nil); err != nil { + fmt.Printf("failed to create dir %s on filer %s: %v\n", mountRoot, filerAddresses, err) + return false + } + server, err := fuse.NewServer(seaweedFileSystem, dir, fuseMountOptions) if err != nil { glog.Fatalf("Mount fail: %v", err)