__Plasma__
Posts: 29
Joined: Sat Mar 05, 2016 9:31 pm

Mounting an SMB share at boot not working

Thu Apr 21, 2016 10:05 pm

So I have looked at a few guides at the following URL's:

http://geeks.noeit.com/mount-an-smb-net ... pberry-pi/
https://rasspberrypi.wordpress.com/2012 ... pberry-pi/

I have added it to /etc/fstab and also made a credentials file. Works fine but when I reboot the Pi I still have to issue a manual command get these to mount.:

Code: Select all

sudo mount -a
I tried setting the "wait for network on boot" setting but still fails to auto mount. Is there something I am missing?

Plasma

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

Re: Mounting an SMB share at boot not working

Fri Apr 22, 2016 12:35 am

Assuming you're running Raspbian Jessie...

Try adding

Code: Select all

noauto,x-systemd.automount
to the options.
AIUI it delays mounting until it is accessed.

For more info on this search the forum for these options

__Plasma__
Posts: 29
Joined: Sat Mar 05, 2016 9:31 pm

Re: Mounting an SMB share at boot not working

Sat Apr 23, 2016 3:47 pm

DirkS wrote:Assuming you're running Raspbian Jessie...

Try adding

Code: Select all

noauto,x-systemd.automount
to the options.
AIUI it delays mounting until it is accessed.

For more info on this search the forum for these options
Thanks DirkS, that looks to have done the trick I simply added x-systemd.automount to the line in fstab and all looks to be working fine now.

Code: Select all

//192.168.2.1/Multimedia /media/Plasmas-NAS/Multimedia cifs credentials=/home/pi/.smbcredentials,uid=1000,gid=1000,x-systemd.automount 0 0
Kind Regards

Plasma

JimmyN
Posts: 1109
Joined: Wed Mar 18, 2015 7:05 pm
Location: Virginia, USA

Re: Mounting an SMB share at boot not working

Sat Apr 23, 2016 5:50 pm

Including the "noauto" option stops any automounting of the share by fstab. That includes using "sudo mount -a" which won't work if you've included the "noauto" option in the fstab line. You'll have to use a manual mount command.

By not including "noauto" you will get a failed mount error in the log every time it boots, since fstab will try to automount it and fail, even though systemd will be mounting it later. But you can ignore the failed mount message, and you can still use a "sudo mount -a" command.

__Plasma__
Posts: 29
Joined: Sat Mar 05, 2016 9:31 pm

Re: Mounting an SMB share at boot not working

Sat Apr 23, 2016 6:35 pm

JimmyN wrote:By not including "noauto" you will get a failed mount error in the log every time it boots, since fstab will try to automount it and fail, even though systemd will be mounting it later. But you can ignore the failed mount message, and you can still use a "sudo mount -a" command.
Thanks for the extra info, I'll take those points in to consideration and will more than likely add the noauto option too.

Plasma

Return to “Advanced users”