D&C GLug - Home Page

[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] Systemd NFS mount via fstab.

 

On 22/07/18 19:54, Julian Hall wrote:

>> I don't understand 'Network unreachable' as it dooesn't mount when the 
>> NAS and network are both up and ready. That's obviously the problem 
>> though.
>>
>> Julian
> I have tried telling Network Manager not to do anything until the 
> network is up, no joy. Then I found a site with instructions for putting 
> that in the mount file. media-julian-DEMETER.mount now looks like this:
> 
> [Unit]
> Description=DEMETER
> After=network-online.target
> Wants=network-online.target
> 
> [Mount]
> What=192.168.1.3:/volume1/DEMETER
> Where=/media/julian/DEMETER
> Type=nfs
> Options=_netdev,auto
> 
> [Install]
> WantedBy=multi-user.target
> 
> The website didn't specify which section to put the After and Wants 
> line, so I don't know if they're correct but just in the wrong place.


Hang on a sec, the last thing you want to do is start muddying the 
waters by (further) randomly modifying unit files with stuff you don't 
understand... that's probably what has got you into this mess in the 
first place. We can look deeper into what's going wrong with 
systemd-analyze but it looks as if either your network is coming up too 
late or another rogue process is tying up the mount point too early. Or 
most likely your network is badly configured and you're using parts of 
NetworkManager _and_ another conflicting tool that are conflicting on 
startup - this stuff can be deceptively complicated.

Firstly, revert your media-julian-DEMETER.mount unit to the original 
state after removing the new stanzas and then double check for any other 
little random edits you might have made over time to other unit files 
and forgotten about them. They will sink you otherwise.

You don't need or want to add network-online arguments here either - the 
_netdev mount option specifically takes care of that and tells the 
system to ensure that networked filesystems are actually available 
before attempting to mount.

After a clean boot what do the following commands tell you?

systemctl --failed
systemctl status NetworkManager-wait-online.service
systemctl --type=service | grep -i net

We can work our way around your current NFS issue by changing the mount 
unit to an automount unit but it would be far better to find and correct 
the underlying issue ideally.

Cheers
-- 
The Mailing List for the Devon & Cornwall LUG
https://mailman.dclug.org.uk/listinfo/list
FAQ: http://www.dcglug.org.uk/listfaq