Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the '10.4: One way to automount SMB network shares' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.4: One way to automount SMB network shares
Authored by: chphilli on Feb 07, '07 09:20:19AM

A method similar to what I'm doing has been shown already, but I'll show what I have, since it seems to work really well for me:

First off, my laptop is almost never turned off - and I almost never log out, so the login items trick isn't that useful to me. However, the laptop does go to sleep whenever I close the lid, so that immediately points me to SleepWatcher.

SleepWatcher allows you to use two scripts, one for on sleeping, and one for on waking up.

If you create the automator workflow as described in the hint above, and then add it to sleepwatchers wakeup script, it will attempt to connect everytime your laptop wakes up. Just add something like "open ~/connectToMyServers.app" to the script.

Then, I add something like "umount /Volumes/SERVER_NAME" for each server that I have in the automator workflow to sleepwatcher's sleep script.

This removes the hassle of having connected drives when you go off network ( assuming you sleep when you move your machine ), and reconnects to the servers if they are available.

I'm sure there is a better way of managing it ( could use automator to manage the disconnects too I'm sure ), but this is working really well for me right now.

[ Reply to This | # ]

10.4: One way to automount SMB network shares
Authored by: neill on Feb 07, '07 11:06:32AM

I've been using a similar method to this for years to mount an afp server volume on my laptop at home . . .my wife and I save all real data to the server instead of our local homedirectories. An applescript of the form mount vol afp://user:password@server_IP:sharename works perfectly.

Recently I reorganized my backup routines for the laptops . . .and created a second share on the server with identical share permissions as the original . . .call them share1 and share2.

I'm running into an issue when the second script is run . . .what I want to do is keep share1 always mounted and only mount share2 when needed for the backup. Running the script is easy . . .but the problem occurs when it is run.

If share1 is already mounted and I run the script to mount share2 . . .I get some random combination of the following: (a) an error dialog that says Disk some volume can't be found with an OK and Edit button, (b) proper operation of the script with share2 mounting normally or (c) same as #1 except the volume mounts when I click the OK button. Clicking the Edit button in either (a) or (c) gives me an error that says Script Editor can't open the dictionary of the application because it is not scriptable.

Both scripts are saved as universal binary application bundles.

Both scripts work properly if neither volume is currently mounted when they are run.

If I mount share2 then run the script for share1 . . the same scenarios as (a) through (c) above occur.

Both shares are shared via SharePoints on a G4 running Tiger (non server version). Permissions are assigned as follows: Owner = admin user on the G4, Group=shareusers with R/W, and everybody=R/W. Shareusers is a group created via SharePoints that has a single user in it. The user is a server non admin account.

Both scripts are run with the userid/password correspoding to the single user in the shareusers group.

Any idea what might be going on . . .or how to get the second volume to mount correctly consistently?



[ Reply to This | # ]
umount /Volumes/SERVER_NAME
Authored by: airdrummer on Feb 08, '07 07:54:26AM

the problem i've got is that i have several nfs mounts on the same server, so the 1st mounted is named /Volumes/serverName, the 2nd is /Volumes/serverName-1, etc: order-dependent:-P

makes problems for logical links...



[ Reply to This | # ]
umount /Volumes/SERVER_NAME
Authored by: lucious1242 on Jun 07, '07 09:02:31PM

I'm getting this problem too, anybody got any idea how to resolve?



[ Reply to This | # ]