aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchrislu <chris.lu@gmail.com>2023-07-07 09:30:32 -0700
committerchrislu <chris.lu@gmail.com>2023-07-07 09:30:32 -0700
commit0606b59a3e546ee5a2b1d777350dbe5e2529b8b5 (patch)
treea7c1714ee08a4122d9a1fbc785257bcf3a4e8482
parent14546f0ad8c8bbae4d6da003d171c9e6894570fe (diff)
downloadseaweedfs-0606b59a3e546ee5a2b1d777350dbe5e2529b8b5.tar.xz
seaweedfs-0606b59a3e546ee5a2b1d777350dbe5e2529b8b5.zip
mount: create mount root on filer
fix https://github.com/seaweedfs/seaweedfs-csi-driver/issues/127
-rw-r--r--weed/command/mount_std.go8
1 files changed, 8 insertions, 0 deletions
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)