Guys
A simple question, say you make a mistake or have a network drive that has not come up to speed or not on line and in the code of fstab you have automount for example:
How can you start the pi to correcct the errors without using fstab
Code: Select all
//[my ip address]/Peter /home/pi/wdmycloud cifs username=[me],password=[guess haha],uid=1000,gid=1000,iocharset=utf8,autofs 0 0Thank you so much for your help, there does not seem to be a definitive answer to this At the moment all I do is to start the pi, wait till the network drive is up and running then run a sudo mount -a command, job done, but really thats not the right answer but it worksepoch1970 wrote:Well, first you can't put what you want in Fstab. This file has a mandatory format because it is being parsed by programs. Fstab is a static file, you can't put a program in it.
Second the program you propose allows to delay boot by 2 seconds. That is not a very powerful remedy to the variety of boot circumstances. For example, what if the file server is powered off?
I would recommend you try and exhaust the possibilities offered by mount options in fstab, select the best combination and then, perhaps, add some secret sauce as a script.
If you add something to /etc/rc.local, this will get executed dead last at boot time. In other words, the system is fully up when rc.local is executed. (But I still don't think it is the place to put a mount. Mounts belong to fstab or to autofs and a handful of other programs.)
Hi again ... I will try to give you an example configuration of an autofs setup... (do the following commands as root user):petepots wrote:Thank you Topguy and MikeDK
Mike I will try what you said, its just if I put on the Pi and network drive at the same time the pi will fire up first, and also if I wanted to do work on the pi and not bother with the network drive I wanted to be sure the pi would continue to boot.
So in the fstab file I put:
Now doing this does not mount the driveCode: Select all
//[my ip address]/Peter /home/pi/wdmycloud cifs username=[me],password=[guess haha],uid=1000,gid=1000,iocharset=utf8,autofs 0 0
Thanks again Guys
Code: Select all
apt-get update
apt-get install autofs
Code: Select all
touch /root/.credentials.peter
chmod 600 /root/.credentials.peter
Code: Select all
username=[me]
password=[guess haha]
Code: Select all
/volume /etc/auto.volume
Code: Select all
nano /etc/auto.volume
Code: Select all
Peter -fstype=cifs,rw,credentials=/root/.credentials.peter ://[my ip address]/Peter
Code: Select all
mkdir /volume
ln -s /volume/Peter /mnt/Peter
service autofs restart