Page 1 of 1

Mount at boot

Posted: Wed Apr 13, 2016 6:32 am
by philspitler
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

Re: Mount at boot

Posted: Wed Apr 13, 2016 7:07 am
by ghans
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

Re: Mount at boot

Posted: Wed Apr 13, 2016 5:01 pm
by philspitler
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

Re: Mount at boot

Posted: Wed Apr 13, 2016 5:20 pm
by JimmyN
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