Wednesday, May 30, 2007

MAC上使用automount自动加载网络文件夹

1. 使用Login Items in the Account section of System Preferences

"Adding a volume to your startup items used to work, but I think that
was back in the days of 10.1. It has since stopped working with 10.3
and 10.4 at least"

An AppleScript to mount:

mount volume "afp://username:password@servername/volume"

Save it as an application and put into Login Items.

2. 使用NetInfo,

Static vs. dynamic mounting

When you mount a sharepoint statically, it is mounted during startup
and available immediately when you click on its icon. You can assign
statically mounted sharepoints specific directories within the
/Network directory (that blue globe you see sitting next to all the
other volumes on your system). Dynamic sharepoints always reside in
/Network/Servers/server_name. They do not actually mount when the
computer is started up, instead, they mount on the fly when you
request information from them (e.g., when you double-click on its
icon). Static sharepoints have the advantage of being assigned to
specific directories within /Network and being available immediately.
Dynamic sharepoints have the advantage of using less server resources
when the sharepoint is not being used. Apple recommends having User
home directories served on dynamically mounted sharepoints, while
statically mounting other resources, such as a Library folder.

Here's what to do

1. Launch NetInfo Manager; it is located in the
/Applications/Utilities folder.
2. Authenticate by clicking on the lock in the lower left corner.
3. Click on the /mounts directory.
4. Click on "New+" icon. An item named "new_directory" will appear.
5. Double-click on the value "new_directory" for the "name"
property and change it to "servername:/sharepoint". You can use the IP
address, the hostname or the fully qualified hostname in place of
servername.
6. Select "New Property" from the "Directory" menu. Set the
property name to "vfstype". Set the value to "url" if this is an AFP
sharepoint or "nfs" if this is an NFS sharepoint.
7. Skip this step for statically mounted NFS sharepoints.
Otherwise, select "New Property" from the "Directory" menu. Set the
property name to "opts". If this is a dynamically mounting NFS
sharepoint, set the value to "net". Follow the instructions below for
static and dynamic AFP sharepoints:

Special steps for AFP sharepoints only:

+ Set the "opts" value to:
url==afp://;AUTH=NO%20USER%20AUTHENT@servername/sharepoint

+ If this sharepoint will mount dynamically, click on the
opts property and select "Insert Value" from the "Directory" menu. Set
the value to "net".

8. Select "New Property" from the "Directory" menu. Set the
property to "dir". If this sharepoint will mount dynamically, set the
value to "/Network/Servers/". If this is a statically mounted
sharepoint, set the value to "/Network/sharepoint".
9. Select "Save Changes" from the "Domain" menu and restart the
computer. Verify that the sharepoint mounted correctly in the
appropriate location in the /Network directory.

Alternatively, you can use the application SharePoints AutoMounter to
setup these settings, though it only sets up dynamic mounts.

Note that you must have guest access enabled on an AFP sharepoint in
order to automount it. See the Mac OS 10.2 Server Administrator's
guide for more details on setting up sharepoints.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home