douglas5962
Posts: 28
Joined: Thu Mar 29, 2018 2:22 pm

Auto mounting network drive

Sun May 13, 2018 9:48 pm

I'm having issues getting my network drive to automatically mount on my RPi 3B+ and could use some input from the community... Most of the articles out on the internet seem to be several years old and before the SMB vulnerabilities. I've made so many attempts I finally had to re-imaged my SD card.

Here's my setup: Synology Diskstation running DSM 6.1 with SMB2, SMB3 and AFP enabled... SMB1 and NFS are disabled. I have set up a separate username and password for the RPi to use for the one folder I am trying to mount so hiding the password isn't an issue. The RPi has a fresh copy of Stretch installed.

What would be most reliable way to get a network folder auto mounted?

donbrew
Posts: 53
Joined: Sun Sep 04, 2016 2:32 pm

Re: Auto mounting network drive

Tue May 15, 2018 7:50 pm

One way to do it is by systemd create a service, There is a tut somewhere around here that I am currently looking for again.

Ah-ha; found one of them: [urlhttps://discourse.osmc.tv/t/how-to-use-systemd-to-mount-remote-shares/38190][/url]

DirkS
Posts: 9957
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Auto mounting network drive

Tue May 15, 2018 8:12 pm

donbrew wrote:
Tue May 15, 2018 7:50 pm
One way to do it is by systemd create a service, There is a tut somewhere around here that I am currently looking for again.

Ah-ha; found one of them: https://discourse.osmc.tv/t/how-to-use- ... ares/38190
I managed to do it using https://blog.tomecek.net/post/automount-with-systemd/

drmullins
Posts: 43
Joined: Fri Jun 23, 2017 9:22 pm

Re: Auto mounting network drive

Wed May 16, 2018 7:33 am

I have been using autofs to mount samba shares on my Synology DS215J for the last two years

/etc/auto.master contains :
/media/mycifs /etc/auto.sambashares --timeout=7200 --ghost

/etc/auto.sambashares contains :
ds215j -fstype=cifs,rw,uid=${UID},guest,vers=2.0 ://DS215J/PUBLIC
ds215jusb -fstype=cifs,rw,uid=${UID},username=homeuser,password=mypassword,vers=2.0 ://DS215J/usbshare1

My main server uses guest access as you can see. However my external drive plugged into the server uses a username and password and I think a line like this would be applicable if a username and password are required for access to the main server.

Before updating stretch to the 4.14 kernel I did not have to specify the version number with vers=2.0. I think this is needed now because stretch defaults to samba 2.1 rather than samba 1.0 as previously

Return to “Raspbian”