View previous topic :: View next topic |
Author |
Message |
stonecraft n00b
Joined: 22 Mar 2022 Posts: 16
|
Posted: Tue Dec 19, 2023 1:37 am Post subject: [SOLVED] NFS share in fstab needs to be manually mounted |
|
|
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 |
|
|
grknight Retired Dev
Joined: 20 Feb 2015 Posts: 1896
|
Posted: Tue Dec 19, 2023 2:13 am Post subject: |
|
|
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 |
|
|
stonecraft n00b
Joined: 22 Mar 2022 Posts: 16
|
Posted: Tue Dec 19, 2023 3:42 am Post subject: |
|
|
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 |
|
|
pietinger Moderator
Joined: 17 Oct 2006 Posts: 5036 Location: Bavaria
|
Posted: Tue Dec 19, 2023 12:37 pm Post subject: |
|
|
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 ?
If yes, try to disable it ... maybe it helps ? _________________ https://wiki.gentoo.org/wiki/User:Pietinger |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54572 Location: 56N 3W
|
Posted: Tue Dec 19, 2023 1:16 pm Post subject: |
|
|
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 |
|
|
grknight Retired Dev
Joined: 20 Feb 2015 Posts: 1896
|
Posted: Tue Dec 19, 2023 1:30 pm Post subject: |
|
|
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 |
|
|
stonecraft n00b
Joined: 22 Mar 2022 Posts: 16
|
Posted: Wed Dec 20, 2023 7:17 pm Post subject: |
|
|
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 |
|
|
|