You are not logged in.

#1 2018-02-05 10:43:45

frazer
Member
Registered: 2013-12-09
Posts: 60

Mounting nfs via /etc/fstab

Hello

I have moved back to Arch recently and am having problems (coming from CentOS/Fedora) getting my nfs mount upon boot via /etc/fstab

Here is my /etc/fstab entry:

192.168.98.99:/mnt/NAS99/Media  /mnt/NAS99      nfs     defaults        0       0

If I perform mount -a this works fine, but, upon boot the directory is not mounted.

Please could someone offer any advice?

Many thanks

Frazer

Offline

#2 2018-02-05 11:38:57

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: Mounting nfs via /etc/fstab

Your system is trying to mount the share before the network is up, you should try adding the _netdev option
https://wiki.archlinux.org/index.php/NF … tc.2Ffstab


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#3 2018-02-05 13:39:15

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 68,362

Re: Mounting nfs via /etc/fstab

Not saying there is, but there *might* be a problem automounting remote FS, given there's also https://bbs.archlinux.org/viewtopic.php?pid=1765811

Offline

#4 2018-02-05 13:50:13

cafe
Member
Registered: 2014-03-20
Posts: 158

Re: Mounting nfs via /etc/fstab

If you use network manager, another option would be to enable NetworkManager-wait-online.service and add it as a requirement to nfs service (dont foget to include the After= entry as well)

Offline

#5 2018-02-05 14:29:19

frazer
Member
Registered: 2013-12-09
Posts: 60

Re: Mounting nfs via /etc/fstab

Thanks @Slithery

I changed my /etc/fstab to

192.168.98.99:/mnt/NAS99/Media  /mnt/NAS99      nfs     defaults,_netdev        0       0

But it is still not working.

Any further ideas please?

Offline

#6 2018-02-05 14:31:03

frazer
Member
Registered: 2013-12-09
Posts: 60

Re: Mounting nfs via /etc/fstab

cafe wrote:

If you use network manager, another option would be to enable NetworkManager-wait-online.service and add it as a requirement to nfs service (dont foget to include the After= entry as well)

Thank you for this advice smile

How do I go about "add it as a requirement to nfs service (dont foget to include the After= entry as well)" please - that is a concept I don't understand as yet.

Thanks again smile

Offline

#7 2018-02-05 20:48:22

cafe
Member
Registered: 2014-03-20
Posts: 158

Re: Mounting nfs via /etc/fstab

I'm sorry, what I've actually did to solve this issue was to enable NetworkManager-wait-online.service with a slight modification to the service file. The original service file executes nm-online with an option to wait for network manager to start and not the actual connection (-s option). To make sure that your system will mount nfs folders only when the network is indeed online you should enable this service.

You can edit the service file with an overrride.

# systemctl edit NetworkManager-wait-online.service

Replace the execution line with this new override file:

[Service]
ExecStart=
ExecStart=/usr/bin/nm-online -q -t 30

And then enable the service.

# systemctl enable NetworkManager-wait-online.service

Reboot.

Warning: I don't know if this will work with other network managers. I only use Network Manager for all my network interfaces.

Offline

#8 2018-02-06 02:32:40

monodromy
Member
Registered: 2014-02-08
Posts: 62

Re: Mounting nfs via /etc/fstab

Alternatively, you can use automount. The share will not mount until you need it. Instructions are on that same wiki page, a little further down.

Offline

#9 2018-02-06 08:13:48

frazer
Member
Registered: 2013-12-09
Posts: 60

Re: Mounting nfs via /etc/fstab

Terrific @Cafe smile

It worked (not at first, as, I hadn't enabled the service!  As soon as I did and rebooted: bingo - there was my mounted folder.)

Wonderful - thanks @Cafe - terrific to be back using Arch - it is so much better in so many ways for me.....

Last edited by frazer (2018-02-06 08:14:15)

Offline

Board footer

Powered by FluxBB