Raspberry Pi, Arduino, Sensors and the data they produce

Attaching a Samba Share at Startup / fstab

Working through the efforts to install my Raspberry Pi (RPi) with camera and  pi-timolo, I ran across a problem getting attached to the SAMBA share on the PiNAS, before the application starts up and then tries to send pictures to the share.  Remember that the base instructions show how to set the program to start on boot (  init.d & update-rc.d setup ), but I was finding I had a failure to write due to the fact that the NAS share was not in my mounted devices list.

I found several sources on the web where people were updating their fstab to mount the drive on boot.  But when I rebooted the RPi, then queried with ‘df -h’, my NAS share would not show up. I could force a manual mount (‘sudo mount -a) and it worked. I researched through google, and found several pieces of advice, but nothing seemed to work for my specific situation.  Then I came across this page mount through fstab which had the information that matched my environment exactly.

So, I edit /etc/fstab (make sure you make a backup first!!!)

Adding this line (change to match your environment):

//  /home/pi/pi-timolo/MyNAS cifs guest,_netdev

cifs is the notation the refers to a Samba share; guest in my case is the credentials for a share that is completely open (not recommenced)  and the key component that fixed my problem: ‘_netdev‘, which tells the system to wait for the network binding to connect before trying to attach to the NAS.

This worked for me, your mileage may vary!


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: