Sponsored in part by... Freeverse Freeverse, Inc.'s SOUND STUDIO 3.5.5 - Sound Studio is for anyone
who needs to record or edit audio with a professional tool, but at
a consumer price. Perfect for Podcasts, Music, More! Now updated
for OS X 10.5 Leopard. <http://www.freeverse.com/soundstudio>

 [F] TidBITS  / TidBITS  / TidBITS Talk  /

Automatically Attaching Network Drive

[davidharris]davidharris (apparently) - 12:06pm Mar 21, 2007 PST
via email

How do I get my mac to automatically attach a network drive on restart?


[I'd recommend making an alias of the drive, and putting it in your account's login items, in the Accounts preference pane. But I'm sure there are other approaches as well. -Adam]

--
Dave Harris
http://catering-2-you.com/


Mark as Read
  OutlineAll MessagesOlder MessagesOldest MessagesNewest MessagesNewer Messages

Nik (apparently) - Mar 21, 2007 2:12 pm (#1 Total: 5)  

Reply to this message
via email  

Photo of Author
Posts: 377
Re: Automatically Attaching Network Drive

On Mar 21, 2007, at 1:06 PM, David Harris wrote:

> How do I get my mac to automatically attach a network drive on
> restart?
>
> [I'd recommend making an alias of the drive, and putting it in your
> account's login items, in the Accounts preference pane. But I'm
> sure there are other approaches as well. -Adam]

You just go to "Map Network Drive..." oh wait, never mind, that's
Windows.

And yet, strangely, there's no equivalent on the Mac.

There's two simple(ish) ways to do it.

One is the alias method, as noted above. That works pretty well for
AppleShare or SMB/CIFS type network shares.

The alternative is to create a url shortcut in the form of afp://
file.server.name or smb://file.server.name for a CIFS/SMB server.
This also works with webdav, ftp, nfs, etc... Just type our your URL
in TextEdit and then select + drag the text to your desktop.

Iif you're connecting to an SMB/CIFS share, you'll want to start by
making an alias, then disconnect the drive, and then open the alias
and choose "add to keychain" when you authenticate, or else you CAN'T
save the information in the keychain. (Yes, clicking "add to
keychain" when authenticating through anything other than an alias is
simply ignored -- it's a great little bug!)The same may be true of
other types of network shares, I'm not sure. After you do this, you
can trash the alias if you'd rather use a URL shortcut.

Once you have an alias or a shortcut, you can just add it to your
login items and you'll be good to go.

The big problem with both of these methods is that if the drive isn't
available on startup, you'll get a beachball in the Finder for a
surprisingly long time. I've gotten around this by using an
AppleScript instead and attaching a pretty short (5 second) timeout
on it. A bit more work, but my network's fairly unreliable, so it
seemed worthwhile.

--Nik

Mike Cohen (apparently) - Mar 22, 2007 2:21 pm (#2 Total: 5)  

Reply to this message
via email  

Photo of Author
Posts: 133
Re: Automatically Attaching Network Drive

I use a utility called Home and Away (
http://maccrafters.com/home_and_away/index.html ) to automatically
connect my server only when I'm on my home network. It checks the name
of the active network and mounts servers and/or opens applications
depending on the network.

cccorlew (apparently) - Mar 22, 2007 2:21 pm (#3 Total: 5)  

Reply to this message
via email  

Photo of Author
Posts: 11
Re: Automatically Attaching Network Drive

At last! something I can help with!

Applescript, make it an application

mount volume "afp://logInName:PasswordIPaddress/pathAsNeeded/"

Make it a startup item

I do thi sin my journalism lab. Works great

<x-sigsep>
-- 
</x-sigsep>
Curtis Corlew
Los Medanos College, Pittsburg CA
http://www.losmedanos.edu

Personal page http://curtis.corlew.com

David Weintraub (apparently) - Mar 22, 2007 2:21 pm (#4 Total: 5)  

Reply to this message
via email  

Photo of Author
Posts: 214
Re: Automatically Attaching Network Drive

Two different things:

1). Attach a network drive on login
2). Automount a network drive as part of the boot process

The first one is easy. Open the System Preferences. Open the Accounts
system preferences. Go to Login Items, and select the network drive
to mount as one of the login items. It will show up in the login
items as "Volume" and not as an "Application". It's pretty obvious
once you think about it. (You want a network drive on "Startup", put
it in "Startup" items!). I think what throws us off is that Windows
doesn't do it in such an obvious way.

#2 is a bit harder because... I really don't know.

Sorry, I am not really a Unix admin, and I certainly don't know BSD
what Apple did with it. However, looking at /etc/rc which is the
script that runs on bootup, it looks like you can specify the disks
in /etc/fstab to mount on bootup. Do a "man -s5 fstab" for the format.

--
David Weintraub
davidweintraubworld.net
davidweintraub.name



John C. Welch (apparently) - Mar 23, 2007 10:43 am (#5 Total: 5)  

Reply to this message
via email  

Photo of Author
Posts: 772
Re: Automatically Attaching Network Drive

On 3/22/07 16:21, "David Weintraub" <davidweintraub.name> wrote:

> #2 is a bit harder because... I really don't know.
>
> Sorry, I am not really a Unix admin, and I certainly don't know BSD
> what Apple did with it. However, looking at /etc/rc which is the
> script that runs on bootup, it looks like you can specify the disks
> in /etc/fstab to mount on bootup. Do a "man -s5 fstab" for the format.

You really need some kind of infrastructure in place, be it Open Directory
or what for that to work well. You could hack something together, but if you
want AFP, it would be more trouble than it's worth, and NFS is not a
well-supported on OS X.

--
John C. Welch Writer/Analyst
Bynkii.com Mac and other opinions
jwelchbynkii.com





  OutlineAll MessagesOlder MessagesOldest MessagesNewest MessagesNewer Messages


 [F] TidBITS  / TidBITS  / TidBITS Talk  / Automatically Attaching Network Drive




Add a message

To add a message to this discussion, you must be a registered user. Enter your email address below. If you have an account associated with the email address you enter, you will be prompted for your password. If not, you'll be able to create a new account with no fuss.

Enter your email address:

Submit