Topic : Permanent NFS Mount

This question is not answered. "Helpful" answers available: 2 . "Solved" answers available: 1 .


            Permlink
            Replies : 2 - Last Post : Feb 23, 2009 9:34 PM by: carton0
David Angelovich


Posts: 27
From: Australia
Registered: Feb 9, 2004
Permanent NFS Mount
Posted: Feb 22, 2009 5:06 PM
 

Hi

I'm trying to figure out how to create a permanent NFS mount on my 10.5.6 Server hosts. Using Directory Utility seems to only create autofs mounts - which I've had trouble with in the past on other platforms, so I'm not very trusting of it.

/etc/fstab.hd is apparently ignored, so I'm not sure how else to get a permanent mount. Is it even possible on Leopard Server?

Thanks.

Mac Pro 8-core 2.8GHz, MacBook Pro 2.0GHz   Mac OS X (10.5.6)    
Camelot


Posts: 8,041
From: San Jose, CA
Registered: Mar 13, 2002
Re: Permanent NFS Mount
Posted: Feb 22, 2009 6:06 PM   in response to: David Angelovich
 

Directory Utility will, indeed, create automounts but I've had no problem with them (other than when using nested mounts, which just doesn't work).

In general, autofs is preferable since it will re-mount the share point should the network connection get interrupted. This contrasts with static mounts that may or may not re-establish themselves.

That said, static mounts should work if you add them to /etc/fstab (not sure where you got '/etc/fstab.hd' from - the .hd is superfluous on Mac OS X.

Failing that you can write a startup script that runs at boot time to establish your mounts. This, of course, won't auto-remount unless you're very creative.

  Mac OS X (10.5.6)    
carton0

Posts: 2
Registered: Feb 23, 2009
Re: Permanent NFS Mount
Posted: Feb 23, 2009 9:19 PM   in response to: Camelot
 

I also found that nested / heirarchical mounts don't work with the Apple version of Sun's automounter. I thought for sure if I made a ``multiple mounts'' entry they would work since AIUI in this case the automounter gets to see the whole proposed subtree at once from a single Directory Services lookup, but no, it doesn't work either. There are ``multiple mounts'' examples on both Apple's man page and Sun's, but on Sun's page the example is nested and on Apple's it isn't. I guess that's a kind of transparency, but a rather CYA-ish kind that leaves us out here wagging our jaws quite a bit when we expect it to behave like other automounters.

However! nested mounts with the 'net' option DO work. ?!

and in this case unlike the traditional Sun ``multiple mounts'' case, the automounter must build the tree with multiple Directory Services lookups not just one. How can it even do that? Is it Searching the directory instead of doing a simple Lookup?

I can load all the mounts into Open Directory as separate, nodes, or whatever you call them, like this:

cat > nested-example
0x0A 0x5C 0x3A 0x2C dsRecTypeStandard:Mounts 3 dsAttrTypeStandard:RecordName dsAttrTypeStandard:VFSType dsAttrTypeStandard:VFSOpts
terabithia\:/arrchive/incoming:nfs:nosuid,nodev,hard,intr,net
terabithia\:/arrchive/Radio:nfs:nosuid,nodev,hard,intr,net
terabithia\:/arrchive/backup:nfs:nosuid,nodev,hard,intr,net
terabithia\:/arrchive/ebooks:nfs:nosuid,nodev,hard,intr,net
terabithia\:/arrchive/fonts:nfs:nosuid,nodev,hard,intr,net
terabithia\:/arrchive/movies:nfs:nosuid,nodev,hard,intr,net
terabithia\:/arrchive/music/Antoine:nfs:nosuid,nodev,hard,intr,net
terabithia\:/arrchive/music/Lauren:nfs:nosuid,nodev,hard,intr,net
terabithia\:/arrchive/music/Roger:nfs:nosuid,nodev,hard,intr,net
terabithia\:/arrchive/music/jen:nfs:nosuid,nodev,hard,intr,net
terabithia\:/arrchive:nfs:nosuid,nodev,hard,intr,net
^D
dsimport -g nested-example /Local/Default I -u someadminuser

and they will show up under /Network/Servers/terabithia/arrchive. I can no longer choose the mountpoint myself, which is a disadvantage for more than vanity---with the Solaris automounter, it's possible to build a single nested tree on the client out of filesystems pulled in from a bunch of different NFS servers, while the Mac's 'net' naming convention straightjackets me into only rebuilding trees that exist within one NFS server.

Also, this works on 10.4, too, though in that case of course you use netinfo or niload fstab instead of dsimport.

Now can someone explain why 'net' suddenly works so much better? And is there a hidden downside to using it?

eMac   Mac OS X (10.5.6)    
carton0

Posts: 2
Registered: Feb 23, 2009
Re: Permanent NFS Mount
Posted: Feb 23, 2009 9:34 PM   in response to: David Angelovich
 

I'm guessing you want the NFS filesystem mounted at boot, and then to stay mounted for as long as the machine is up, no matter what---what other Unix systems call a hard NFS mount, the kind which does not lose data when users have files open for write when the server is rebooting. Me too.

The problem with not using autofs is that there's an autoUNfs you get whether you like it or not. If an NFS filesystem is too slow or the server is rebooting, in place of those harmless 'nfs server not responding still trying' messages other systems print on the console, Finder will throw up a box ``Server connection interrupted'' or some such, with one big fat button, Disconnect.

* If the user presses Disconnect
Finder does an 'umount -f' on his behalf. And 'umount -f' seems to work in Mac OS more often than some other Unixes.

* If the user presses the red [x]
The dialog box goes away. but it'll come back ~1min later.

* If the user completely ignores the box
The system wil lbehave like a normal Unix, where any process accessing the NFS server will block until the server restarts, including Finder but not including the Disconnect box generator. :)

You get this box whether you like it or not, and users tend to press the button they're offered because in their minds they have only one choice not three. The box sort of replaces the 'intr' option we used to have since ^C doesn't work in a GUI but 'umount -f' is a lot more drastic than the old way. In effect there is no such thing as a 'hard' NFS mount in Mac OS unless you can discipline your users into ignoring this tragic box.

autofs partway undoes the affect of the box by letting users remount the filesystem after they've forcibly unmounted it. so...you really probably need the automounter.

btw I've not found it works well for remounting on 10.4---usually they have to reboot once they've pressed Disconnect. after they press I've tried killing the automounter and restarting it, trying to umount things by hand, and got nowhere. 10.5 ``just works'' in this regard.

  Other OS    
                Unread
                New content since your last visit
                Updated
                Updated content since your last visit