# Mount smb/cifs as datasource does not work in v4.2.2

**URL:** <https://forum.pydio.com/t/mount-smb-cifs-as-datasource-does-not-work-in-v4-2-2/5361>\
**Category:** Pydio Cells\
**Created:** [June 21, 2023, 8:04pm UTC](https://forum.pydio.com/t/mount-smb-cifs-as-datasource-does-not-work-in-v4-2-2/5361 "2023-06-21T20:04:06Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![jaimedelano](https://yyz2.discourse-cdn.com/flex032/user_avatar/forum.pydio.com/jaimedelano/32/2342_2.png) [@jaimedelano](https://forum.pydio.com/u/jaimedelano)\
**Post date:** [June 24, 2023, 1:53am UTC](https://forum.pydio.com/t/mount-smb-cifs-as-datasource-does-not-work-in-v4-2-2/5361/8 "2023-06-24T01:53:34Z")

</div>

**Enable cross-device rename** and rebuild the Cells binary.  
Edit the file /home/pydio/cells/minio/cmd/os-reliable.go  
**Go to line 21, locate**

```auto
import (
	"fmt"
	"os"
	"path"
)

```

**Replace it with**

```auto

import (
	"fmt"
	"os"
	"io"
	"path"
)

```

**Go to line 146, locate**

```auto

		case isSysErrCrossDevice(err):
			return fmt.Errorf("%w (%s)->(%s)", errCrossDeviceLink, srcFilePath, dstFilePath)

```

**Replace it with**

```auto

		case isSysErrCrossDevice(err):
			if err = MoveFile(srcFilePath, dstFilePath); err != nil {
				fmt.Println(err.Error())
				return fmt.Errorf("%w (%s)->(%s)", errCrossDeviceLink, srcFilePath, dstFilePath)
			}

```

**At the end of the file, create this new function**

```auto
func MoveFile(sourcePath, destPath string) error {
    inputFile, err := os.Open(sourcePath)
    if err != nil {
        return fmt.Errorf("Couldn't open source file: %s", err)
    }
    outputFile, err := os.Create(destPath)
    if err != nil {
        inputFile.Close()
        return fmt.Errorf("Couldn't open dest file: %s", err)
    }
    defer outputFile.Close()
    _, err = io.Copy(outputFile, inputFile)
    inputFile.Close()
    if err != nil {
        return fmt.Errorf("Writing to output file failed: %s", err)
    }
    // The copy was successful, so now delete the original file
    err = os.Remove(sourcePath)
    if err != nil {
        return fmt.Errorf("Failed removing original file: %s", err)
    }
    return nil
}

```

**Run _make_ again**

---

_[View the full topic](https://forum.pydio.com/t/mount-smb-cifs-as-datasource-does-not-work-in-v4-2-2/5361)._
