View previous topic :: View next topic |
Author |
Message |
hunky l33t
Joined: 19 Nov 2003 Posts: 910 Location: Alaska
|
Posted: Sun Jan 29, 2023 7:19 am Post subject: NFS shares not mounting on boot [SOLVED] |
|
|
I just moved to a new computer and brought over my old /home. The new computer isn't mounting NFS shares on my NAS (Network Attached Storage) even though the fstab file is the same as old. When I boot, I can type mount -a and the shares mount no problem. But I would rather it be automatic.
This is the format I have for the shares, with one example:
Code: | 192.168.1.148:/volume1/photo /mnt/homenas/photo nfs rw,_netdev 0 0 |
My old fstab was a bit different with rw,nfsver-4,no-lock (I might have some mispellings there) and it worked fine.. but when I did the same on the new.. it doesn't work automatically on booting. Googling and studying the gentoo wikis I eventually changed it to the above.. mount -a worked in either case on the new computer.
I've gone thru the wikis on kernel setup for nfs and the like. Just not sure what to try next. I saw this on StackExchange that I could try something like it, but would rather not (and there is no /etc/network directory or if-up.d): Code: |
Create a file at: /etc/network/if-up.d/fstab
Add this to it:
#!/bin/sh
mount -a
Make the file executable:
sudo chmod +x /etc/network/if-up.d/fstab
You are directing the system at boot time to issue a mount -a after the network stack is up and operation which if it's like a cifs mount in fstab is the reason your shares are not mounting at boot.
|
Would appreciate suggestions of where else to look. My local disk shares mount just fine. thks!
[edit] if it helps, here's the kernel config: http://dpaste.com//53R9N6A8Q
Last edited by hunky on Sun Jan 29, 2023 9:39 pm; edited 1 time in total |
|
Back to top |
|
|
Hu Moderator
Joined: 06 Mar 2007 Posts: 21624
|
Posted: Sun Jan 29, 2023 5:20 pm Post subject: |
|
|
The Stack Exchange advice is an ugly and incorrect workaround. Setting the mount options to include _netdev, as you already did, is the standard solution for decades now. When you boot and the system does not mount these, what messages are displayed? Did you enable the netmount init service? That is the typical way for the system to run mount -a -O _netdev on your behalf. |
|
Back to top |
|
|
hunky l33t
Joined: 19 Nov 2003 Posts: 910 Location: Alaska
|
Posted: Sun Jan 29, 2023 6:09 pm Post subject: |
|
|
Thanks Hu.
Yes, it is enabled.
Code: | # rc-update show
alsasound | boot
binfmt | boot
bootmisc | boot
cgroups | sysinit
cronie | default
cupsd | default
dbus | default
devfs | sysinit
dhcpcd | default
display-manager | default
dmesg | sysinit
elogind | boot
fail2ban | default
fsck | boot
hostname | boot
hwclock | boot
keymaps | boot
killprocs | shutdown
kmod-static-nodes | sysinit
local | default nonetwork
localmount | boot
loopback | boot
modules | boot
mount-ro | shutdown
mtab | boot
net.enp6s0 | default
netmount | default
nfsclient | default
nftables | default
ntpd | default
procfs | boot
root | boot
saned | default
save-keymaps | boot
save-termencoding | boot
savecache | shutdown
seedrng | boot
sshd | default
swap | boot
sysctl | boot
sysfs | sysinit
sysklogd | default
systemd-tmpfiles-setup | boot
systemd-tmpfiles-setup-dev | sysinit
termencoding | boot
udev | sysinit
udev-trigger | sysinit
Asus_tux ~ #
|
|
|
Back to top |
|
|
grknight Retired Dev
Joined: 20 Feb 2015 Posts: 1659
|
Posted: Sun Jan 29, 2023 7:14 pm Post subject: |
|
|
hunky wrote: | Code: | # rc-update show
dhcpcd | default
net.enp6s0 | default |
|
This may be an issue of enabling both dhcpcd service and net.enp6s0 service.
The dhcpcd service cannot be enabled together with any net.* service without excluding said interface from the dhcpcd service's config.
The reason is the dhcpcd service starts dhcpcd in "manager" mode while net.* services start dhcpcd in "interface" mode.
This means they fight for control of the interfaces and run over each other.
Pick just one to enable or exclude the interface first.
Once that is decided, I would suggest setting rc_need="network-online" in /etc/conf.d/netmount and configuring /etc/conf.d/net-online to ensure that DHCP has been fully processed from the background before netmount starts. |
|
Back to top |
|
|
hunky l33t
Joined: 19 Nov 2003 Posts: 910 Location: Alaska
|
Posted: Sun Jan 29, 2023 7:56 pm Post subject: |
|
|
Ok, I think just removing dhcpcd from run levels did the trick. I tried setting netmount with rc_need="network-online" and wasn't sure what to do with net-online. With the edit to netmount, a reboot took a longish time as it was looking to see if the network was online. (Probably because I didn't have the interfaces described in net-online. Then I re-edited netmount with rc_need="net-online" in case you had a typo (doubtful.. but had to try) and got the same result.
So with defaults in netmount (rc_need="net") and nothing in net-online, this last boot actually worked with mounting the nfs shares. If it hadn't, I would have started googling what to actually put in net-online to make it work and not bother you or the forum. But looks like this is working now.
Sure appreciate the help! /jd |
|
Back to top |
|
|
|