[OS X] NFS mounts on OS X, including automount

Andy Jacobson Andy.Jacobson at noaa.gov
Wed Mar 15 14:37:41 EST 2006


Howdy,

	Filesystems exported from ccgg.cmdl.noaa.gov can be mounted on your  
OS X systems via NFS.  These are the filesystems we use on vortex.

	1.  FOR ONE-OFF MOUNTS
  	
		Create a mount point, via e.g. "sudo mkdir /nfs/ccgg"

		Then issue the mount command:

			sudo mount_nfs -P -o rw,soft 140.172.195.2:/ccg /nfs/ccgg

		The -P option is particular to doing this from OS X to linux.

	At this point, /nfs/ccgg/ccg should have files you recognize in it  
from vortex.  Note that "ccgg" refers to the machine from which "ccg"  
is mounted.  I have just symlinked ~/ccg to /nfs/ccgg/ccg.

	2.  PERMISSIONS

	You will not have write permissions to your files on the NFS  
filesystem unless you change your UID to 	match the one on the linux  
(vortex) side.  This requires changing your UID/GID on OS X, then  
doing a chown/chgrp for those files.  I just went through this.  It  
took about an hour for the "find" commands below to finish processing  
both of my disks, so set aside a chunk of time if you're going to do  
this.  Since any future modeling group linux file server will  
probably use the same LDAP UIDs and GIDs, this is probably time well  
spent.

	i.  Find out your UID and GID on vortex.  Log in, type "id".  You  
should see a numeric value for UID and GID=300 (ccg).   Find out your  
UID and GID on OS X the same way.  Write these numbers down!

	ii.  Create a new administrator account on your OS X machine.  You  
do *not* want to be logged in while chowning your files.

	iii.  Log out of the OS X machine, log back in as this alternative  
admin.

	iv.  Start /Applications/Utilities/NetInfo\ Manager.app/

	v.  Choose users, then your user name.  Authenticate if need be to  
make changes.  Scroll down to UID, change to the linux value.

	vi.  Choose groups.  Find your user name.  Change the GID to the  
linux value (ccg = 300).

	vii.  Quit NetInfo Manager.

	viii.  Open a terminal window, and become root using sudo.  If you  
are user "andy", issue the following commands.  Substitute YOUR old  
OS X uid and gid (which are probably both 501, but not certainly).

	find /Users/andy -uid 501 -exec chown andy {} \;
	find /Users/andy -gid 501 -exec chgrp ccg {} \;

	ix.  Go to lunch.  When it's done, log out, and log back in as  
yourself.  Hopefully everything will be just the same as ever.  You  
can delete the alternative admin account at this time.

	3.  AUTOMOUNT

	For a more robust NFS system, use automount.  This is a built-in  
system in OS X that will automatically NFS-mount certain directories  
when you access them, then after a period of inactivity, dismount  
them.  The advantage to automount is that the NFS filesystems will be  
available to you after a reboot. (If you mount them by hand, using  
the above mount_nfs command, you have to either remember to do it  
after a reboot, or figure out the launchd service.)

	You need to create files in /Library/StartupItems/Automount, and / 
private/etc.  You can do this by unpacking the attached tarball  
(automount_ccg.tgz), but attention first!

	i.  Maybe you'd better look at its contents before unpacking in / as  
root.  This is a great way to screw up your system.  The contents  
(tar tzvf automount_ccg.tgz) should be:

drwxr-xr-x root/wheel        0 2006-03-15 12:23:46 Library/ 
StartupItems/Automount/
-rwxr-xr-x root/wheel     1026 2006-02-03 20:32:05 Library/ 
StartupItems/Automount/Automount
-rw-r--r-- root/wheel      263 2003-03-18 13:34:04 Library/ 
StartupItems/Automount/StartupParameters.plist
-rw-r--r-- root/wheel       67 2006-02-03 20:29:22 private/etc/ 
ccgg.automount.map

	ii.  It should be unpacked in /.  Meaning:  "cd /;tar zxvf  
automount_ccg.tgz".

	iii. Reboot machine.  Alternatively, launchd can allegedly be killed  
and restarted, but I've experienced trouble with this.

	Notes:  the Automount script is simple and inelegant.  It can be  
extended for other NFS mounts.  That script has the mount point hard  
coded in it, so if you use something other than /nfs/ccgg as a mount  
point, you'll have to make changes in it.

	Best of Luck,

		Andy



-------------- next part --------------
A non-text attachment was scrubbed...
Name: automount_ccg.tgz
Type: application/octet-stream
Size: 1002 bytes
Desc: not available
Url : http://tazman.princeton.edu/pipermail/osx/attachments/20060315/dd16a3ff/automount_ccg.obj
-------------- next part --------------

	
--
Andy Jacobson
andy.jacobson at noaa.gov

NOAA Earth System Research Lab
Global Monitoring Division
325 Broadway
Boulder CO 80305

303/497-4916





More information about the OSX mailing list