Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] NFS share in fstab needs to be manually mounted
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
stonecraft
n00b
n00b


Joined: 22 Mar 2022
Posts: 16

PostPosted: Tue Dec 19, 2023 1:37 am    Post subject: [SOLVED] NFS share in fstab needs to be manually mounted Reply with quote

I have some NFS shares that I want to mount at each boot. However, in spite of adding it to `/etc/fstab`, the share is never mounted after booting and I have to manually use the `mount` command.

This is my line in fstab:

Code:
10.0.0.4:/mnt/user/Main/User01  /home/jam/TOWER    nfs    rw,_netdev    0 0



My rc services are these:

Code:

$ rc-update show
               binfmt | boot                                   
             bootmisc | boot                                   
              cgroups |                                 sysinit
              chronyd |      default                           
               cronie |      default                           
                devfs |                                 sysinit
               dhcpcd |      default                           
      display-manager |      default                           
                dmesg |                                 sysinit
              dropbox |      default                           
              elogind | boot                                   
                 fsck | boot                                   
             hostname | boot                                   
              hwclock | boot                                   
              keymaps | boot                                   
            killprocs |                        shutdown       
    kmod-static-nodes |                                 sysinit
             libvirtd |      default                           
                local |      default nonetwork                 
           localmount | boot                                   
             loopback | boot                                   
              modules | boot                                   
             mount-ro |                        shutdown       
                 mtab | boot                                   
             netmount |      default                           
            nfsclient |      default                           
             nfsmount |      default                           
                pcscd |      default                           
               procfs | boot                                   
                 root | boot                                   
         save-keymaps | boot                                   
    save-termencoding | boot                                   
            savecache |                        shutdown       
              seedrng | boot                                   
                 sshd |      default                           
                 swap | boot                                   
               sysctl | boot                                   
                sysfs |                                 sysinit
            syslog-ng |      default                           
 systemd-tmpfiles-setup | boot                                   
 systemd-tmpfiles-setup-dev |                                 sysinit
         termencoding | boot                                   
                 udev |                                 sysinit
         udev-trigger |                                 sysinit
         wg-quick.wg0 |      default                           
           zfs-import | boot                                   
            zfs-mount | boot                                   
            zfs-share |      default                           
              zfs-zed |      default     



I looked at https://forums.gentoo.org/viewtopic-p-8772679.html?sid=bb9bc002d2ff0a5e094c828cac6a6f87, but it seems my issue has a different cause than was the issue in that case.
What else might I tryt?


Last edited by stonecraft on Wed Dec 20, 2023 11:57 pm; edited 2 times in total
Back to top
View user's profile Send private message
grknight
Retired Dev
Retired Dev


Joined: 20 Feb 2015
Posts: 1896

PostPosted: Tue Dec 19, 2023 2:13 am    Post subject: Reply with quote

First question, which interface does 10.0.0.4 come from?
Does the local IP get set via dhcpcd? This could be a timing issue.

Also, on an unrelated note, remove nfsmount service as it is deprecated and empty.
Back to top
View user's profile Send private message
stonecraft
n00b
n00b


Joined: 22 Mar 2022
Posts: 16

PostPosted: Tue Dec 19, 2023 3:42 am    Post subject: Reply with quote

grknight wrote:
First question, which interface does 10.0.0.4 come from?
Does the local IP get set via dhcpcd? This could be a timing issue.

Also, on an unrelated note, remove nfsmount service as it is deprecated and empty.


My router handles IP assignment, but in any case if after logging in I run `sudo mount 10.0.0.4:/mnt/user/Main/User01` it mounts to the directory specified in fstab.
And yes, I am using dhcpcd.

Also, I removed the `nfsmount` service, thanks for the tip.
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 5036
Location: Bavaria

PostPosted: Tue Dec 19, 2023 12:37 pm    Post subject: Reply with quote

I also think it's a timing problem. What happens if you set your IP address static (== not using dhcpcd) ?

Do you have in your /etc/rc.conf this ?
Quote:
rc_parallel="YES"

If yes, try to disable it ... maybe it helps ?
_________________
https://wiki.gentoo.org/wiki/User:Pietinger
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54572
Location: 56N 3W

PostPosted: Tue Dec 19, 2023 1:16 pm    Post subject: Reply with quote

stonecraft,

By default, OpenRC requires all network interfaces te be up before the net service is considered to be started.
How do you start your network interfaces?

Does the _netdev option imply the _bg option?
If no, its worth adding that to the fstab line.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
grknight
Retired Dev
Retired Dev


Joined: 20 Feb 2015
Posts: 1896

PostPosted: Tue Dec 19, 2023 1:30 pm    Post subject: Reply with quote

Since we are talking about DHCP, it may be a good idea to configure /etc/conf.d/net-online (pinging 10.0.0.4) and adding rc_need="net-online" to /etc/conf.d/nfsclient

Edit, the "bg" mount option, noted by Neddy, might also work well here (see 'man 5 nfs' for what it does). I use it on some mounts as well, for example:
Code:
192.168.1.2:/portage    /var/repo/portage       nfs4    auto,_netdev,nofail,ro,bg       0 0
Back to top
View user's profile Send private message
stonecraft
n00b
n00b


Joined: 22 Mar 2022
Posts: 16

PostPosted: Wed Dec 20, 2023 7:17 pm    Post subject: Reply with quote

It's working now, thanks folks!
The `bg` option did not help, but modifying ` /etc/conf.d/net-online ` /etc/conf.d/nfsclient` as suggested by @grknight did the trick.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum