Issue with NAS mount write permissions

Hello all,

I’m having some troubles related to mounting my NAS shares. I’m pretty sure it’s a permissions issue, though. I’ve edited my fstab to include the shares (both SMB shares) and to mount them both to the /mnt directory. See below:

#network drives
//192.168.88.3/dead /mnt/dead cifs credentials=/home/jon/.nascreds,iocharset=utf8   0       0
//192.168.88.3/z1 /mnt/z1 cifs credentials=/home/jon/.nascreds,iocharset=utf8   0       0

I followed a guide to handle the creds and modify my fstab, so there might be a problem with that. Everything shows up fine in my file manager, and I’m able to read all of the files in both shares. However, I can only write in the directories if I open the file manager as an administrator. I’ve tried adding “rw” and “defaults,rw” as options in my fstab, neither of those worked. Looking around it seems like I just need to give my user (jon) write permissions, but I’m not sure if that’s right and if so, I’m not sure the correct way to do that. I would appreciate any help if possible! Please let me know if there’s any other information needed to help troubleshoot. :slight_smile:

Add uid=username,gid=username to the options.

Replace “username” with your actual username.

That being said, I recommend using a systemd automount for network connections.

Something like this:

x-systemd.automount,x-systemd.idle-timeout=1min,rw,uid=username,gid=username,credentials=/home/jon/.nascreds,iocharset=utf8,vers=2.0 0 0

Also, make sure you have secured the file /home/jon/.nascreds

1 Like

This did the trick, thanks! Can I ask why you recommend using a systemd automount for network connections? This is the first I’m hearing of it and I’d just like to learn more. Is the code you shared after mentioning that something that would go in the fstab file as well? I found a few posts about doing things this way I’m planning to read tomorrow, but I’d appreciate your thoughts too or a link if you’ve got one handy. Thank you!!

If I understand @dalto’s reasoning, the NAS being a remote filesystem, and non-essential to the boot process, only needs to really be mounted when accessed, as opposed to immediately.

See here about tips and tricks for mounting remote file systems.

If you want them to be mounted only upon access, you will need to use the x-systemd.automount parameters.

If your NAS was off (or in some state of unreadiness), you wouldn’t want your PC’s boot to fail as a result.

Because network drives aren’t always available. It avoids having long timeouts and other instability if your network or NAS is not available.

Yes, it would replace all the options you have now.

Sorry for the delay. Makes a lot of sense about the network drives and possibly not being ready. I think I got this working but want to just triple check - this is what my fstab looks like with the systemd automount instead:

//192.168.88.3/z1 /mnt/z1 cifs x-systemd.automount,x-systemd.idle-timeout=1min,rw,uid=jon,gid=jon,credentials=/home/jon/.nascreds,iocharset=utf8,vers=2.0 0 0

If everything looks good I’ll mark this resolved, thanks again for the advice guys!

Looks good to me.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.