Connect pi to NAS ( Pi running SAMBA)

I have a Raspbery Pi 4 which is running SAMBA and is sharing 3 drived, one is a directory on the micro sd card, (piTEMP) one is USB flash drive (piLAB) and the other is a USB mass storage drive (piNAS. I have many Pi’s ( running graphical desktop)and windows machines on my network. I want to be able to have transparent access RW see the shared folders on all of my PIs as well as my windows machines. How do I set up the PI’s so that they all permanently share the dirves.

Hi Clem,

What you’re looking for is mounting the drives automatically.

  • Make sure your NAS has a static IP
  • Windows machines can use Map as Network Drive and have it show up transparently
  • Linux machines can auto-mount things by putting them in the fstab or File System TABle, there are some extra steps, that someone has kindly explained here: Proper fstab entry to mount a samba share on boot? - Ask Ubuntu

Let us know if that works for you :slight_smile:

I found this vider very useful:

This works on the Pi’s, but I am unable to relibly connect to the shared network drives from windows machine running virtual box, one works but not the others, when trying to map drive i get the error:
windows cannot access \192.168…\piNAS
You do not have permission to access \192…\piNAS
Contact your network administrator to request access.
still burning up time trying to find out why - I am trying to connect to all shared drives in the same way.

Hi Clem,

The good news is that your error message basically means what it says on the tin.

The credentials you entered on the Windows machine were not allowed to access the share on the Pi. More info below:
https://www.samba.org/samba/docs/using_samba/ch09.html

If you don’t care about the security of your files at all, you can create a public share with no authentication required. e.g.

[public]
path = /home/share
public = yes
guest only = yes
writable = yes
force create mode = 0666
force directory mode = 0777
browseable = yes

Hope this helps!