# Read/Write access denied with mounted drives?

**URL:** https://dietpi.com/forum/t/read-write-access-denied-with-mounted-drives/2529
**Category:** Troubleshooting
**Created:** [4 September 2018 17:43 UTC](https://dietpi.com/forum/t/read-write-access-denied-with-mounted-drives/2529 "2018-09-04T17:43:26Z")
**Posts on this page:** 1
**Showing post:** 20

<div class="post-metadata">

### Author: ![MichaIng](https://dietpi.com/forum/user_avatar/dietpi.com/michaing/32/7_2.png) [@MichaIng](https://dietpi.com/forum/u/MichaIng)
#### Post date: [16 September 2018 12:49 UTC](https://dietpi.com/forum/t/read-write-access-denied-with-mounted-drives/2529/20 "2018-09-16T12:49:34Z")

</div>

finch\_6 Fourdee  
I found a solution 🕶:

```nohighlight
sed -i 's/,iocharset=utf8,vers=/,iocharset=utf8,uid=dietpi,gid=dietpi,file_mode=0770,dir_mode=0770,vers=/g' /etc/fstab
umount /mnt/samba
mount -a
ls -al /mnt/samba

```

_NB: Replace **/mnt/samba** with the actual mount location._  
The above sets user (uid) and group (gid), as well as global file and directory permissions for the whole samba share.  
**dietpi:dietpi 770** should allow r/w access for Sonarr and such, as these software titles run as their own user, but as **dietpi** group.  
umount and remount is needed to apply the changes, then check via **ls -al**.  
Somehow external guides mention that as well Samba server side there need to be changes done, but it worked here to create a totally new user, set it as uid+gid, remount and access + create files with this user within the mount.

Fourdee  
I think we should set this as default for samba mounts, to allow access for our download and media software?  
I am going to find out how to achieve the same for nfs mounts.

---

_[View the full topic](https://dietpi.com/forum/t/read-write-access-denied-with-mounted-drives/2529)._
