philspitler
Posts: 17
Joined: Thu Apr 07, 2016 5:17 am

Mount at boot

Wed Apr 13, 2016 6:32 am

Hi,
I want to mount my network share at boot time.

Currently, after I boot I need to run.

sudo mount -a

to mount the share.

Is there a way to do this automatically?

Cheers.

Phil

ghans
Posts: 7882
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: Mount at boot

Wed Apr 13, 2016 7:07 am

Are you running Raspbian Jessie ?
What kind of share is it ? NFS ? Windows File Sharing/SMB/CIFS ?

Show us the contents of your /etc/fstab.


ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

philspitler
Posts: 17
Joined: Thu Apr 07, 2016 5:17 am

Re: Mount at boot

Wed Apr 13, 2016 5:01 pm

My fstab looks like this.

Code: Select all

proc            /proc           proc    defaults          0       0
/dev/mmcblk0p6  /boot           vfat    defaults          0       2
/dev/mmcblk0p7  /               ext4    defaults,noatime  0       1
# a swapfile is not a swap partition, no line here
#   use  dphys-swapfile swap[on|off]  for that

//192.168.1.45/Two_Terror /SMB cifs username=philspitler,password=xxxxxxxxx,uid=1000,gid=1000,iocharset=utf8 0 0
I am mounting an SMB folder and am using Debian.

I hope this helps.

Thanks.

Phil

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

Re: Mount at boot

Wed Apr 13, 2016 5:20 pm

Add this to your fstab line and hand it off to systemd, which will wait to mount it until first access, and by then the network will be ready.

Code: Select all

//192.168.1.45/Two_Terror /SMB cifs username=philspitler,password=xxxxxxxxx,uid=1000,gid=1000,iocharset=utf8,x-systemd.automount 0 0

Return to “Troubleshooting”