_netdev apparently not the whole answer

Questions about WIFI networks and devices
Forum rules
Before you post please read how to get help
Post Reply
WetGeek
Level 1
Level 1
Posts: 13
Joined: Mon Jul 11, 2011 3:45 pm
Location: Bothell, WA USA

_netdev apparently not the whole answer

Post by WetGeek » Thu Feb 28, 2019 12:28 pm

I mostly use Mint 19.1, but other distros seem to have the same problem for me. I use a Synology NAS that's connected by hardwire on two of my machines, and wireless on four of them. I'm really tired of mounting these shares with "sudo mount -a" and would like them to mount automatically at startup. My /etc/fstab contains lines like:

DiskStation415:/volume1/SourceControl /mnt/SourceControl nfs defaults,_netdev 0 0

But this doesn't mount them automatically. I've done a lot of research, but can't understand why this doesn't work. Any ideas?

rene
Level 12
Level 12
Posts: 4309
Joined: Sun Mar 27, 2016 6:58 pm

Re: _netdev apparently not the whole answer

Post by rene » Thu Feb 28, 2019 12:42 pm

What's "DiskStation415" there? A name from /etc/hosts? A Windows networking name? That is, I would expect that name resolving for said name is not up early enough (and by the way, not even _netdev should be necessary, seeing as how its implied for type "nfs" on systemd systems).

That said, I in fact advise to not mount at startup for NFS but transparently mount on demand using the systemd automounter. That is, I'd change that fstab line to e.g.

Code: Select all

DiskStation415:/volume1/SourceControl	/mnt/SourceControl	nfs	noauto,noatime,noexec,x-systemd.automount,x-systemd.mount-timeout=10s,x-systemd.idle-timeout=10m

WetGeek
Level 1
Level 1
Posts: 13
Joined: Mon Jul 11, 2011 3:45 pm
Location: Bothell, WA USA

Re: _netdev apparently not the whole answer

Post by WetGeek » Thu Feb 28, 2019 1:06 pm

Thanks, Rene, and yes, that was the solution. BTW, DiskStation415 is the name of my Synology NAS.

rene
Level 12
Level 12
Posts: 4309
Joined: Sun Mar 27, 2016 6:58 pm

Re: _netdev apparently not the whole answer

Post by rene » Thu Feb 28, 2019 1:18 pm

WetGeek wrote:
Thu Feb 28, 2019 1:06 pm
BTW, DiskStation415 is the name of my Synology NAS.
Well, clearly, but the question is/was, how does your system know it's the name of your Synology NAS? Transparent availability of symbolic names for systems is something that's only to be (more or less) taken for granted when using Windows or Zeroconf networking. More explicitly, if you'd add a line

Code: Select all

192.168.123.123	DiskStation415
to your /etc/hosts then the original setup would've worked as well. Of course, this while replacing "192.168.123.123" with the correct IP address for your NAS which if the NAS is getting an IP through DHCP complicates things slightly (the advised solution is to tell your router to always hand out the same IP to the NAS based on its MAC address). Without any such addition to /etc/hosts getting the system to know that "DiskStation415" is the system with address 192.168.123.123 is a relatively involved issue though.

Given the automounter approach which I feel to be better anyway -- i.e., you won't hold up your boot if the NAS is turned of -- we don't need to go investigate if you're satisfied, but that was the context of my question...

User avatar
AndyMH
Level 9
Level 9
Posts: 2640
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: _netdev apparently not the whole answer

Post by AndyMH » Thu Feb 28, 2019 1:37 pm

Well, clearly, but the question is/was, how does your system know it's the name of your Synology NAS
Bonjour!
viewtopic.php?t=287853

I mount my synology through smb, in fstab:

Code: Select all

# mount point for synology NAS 
//diskstation.local/home/ /media/synology cifs credentials=/etc/samba/credentials,uid=1000,gid=1000 0 0
Homebrew i5-8400+GTX1080 Cinnamon 19.0, 3 x Thinkpad T430 Cinnamon 19.0, i7-3632 , i5-3320, i5-3210, Thinkpad T60 19.0 Mate

rene
Level 12
Level 12
Posts: 4309
Joined: Sun Mar 27, 2016 6:58 pm

Re: _netdev apparently not the whole answer

Post by rene » Thu Feb 28, 2019 1:56 pm

Yesyesyesyesyesyes; the (rhetorical) question is/was how did OP's system know that it is the name of the NAS, thereby pointing out that it was likely the case that it in fact did not at that point in the bootup (even if only since there's little other reason). Anyways, as long as OP's satisfied with the automount...

Post Reply

Return to “Wireless”