Page 1 of 1

Delay /etc/fstab connection

Posted: Wed Nov 11, 2015 4:48 pm
by bkenobi
I am running a RPi B v1 as a home automation server running HomeGenie. I have a windows XP system set up as a file server. I have the RPi configured to write log files out to a log dirctory that is mounted on the file server which is connected the the RPi via SAMBA and mounted via/etc/fstab.

This works fine in general, but there is one situation where I have issues. Both the file server and RPi are behind UPS's. When we have a power failure for more than 30 minutes or so, the file server shuts down followed by the RPi at around 60 minutes. When the power comes back online, everything comes back online. However, the RPi boots much quicker than the file server, so the log path doesn't mount correctly.

The options I see are:
Stop logging
Add USB hub and flash drive for logging
Delay mounting the drive

Any suggestions?

Re: Delay /ect/fstab connection

Posted: Thu Nov 12, 2015 8:19 am
by lmarmisa

Re: Delay /ect/fstab connection

Posted: Thu Nov 26, 2015 2:38 am
by bkenobi
I'll do some reading on autofs, thanks.

One related question I have is about a working setup that stopped working when I updated to a newer Wheezy installation. I have the following in my /etc/fstab and it works correctly on an older raspian image:

Code: Select all

\\server\path /usr/local/bin/homegenie/log cifs
I tried that as well as other variants on wheezy 5/5/15 and it doesn't work.

Code: Select all

//server/path /usr/local/bin/homegenie/log cifs guest 0 0
I initially thought it was an issue with slash versus backslash but nothing seems to get the path linked until I run "sudo mount -a"

Re: Delay /ect/fstab connection

Posted: Thu Nov 26, 2015 7:16 am
by Lorux
i got a similar issue,fstabbed a remote ftp folder.
got my pi plugged to my router usb for power,when there's a power failure they both turn off,when power comes back they both boot but the router needs more time to be connected to internet,so the pi cant mount the ftp folder.
i did this in

Code: Select all

sudo crontab -e 

Code: Select all

@reboot sleep 300; mount -a

Re: Delay /etc/fstab connection

Posted: Thu Nov 26, 2015 10:41 am
by DougieLawson
If you don't want to mount a filesystem until you're ready, don't put it in /etc/fstab. Use a command prompt and type it in, or write a bash script (which can run from a *.desktop file).

Re: Delay /etc/fstab connection

Posted: Thu Nov 26, 2015 10:49 am
by rpdom
DougieLawson wrote:If you don't want to mount a filesystem until you're ready, don't put it in /etc/fstab. Use a command prompt and type it in, or write a bash script (which can run from a *.desktop file).
Actually, do put it in the fstab file, but with the "noauto" option. That will make the mount command as simple as "mount <mountpoint>" or "mount <devicename>".

Re: Delay /etc/fstab connection

Posted: Thu Nov 26, 2015 12:16 pm
by DougieLawson
rpdom wrote:
DougieLawson wrote:If you don't want to mount a filesystem until you're ready, don't put it in /etc/fstab. Use a command prompt and type it in, or write a bash script (which can run from a *.desktop file).
Actually, do put it in the fstab file, but with the "noauto" option. That will make the mount command as simple as "mount <mountpoint>" or "mount <devicename>".
Fair comment. You should be able to build that into a *.desktop file with no script needed.

Code: Select all

[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Exec="sudo mount /stuff"
Terminal=false
Name=Mount stuff