{"record":{"id":"c92483574e904077","repo":"juicedata/juicefs","slug":"the-clone-dst-path-should-be-at-the-same-mount-poi","errorCode":null,"errorMessage":"the clone DST path should be at the same mount point as the SRC path","messagePattern":"the clone DST path should be at the same mount point as the SRC path","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/clone.go","lineNumber":103,"sourceCode":"\t\treturn fmt.Errorf(\"%s already exists\", dst)\n\t} else if !os.IsNotExist(err) {\n\t\treturn fmt.Errorf(\"stat %s: %s\", dst, err)\n\t}\n\tdstAbsPath, err := filepath.Abs(dst)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"abs of %s: %s\", dst, err)\n\t}\n\n\tsrcMp, err := findMountpoint(srcAbsPath)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdstMp, err := findMountpoint(filepath.Dir(dstAbsPath))\n\tif err != nil {\n\t\treturn err\n\t}\n\tif srcMp != dstMp {\n\t\treturn fmt.Errorf(\"the clone DST path should be at the same mount point as the SRC path\")\n\t}\n\tif strings.HasPrefix(dstAbsPath, path.Clean(srcAbsPath)+\"/\") {\n\t\treturn fmt.Errorf(\"the clone DST path should not be under the SRC path\")\n\t}\n\n\tdstParent := filepath.Dir(dstAbsPath)\n\tdstName := filepath.Base(dstAbsPath)\n\tdstParentIno, err := utils.GetFileInode(dstParent)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"lookup inode for %s: %s\", dstParent, err)\n\t}\n\tvar cmode uint8\n\tumask := utils.GetUmask()\n\tif ctx.Bool(\"preserve\") || runtime.GOOS == \"windows\" {\n\t\tcmode |= meta.CLONE_MODE_PRESERVE_ATTR\n\t}\n\tthreads := ctx.Int(\"threads\")\n\tif threads < 1 {","sourceCodeStart":85,"sourceCodeEnd":121,"githubUrl":"https://github.com/juicedata/juicefs/blob/c9a67b23e8e08ec23ec331aa6f1675e2319e921c/cmd/clone.go#L85-L121","documentation":"JuiceFS clone is a server-side (metadata-only) copy: the FUSE mount sends a Clone control message for two inodes, so SRC and DST must live under the same JuiceFS mount point. The command discovers the mount point of SRC and of DST's parent by walking up inodes; if they differ it refuses to run, because a control message can only target one mount.","triggerScenarios":"Running `juicefs clone /mnt/jfsA/src /mnt/jfsB/dst` (two different JuiceFS volumes), or DST in a plain directory outside any JuiceFS mount while SRC is inside one (findMountpoint for DST then errors first with 148, but two distinct JuiceFS mounts hit this error directly).","commonSituations":"Two volumes mounted at /mnt/jfs-prod and /mnt/jfs-backup; copying between environments; DST under a nested second mount (e.g. another JuiceFS bind-mounted inside the first); user expects cp-like cross-filesystem behavior.","solutions":["Clone to a DST path under the same mount point as SRC","For cross-volume copies, use `juicefs sync` or `cp -r` instead of clone","Check mounts with `juicefs status` / `mount | grep juicefs` and confirm both paths resolve to the same mountpoint","If a nested mount is shadowing the intended path, unmount it or pick a different DST"],"exampleFix":"// before\njuicefs clone /mnt/jfs-prod/file1 /mnt/jfs-backup/file1\n// after\njuicefs sync /mnt/jfs-prod/file1 /mnt/jfs-backup/file1   # or clone within one mount\njuicefs clone /mnt/jfs-prod/file1 /mnt/jfs-prod/file1.copy","handlingStrategy":"validation","validationCode":"if filepath.Dir(absDst) is not under the same juicefs mountpoint as absSrc {\n    return errors.New(\"clone requires SRC and DST on the same JuiceFS mount\")\n}","typeGuard":null,"tryCatchPattern":"if err := runClone(src, dst); strings.Contains(err.Error(), \"same mount point\") {\n    // fall back to `juicefs sync` or plain copy for cross-volume transfer\n}","preventionTips":["Check `mount | grep juicefs` to confirm both paths share one mountpoint","Use `juicefs sync` for cross-volume copies by design","Beware nested mounts shadowing subpaths of the destination","Document mount topology for CI scripts that clone"],"tags":["cli","filesystem","mount-point","constraint"],"backgroundTag":"invalid-argument-value","analyzedSha":"c9a67b23e8e08ec23ec331aa6f1675e2319e921c","analyzedAt":"2026-09-06T17:55:48.476Z","contentChangedAt":"2026-09-06T17:55:48.476Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}