# ERROR file not owned by user

**URL:** <https://discuss.dvc.org/t/error-file-not-owned-by-user/564>\
**Category:** Questions\
**Created:** [November 27, 2020, 4:23pm UTC](https://discuss.dvc.org/t/error-file-not-owned-by-user/564 "2020-11-27T16:23:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![iNLyze](https://avatars.discourse-cdn.com/v4/letter/i/b19c9b/32.png) [@iNLyze](https://discuss.dvc.org/u/iNLyze)\
**Post date:** [November 27, 2020, 4:23pm UTC](https://discuss.dvc.org/t/error-file-not-owned-by-user/564/1 "2020-11-27T16:23:27Z")

</div>

On `dvc add --external /mnt/my_storage` I am getting `ERROR: file '../../../../mnt/my_storage/data.csv' not owned by user!`

I have machine\_1 with a project I am working under git control and dvc initialized.  
Machine\_2 is a remote file server on the same network mounted to /mnt/my\_storage/ via samba. I’d like to keep the training data on /mnt/my\_storage, but track it in DVC.

Expected behaviour:  
dvc hashes all files in /mnt/my\_storage and creats a my\_storage.dvc in my project folder.

Actual behaviour:  
Files in one subdirectory are hashed and in another I am getting above mentioned error.

The files on machine\_2 are owned by a different user, but I have write access to /mnt/my\_storage on file system level.

What is this error telling me?

---

<div class="post-metadata">

**Author:** ![jorgeorpinel](https://yyz1.discourse-cdn.com/flex035/user_avatar/discuss.dvc.org/jorgeorpinel/32/46_2.png) [@jorgeorpinel](https://discuss.dvc.org/u/jorgeorpinel)\
**Post date:** [November 27, 2020, 6:20pm UTC](https://discuss.dvc.org/t/error-file-not-owned-by-user/564/2 "2020-11-27T18:20:16Z")

</div>

> [@iNLyze](#):
>
> Machine\_2 is a remote file server on the same network mounted to /mnt/my\_storage/ via samba.

I’m not too familiar with SMB so can’t tell you exactly how or if it’s possible to fix the Linux permissions but I can tell you what’ happening:

To DVC /mnt/ is just another local path so it tries to move the add targets to your local DVC cache, and then link them back to their original position (mechanism explained in [add](https://dvc.org/doc/command-reference/add)). I guess we need to own them in order to do all that.

A possible workaround is to change your project link types (`cache.type`) and see if other kinds of linking works. See [config](https://dvc.org/doc/command-reference/config#cache)

Another thing you may want to do is to setup your cache external to the project, somewhere in the SMB mount. Otherwise you aren’t really keeping those files outside of your local fs. Please see [https://dvc.org/doc/use-cases/shared-development-server#configure-the-external-shared-cache](https://dvc.org/doc/use-cases/shared-development-server#configure-the-external-shared-cache).

> [@iNLyze](#):
>
> Files in one subdirectory are hashed and in another I am getting above mentioned error.

What directory is that one? The one that works. Is it also in the SMB mount?

> [@iNLyze](#):
>
> I have write access to /mnt/my\_storage on file system level

Which file system are you referring to here? You mean you make files and directories in /mnt/my\_storage/xyz? Those would be owned by you but pre-existing files are still not under your full control.

---

<div class="post-metadata">

**Author:** ![iNLyze](https://avatars.discourse-cdn.com/v4/letter/i/b19c9b/32.png) [@iNLyze](https://discuss.dvc.org/u/iNLyze)\
**Post date:** [December 2, 2020, 3:35pm UTC](https://discuss.dvc.org/t/error-file-not-owned-by-user/564/3 "2020-12-02T15:35:07Z")

</div>

Thanks, I’ll follow-up on your suggestions and if I find a solution I’ll post it here.
