fstab is not mounting the NAS folders

In my /etc/fstab file In have: //192.168.0.22/mnt/CCTV/xeoma /mnt/CCTV/xeoma cifs credentials=/home/pi/.smbclient,uid=pi 0 0

I had to reboot the pi earlier today, and now have found that the cctv footage is not being sent to my NAS CCTV/xeoma folder.

On checking it was being sent direct to the pi folders, so I did a sudo mount -a -vvv and the NAS CCTV/xeoma folder was then mounted.

I thought that the fstab file would do this automatically, as it does in linux ubuntu.

Maybe I'm wrong??

Reply to
RobH
Loading thread data ...

Systemd has meant that things that happened sequentially and reliably now happen in parallel. I have found that network stuff seems to want to mount before the network is up

In one machine using wifi I attached a script to the end of the user intialisation that did a 'mount -a' to fix this

--
Truth welcomes investigation because truth knows investigation will lead  
to converts. It is deception that uses all the other techniques.
Reply to
The Natural Philosopher

That sounds like I'm going to do that after each reboot.

Reply to
RobH

For Slackware (non systemd) and my R-PI 2B (also still happily non systemd) that's how it works, if it's mentioned in /etc/fstab, it's auto mounted.

Unless you add "noauto" to the options ...

Unless a remote file system (e.g. NFS mount, NAS) was asleep/powered down/ not on the network etc. at the time of the PI booting, in which case it would have failed (and won't automatically retry).

You've got systemd now, no idea what that does about it :)

--
--------------------------------------+------------------------------------ 
Mike Brown: mjb[-at-]signal11.org.uk  |    http://www.signal11.org.uk
Reply to
Mike

It will need to be told that this particular filesystem shouldn't be mounted before the network is up. That may happen automatically.

However, my experience of systemd has been that if it tries to mount a networked filesystem before the network is up, it will spot the failure and happily hang the entire system rather than let you get in and fix it.

Reply to
Roger Bell_West

Basically then from what people have said, the fstab file doesn't mount any folders untill the network is up, which makes sense. And if it isn't, then the folders are not mounted.

It seems like some kind of bug with the raspberry pi.

Oh well, c'est la vie.

Reply to
RobH

No. Because mine DOES.

Its a bug in some verions of Linux - a complex bug that no one takes ownership of.

Previously mount seemd to get reinvoked after the network was up but systemd broke that. Obviously the first thing you do when booting is mount your local file systems. If the networking is delayed, then you wont mount the networked drives.

It bloody well shouldn't be.

--
I would rather have questions that cannot be answered... 
...than to have answers that cannot be questioned 

Richard Feynman
Reply to
The Natural Philosopher

I had this even with a local drive, some drive insisted on fsck and wouldn't mount. System halted by systemd.

Solution was to use x-systemd.automount option in fstab. Although my NTFS partition now won't mount automatically. But then I'd say it's an improvement and I haven't bothered looking into it.

x-systemd.automount might work for Rob's CIFS mounts too. I don't do Windows networking much so I've never tried.

Reply to
Anssi Saari

Systemd: use 'noauto,x-systemd.automount,_netdev' as options in /etc/fstab Non-systemd: use 'auto,_netdev' See also:

formatting link
SSHFS orientated but gives an idea of what happens with mounting network drives.

--

Chris Elvidge, England
Reply to
Chris Elvidge

Would I add x-system.automount at the end of the said line, or somewhere inbetween.

Thanks

Reply to
RobH

The general order of scripts in Linux startup stuff usually ensures the "network is up" phase happens before "now mounting NFS/SMB filesystems" because it's just common sense.

However, that can't account for 1) Bring "*my* network interface up" (that's as far as YOU can manage, from here) 2) Try and mount a networked drive that's not plugged in/powered off :)

It would need to flag that the mount failed, and retry later (either by sitting and waiting forever -- bad, or by queueing a job to keep trying until it works).

Even better.

--
--------------------------------------+------------------------------------ 
Mike Brown: mjb[-at-]signal11.org.uk  |    http://www.signal11.org.uk
Reply to
Mike

Am 2019-10-30 hat RobH geschrieben:

Try adding "_netdev" to the mount options:

//192.168.0.22/mnt/CCTV/xeoma /mnt/CCTV/xeoma cifs \n credentials=/home/pi/.smbclient,uid=pi,_netdev 0 0

--
[nothing to say below here]
Reply to
Stephan Elinghaus

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.