http://www.ComputerBob.com/wp/linux-tech-talk-4.php

Mini.


Linux Tech Talk 4

January 16th, 2010 by ComputerBob

If you’ve been checking this site during the day today, wondering why I hadn’t posted anything yet, this post will explain why.

Regular readers of this Journal who are interested in techie stuff already know that it took me a long time to do it, but I got Network File System (NFS) working between my two computers about 2 weeks ago.

Unfortunately, many hours ago, when my wife powered on her PC, it failed to connect to my computer through NFS — which was instantly obvious, because it took several minutes to finally boot up, and when it finished, her desktop had a plain blue background instead of one of the beautiful hi-res photos that it normally gets from an NFS share that’s on my computer’s hard drive.

I tried everything I could to figure out what was wrong, but nothing worked. And nothing that I found online (from my PC) even remotely helped me.

During my troubleshooting, I discovered that my PC’s IP address had changed from its usual 192.168.1.64 to 192.168.1.66. I figured out that that must have happened when I connected to the Internet with a LiveCD of Parted Magic, to try it out.

I knew that my wife’s PC was configured to find my PC’s NFS share at 192.168.1.64, and that it hadn’t been able to do that because my very unintelligent Verizon Actiontec DSL GT704WGB gateway had assigned my PC a new dynamic IP address when I had booted from that LiveCD, and then it had continued to assign that new IP address, even after I rebooted my PC from its own hard drive.

So I had to do a hard reset of my gateway, to force it to “forget” my PC’s “new” IP address and reassign its “old” IP address — the lowest one that is in its IP-assigning range.

Unfortunately, even after I got my PC back onto the right IP address, my wife’s PC still continued to fail to connect to my PC’s NFS share.

Eventually, while looking through /var/log/syslog, I discovered several boot-up error messages related to network connectivity that were lightly sprinkled throughout the file.

So I started investigating them, one at a time.

The message that turned out to point to the crux of the problem was one that said:

if-up.d/mountnfs[eth0]: lock /var/run/network/mountnfs exist, not mounting

Unfortunately, while an online search of that exact phrase turned up several other people who had experienced the exact same error message, all of the responses to their questions that I found appeared to be from people who were just as confused as the questioners — people whose “solutions” involved “guesses” like reinstalling the PC’s entire networking and/or the entire NFS service itself.

But as I continued to study that cryptic error message, I suddenly realized that, if I added just one letter to one of its words (in red, below), it seemed to not only describe the problem, but to also suggest a solution:

if-up.d/mountnfs[eth0]: lock /var/run/network/mountnfs exists, not mounting

So I found the mountnfs folder, which was empty.

And deleted it.

When I restarted my wife’s PC, it connected to my PC’s NFS share perfectly, and all was right with the world again.

Of course, being the extremely careful guy that I am, I shut down her PC and restarted it several times, just to make sure that it would automatically connect to the NFS share every time.

It did.

Afterward, I found an old bug report that confirmed my suspicion that the presence of a mountnfs folder at boot time had been preventing NFS on my wife’s PC from connecting to my PC’s NFS share.

I’ve figured out that the following chain of events is what led to the creation of the stale mountnfs folder:

  • I downloaded and burned a new LiveCD of Parted Magic on my PC this morning.
  • I rebooted my PC off of the LIveCD, to test out its Internet connectivity (it worked).
  • Without my knowledge or permission, my gateway assigned a new IP address to my PC’s ethernet adapter, running off of the LiveCD.
  • When I removed the LiveCD and rebooted my PC off of its hard drive, my gateway continued to assign the same new IP address to my PC.
  • When my wife powered on her PC this afternoon, it failed to find the NFS share at my PC’s old IP address. (but I bet it had already created the mountnfs folder at that point)
  • When it appeared that my wife’s PC was hopelessly locked up in the middle of the boot process, I powered it down — which preventing it from doing a normal shut-down that would have automatically deleted its mountnfs folder. That’s when the mountnfs folder on my wife’s PC became stale.
  • Subsequent boot-ups of my wife’s PC failed to connect to the NFS share, because of the presence of the stale mountnfs folder.
  • I manually deleted the mountnfs folder.
  • My wife’s PC was finally able to connect to my PC’s NFS share during boot.
  • Every time we shut down my wife’s PC properly, the shut-down process automatically deletes the mountnfs folder, which allows her PC to reconnect to the NFS share during the next boot-up.

I can already hear some of you screaming at me: “Just use a static IP address on your PC instead of a dynamic one and you won’t ever have to worry about its IP address changing any more!”

Believe me, I know.

That’s why I’ve spent hours and hours, on several different days, trying to do that.

But all of my efforts have been in vain, because my gateway will allow PCs with static IP addresses to connect to each other on my LAN, but it won’t allow PCs with a static IP addresses to connect to the Internet, no matter what I do.

So, from now on, I guess I’ll need to remember 2 things:

  1. Don’t connect to the Internet through a LiveCD OR
  2. If I do #1, or anything else that changes my PC’s IP address, I’ll need to shut down my PC, do a hard-reset of my gateway and then boot-up my PC again, so that it will be assigned the same dynamic IP address that it has now (the lowest-numbered one that my gateway assigns).
  3. If my PC’s IP address is wrong when my wife powers up her PC, then her PC will not be able to connect to my PC’s NFS share until I do #2 and delete her PC’s /var/run/network/mountnfs folder.

Now that the problem is fixed, my wife is on her PC a few feet away from me, browsing the Internet.

And I know that she’s really, really proud of me for figuring it all out.

Tags:
, , ,

Leave a Reply