Existing users, log in.  New users, create a free account.  Lost password?


MacFixIt Logo
 
Contact Us | About MacFixIt | Who's Online  

Page 2 of 3 < 1 2 3 >
Topic Options
#314784 - 12/08/05 07:58 PM Re: How to get network shares to automount on restart? [Re: Virtual1]
eben Offline
New User

Registered: 06/27/05
Posts: 6
In reply to:

For network attached storage (NAS) like that, it's probably better to use SMB. But that's just my opinion. If both AFP and SMB are supported, which you use is up to you.

AFP is the native mode for Macintoshes, and may provide a little bit of additional support for things like custom icons.




One thing to note. If your NAS runs on Windows, you may be better off using SMB since it's more of native form. However, if your NAS runs on UNIX, both AFP and SMB are emulated. If the NAS runs LINUX, then definitely use AFP since it's faster than SMB in current versions. Also, one thing you will notice is that AFP preserves the created date on files as you transfer where if you SMB, it will reset to the day you have transferred the data. FYI.

eben

Top
#314785 - 01/15/06 01:57 PM Re: How to get network shares to automount on restart? [Re: eben]
rufusj Offline
New User

Registered: 12/30/05
Posts: 4
I'm no security expert, but i don't think it's very secure to store share passwords in a text file. Any other way to do this?

Top
#314786 - 01/18/06 12:04 AM Re: How to get network shares to automount on restart? [Re: rufusj]
rufusj Offline
New User

Registered: 12/30/05
Posts: 4
^

Top
#314787 - 01/18/06 12:15 AM Re: How to get network shares to automount on restart? [Re: rufusj]
pingopuck Offline
MacMaster

Registered: 01/22/03
Posts: 4404
Loc: N Belgium (Flanders)
You can always turn your text file, containing the passwords, into an encrypted disk image, using DiskUtility. But then you would still have to remember the password to unlock the disk image, wouldn't you?
_________________________

There's no way out of here
When you come in you're in for good
(David Gilmour)

Top
#314788 - 01/20/06 06:59 AM Re: How to get network shares to automount on restart? [Re: pingopuck]
leturner Offline
New User

Registered: 11/22/00
Posts: 13
There is another, simple way to get automounts on login. (this is in OS X 10.4, a similar process should work in 10.2 and 10.3 the Account System Pref login settings vary a little))

1. Connect to the server manually at least once in each account you want the automount.
2. Go to ~/Library/Recent Servers - locate the file that ID's the server mount you want to access
3. Open your system preferences: Select 'Apple Icon: System Preferences...: Accounts'
4. Select and Unlock 'My Account' if it is locked
5. Click on 'Login Items' tab at the Accounts Pane
6. Drag and drop the desired Recent Server file into the Login Items list (or click the '+' and browse to it)
7. You can change the autolaunch order at login by dragging items in the list to a higher or lower location
8. Close System Preferences when you are done.

Voila! You have an automount on login.
Only downside is that you will have to manually close the automounted servers' finder windows everytime you login.
_________________________
G3 Beige 266AV MT, USB'd, Firewired, RAM'd Born to be, well you know, at least mildly annoying.

Top
#314789 - 02/01/06 08:02 PM Re: How to get network shares to automount on restart? [Re: Virtual1]
jasenj1 Offline
New User

Registered: 03/12/02
Posts: 6
An even easier AppleScript:

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

Modify for SMB as appropriate. This avoids the Finder windows opening up.

- Jasen.

Top
#314790 - 02/18/06 05:19 PM Re: How to get network shares to automount on restart? [Re: leturner]
TetraDog Offline
New User

Registered: 02/18/06
Posts: 1
Summary: I got an automount to work in Tiger without the Finder window appearing using an Automator workflow saved as an App for Login Items. Sorry so long - wanted to be precise for other Mac newbies.

I too needed to automount my network HDD for iTunes purposes on OS 10.4.5 (Tiger). This thread helped a lot - although, the AppleScript solutions simply did not work - cryptic Error Type -36 with no additional message - Console revealed that it was probably having a problem getting the password).

I tried leturner's drag/drop method and it wanted to work. I got an error dialog saying "The Finder cannot complete the operation because some data in "<url>" could not be read or written. (Error code -36).

I eventually got it to work, building on lessons learned attempting the above solutions, as follows:

If you do not have an "Internet Location" type of file saved for the remote server in your ~/Library/Recent Servers directory, then you can create one. This is probably optional in that the Automator entry below allows you to drill down to the network level, but, it causes an extra dialog to come up, which you may want to do if the password is not on the Keychain.
  • In a Finder window, Go/Connect to Server (shortcut meta-K). Type in the volume name. In my case, an IOMEGA drive with default settings, this turned out to be <font class="code"><pre>code:<br>smb://<WORKGROUP>;<USERNAME>:<PASSWORD>@IOMEGA-NETHDD/NETHDD/Volumes/NETHDD</pre></font>
  • I then +'d this to Favorites in an attempt to persist it beyond the norm, if that means anything.
  • Note that the file name will not reflect the actual contents of the URL in this case (specifically, the file name does not carry the password in it)

Now open the Automator Application. This step took me some time and the interface and manual are obtuse. Fortunately I am a highly-trained software engineer and it only took me about four hours to figure out what I needed to do.

  • In the Library column, select Finder.
  • In the Action column, drag "Get Specified Servers" to the workflow area.
  • In the "Get Specified Servers" workflow window, click the '+'
  • Select your Server - either enter an address or choose your saved favorite.
  • Choose File Server (this worked for me - I'm not sure that choosing Web Server does anything different)
  • I had to insert a delay to make it work. I used 5 seconds, which worked, but did not experiment to see what minimum value would always work. You can insert the Pause step later if you want. The next 3 steps tell how:
  • Back in the Library column, highlight Automator
  • Drag the Pause Action to be second in the Workflow area
  • Set the desired pause value.
  • Back in the Library column, highlight Finder again
  • Drag the "Connect to Servers" action to be the 3rd and final step in the workflow.
  • You can run your Workflow from here to test it.
  • Save your workflow somewhere that makes sense, for future reference.
  • More importantly, Save As Application, somewhere in the Applications folder makes sense.

Now go to System Preferences, Accounts, unlock it if necessary, go to Login Items, and add the saved workflow application.

When you Restart, you will see an Automator toolbar overlain on the Finder bar and it will spin during the Pause cycle, but, if all went well, then you should see the network drive icon on your desktop and it will appear in subsequent Finder windows.

I have not yet tested the case where the Network drive is not available but I'm sure that will happen one way or another real soon.

I hope this helps others - I spent a lot of time playing with these cool toys.


Edited by Kenneth Costilow (02/18/06 07:42 PM)

Top
#314791 - 02/19/06 09:35 AM Re: How to get network shares to automount on restart? [Re: TetraDog]
Virtual1 Offline
MacGuru

Registered: 01/20/01
Posts: 10527
Loc: Middle 'o Nowhere
you can also do this in a terminal script:

mkdir /Volumes/MyShare
mount_afp "afp://myusername:mypassword@192.168.1.11/MyShare/" /Volumes/MyShare

This will attach the volume and place it on the desktop but will not open the finder window.

There are other possibilities as well. You can execute terminal commands from inside an applescript for example. Make this applescript and save as an application, not run only, no startup screen, do not keep open.


on run
try
set test to "::Volumes:MyShare" as alias
on error
do shell script "mkdir /Volumes/MyShare/"
end try
do shell script "mount_afp 'afp://myusername:mypassword@192.168.1.11/MyShare/' /Volumes/MyShare"
end run

It appears you can do this several ways. Here's another variation:

tell application "Finder"
open location "afp://myusername:mypassword@serverip/sharename"
end tell


Guest login is also possible
open location "afp://;AUTH=No User Authent@serverip/sharename"

Neither of those open a window. The last two there are less maintenance because you don't have to make a mount point.
_________________________
- I work for the Department of Redundancy Department

Top
#314792 - 04/20/06 01:03 PM Re: How to get network shares to automount on restart? [Re: TetraDog]
leturner Offline
New User

Registered: 11/22/00
Posts: 13
Kenneth,

Thanks for the trial and error. That's a great solution. While it's no big deal to just dismiss the windows from my previous automount solution. It gets to be a real PIA after awhile.

Thanks for sweatin' out all the trial and error!
_________________________
G3 Beige 266AV MT, USB'd, Firewired, RAM'd Born to be, well you know, at least mildly annoying.

Top
#314793 - 11/24/06 01:37 PM Re: How to get network shares to automount on restart? [Re: jasenj1]
John Godfrey Offline
New User

Registered: 11/20/06
Posts: 1
Jasonj1

This is very simple, easy, and it works smoothly and out-of-sight.

I've just got a mac after years of windows and have been wrestling to do this with, for me, new tools that are mentioned in this thread. This is the simplist. Great for a mac newbie.
Thanks
John

Top
Page 2 of 3 < 1 2 3 >


Moderator:  dianne, dkmarsh, joemikeb, MacManiac 

VersionTracker: Software Updates and Downloads | iPhone Atlas: iPhone Help, News, Tutorials, and Tips