LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   No mount on boot for network drive 14.1 (https://www.linuxquestions.org/questions/slackware-14/no-mount-on-boot-for-network-drive-14-1-a-4175486827/)

mostlyharmless 12-04-2013 09:01 AM

No mount on boot for network drive 14.1
 
So, I have this:
Code:

192.168.1.100:/data /mnt/data nfs _netdev,rsize=8192,wsize=8192,timeo=14,intr,nolock
in my fstab, and yet I don't get the drive mounted. It works fine after boot, with mount -a. It used to work with 14.0. Any ideas on why, how to address this? I guess I could add a manual mount command to rc.local.

Spect73 12-04-2013 01:46 PM

I take it that you don't receive any errors? I'm asking mostly out of curiosity. My 14.1 disks keep signaling to me that they should be taken out of the box they came in and used. Yet, I'm somewhat hesitate to do so after reading about some of the things that don't work the same as in 14.0.

Coordially,

Richard Cranium 12-04-2013 02:05 PM

Well, there should be something in the logs. Are you using rc.inet1 to start up your network?

mostlyharmless 12-04-2013 08:27 PM

I don't see any errors in dmesg... and unfortunately I switched to using NetworkMangler (err Manager) instead of rc.inet1. I also did cat /var/log/messages | grep mount but didn't find any errors.

Just used the defaults when I installed and everything seems to work, but I wonder if it works too late. Of course in that case I should see an error message when the other devices mount.

Richard Cranium 12-05-2013 04:13 AM

Quote:

Originally Posted by mostlyharmless (Post 5075638)
I don't see any errors in dmesg... and unfortunately I switched to using NetworkMangler (err Manager) instead of rc.inet1. I also did cat /var/log/messages | grep mount but didn't find any errors.

Just used the defaults when I installed and everything seems to work, but I wonder if it works too late. Of course in that case I should see an error message when the other devices mount.

Try looking in /var/log/syslog as well as /var/log/debug.

If you look inside /etc/rc.d/rc.M, you'll see that the "mount everything" code comes after the rc.inet1 execution but before the rc.networkmanager execution. (In fact, there are a few things in between the execution of rc.inet1 and rc.networkmanager would need network access.)

mostlyharmless 12-05-2013 08:11 AM

Quote:

(In fact, there are a few things in between the execution of rc.inet1 and rc.networkmanager would need network access.)
Good to know; I'll have a look and put a mount statement in rc.local, and maybe an unmount in rc.local_shutdown. I wonder why there's a gap like that in rc.M?

Richard Cranium 12-05-2013 01:14 PM

Well, you could try moving the call to rc.networkmanager in rc.M to right after the call to rc.inet1.

Pat would have answer there is such a gap, but I can't think of a good reason. That's a good reason why I'm not a Slackware maintainer. :-)

mostlyharmless 12-07-2013 10:54 AM

Yeah, I figure there's a good reason, so I don't want to mess with it. Interestingly enough, when I put the command into rc.local. I didn't see anything in /var/log/syslog or /var/log/debug. I did however, on reboot see a message about the network not being ready with mount. So even at the late date of running rc.local; it wasn't quite ready yet. I hate to slow down booting with a sleep statement.... Wonder if there's some other way to delay mounting nfs without delaying everything else.

tux_dude 12-07-2013 11:00 AM

Could you not use autofs? Also, if you setup your inet1.conf your network will be available before the mount. This should not conflict with network manager.

perbh 12-07-2013 01:42 PM

Well now - I just _had_ to try moving the startup of networkmanager to immediately after rc.inet1/2 - didn't expect it to work - and it didn't (so yes, I'm not gonna apply for any vacant position as maintenance 'assistant'!!)

However, you (@mostlyharmless) _could_ use ping to a known address in /etc/rc.d/rc.local before you do the nfs-mount - at least that would allow you to do it just as soon as the network is available ... maybe something like this:
Code:

while true; do
  ping -c 1 -W 1 8.8.8.8 >/dev/null 2>/dev/null && break
done
# do the nfs-mount

of course - if your network's screwed up - you'll be looping forever - might want to have a counter (say 10) in there ...

perbh 12-07-2013 02:01 PM

OK - let me try to make it all somewhat neater - so we are still speaking of 'at the end of /etc/rc.d/rc.local' ...
Code:

if true; then
  loopc=10
  host=192.168.1.100
  echo ":: waiting for network to be available ..."
  while test $loopc -gt 0; do
    ping -c 1 -W 1 $host >/dev/null 2>/dev/null && {
      mount -t nfs -o _netdev,rsize=8192,wsize=8192,timeo=14,intr,nolock $host:/data /mnt/data && \
        echo ":: /mnt/data successfully mounted"
        break
    }
    let loopc-=1
  done
  test $loopc -eq 0 && echo "-- host $host not reachable"
  unset loopc host # the environmentalists will love us!
fi


another suggestion - you could do the nfs-mount with the 'bg'-option?
(edit: changed a typo in line #5 incase others use it ...)

mostlyharmless 12-08-2013 08:43 AM

@perbh

Thanks for your suggestion. I'll try the bg option, though I already added the _netdev option under the impression that it would solve the problem. I admire your script greatly, however, it seems a bit baroque for my tastes. In a word, and I mean this sincerely with the highest regard, it's a kludge.

@tux_dude

I was wondering whether I should try rerunning pkgtool to just use inet1 like I always used to. Still, the installation gave me a choice, and the network works by login, so perhaps this is an issue for the maintainers to address in 14.2 or something.

perbh 12-08-2013 12:48 PM

Quote:

Originally Posted by mostlyharmless (Post 5077384)
...
it's a kludge.
...

*lol* and I heartily agree - it's a kludge, but ... it may solve a problem.
To my simple mind of thinking - rc.local is the one place where I can actually _do_ things - anywhere else and you will sooner or later be clobbered. Personally, I use it a lot - like checking if any extra (known - like in their uuid) disks are connected and then mount them at their appropriate place. I find that far better than some udev-rule(s) that will do the same - call me old-fashioned, but it works and it's simple (kiss)

I can give another example where it comes in handy - I have a huge usb-drive which is mounted on /pub and is used by samba (and nfs-mounted) making it available to every darn computer in the house. If that particular drive is not present at boot-time, the /pub-directory is deleted, samba is stopped and there is no nfs-mount. If it just was not mounted - both samba and nfs would happily use the /pub-directory, causing the root-fs to fill up in no time at all.

mostlyharmless 12-08-2013 05:12 PM

Well, bg as an option didn't work, so I'll try your kludge.

mostlyharmless 12-12-2013 09:06 PM

Well tried it, and got an error
Code:

line 5: test: loopc: integer expression expected
changed line5 loop to $loop
seems to work now

[EDIT] rebooted, still times out or something, all I know is that it doesn't get mounted


All times are GMT -5. The time now is 03:52 PM.