SOLVED How do you mount a SMB-Share on a Pi

Mike77

Contributor
Joined
Nov 15, 2014
Messages
193
Hi,

Question. How do you mount a dataset from an FreeNas server on a Pi, running the newest version of Raspbian?
I think I can get the share mounted, but then I can't read write to the directory...

I've tried the following:

I've created the new dataset on my server, and called it datasets.
The permissions on the new dataset are set as follows:

Change permission on /mnt/HS33-NAS/datasets to:
Apply Owner (user): checked
Owner (user): v1
Apply Owner (group): checked
Owner (group): v1
Apply Mode: checked
Mode: everything checked
Permission Type: Windows
Set permissions recursively: checked

I've mapped the network drive on a Windows 10 machine and it works. I've also checked the permissions through the Windows machine and they are correct.

The owner "v1" is one of three users in group "v1". I've created a new user for the pi, called pi and using the same password as for the pi user account.

I've tried to mount the share on my pi. I first created a new sub directory called "datasets" in the pi directory. I then tried to mount the share using the following command: sudo mount -t cifs -o username=pi,password=raspbian //192.168.2.3/datasets datasets

This seemed to work, but for some reason I don't have permission to edit/create files on the share.

Can anyone help me with this?
 

garyn_87048

Dabbler
Joined
Feb 11, 2013
Messages
23
Hi Mike77!

Did you figure this out? I'm having the same issue on my setup now. I can read files, but I can't write or edit files without sudo. I'm not sure if this is on the Raspberry Pi setup or on the truenas/pool side.

I'm hoping to draft off of your insights!
 

Mike77

Contributor
Joined
Nov 15, 2014
Messages
193
Yes I dus, but I don't remember how I did it, and don't have any Linux machines at the moment. I'm sorry.

But I do remember that the solution had something to do with the uid and the gid of the user on Linux and the user on the freenas machine. I gelieve they had to be the same. And the version of samba Aldi had to be correct.

That's all about what van remember. Sorry that I can't help you any further.
 

garyn_87048

Dabbler
Joined
Feb 11, 2013
Messages
23
Yes, thank you Mike, that was the correct hint!

In case this is useful to anyone else having trouble giving their Raspberry Pi write access (read access worked fine!) to their home NAS, assuming that no obvious privileges are missing inside truenas, the issue is on the Pi side. In /etc/fstab add uid=1000,gid=1000. 1000,1000 is the default Pi account setup. Then, reboot the Pi (a "$ sudo mount -a" did not work, but the reboot did work).
 
Top