How To Assign Drive Letter To Folder on Mac?

2

I dont want to mount a folder or another drive using SMB in Mac OS X. I want to map a folder or another drive like I can in Windows - using a drive letter. When I map I can be sure that if the resource becomes unavailable, the mapping remains. When a user tries to reconnect to an unavailable resource, Windows attempts to bring that resource back before it produces a resource unavailable failure.

I could be wrong but with my experience, using CMD-K and doing SMB://myresourcehere on my iMac results in a mount, but once the resource is turned off or resets or sleeps the mount has to be created again.

It COULD be something I am doing wrong and I would like to know if that is the case but also, I would like to know IF I can also simply assign a drive letter to a resource such as a folder on the network somewhere?

Taptronic

Posted 2010-03-05T17:53:10.067

Reputation: 911

Answers

5

The Mac, based on it's unix-oid heritage (BSD/Darwin) knows of one hierarchical filesystem. What you would call "map a drive letter" on windows is done by "mounting" a drive/volume/remote link in this type of environment.

see this question here on superuser for more info.

lexu

Posted 2010-03-05T17:53:10.067

Reputation: 1 822

3

I dont want to mount a folder or another drive using SMB in Mac OS X. I want to map a folder or another drive like I can in Windows - using a drive letter. When I map I can be sure that if the resource becomes unavailable, the mapping remains. When a user tries to reconnect to an unavailable resource, Windows attempts to bring that resource back before it produces a resource unavailable failure.

The quick answer here is.

You can't.

The Mac OS X does not know what a drive letter is, nor what do with it. The reason Windows does that is a convulted mess, but...

Drive letter assignment is the process of assigning alphabetical identifiers to physical or logical disk drives or partitions (drive volumes) in the root filesystem namespace; this usage is now found only in Microsoft operating systems. Unlike the concept of UNIX mount points, where volumes are named and located arbitrarily in a single hierarchical namespace, drive letter assignment allows multiple highest-level namespaces. Drive letter assignment is thus a process of using letters to name the roots of the "forest" representing the file system; each volume holds an independent "tree" (or, for non-hierarchical file systems, an independent list of files).

So, how can you reproduce this? Well, using an automount would be fairly close to what you are asking... But that requires editting the autofs file, and requires the username / password to be hard coded...

That's bad security...

So, as the answerer in the other page said...

If it is a network share just drag the mounted disk to the Login Items tab of the Accounts System Preference pane under the account of your user. The disk will then be automatically mounted on the next login.

Or, place a alias of the share on their desktop... Have them click on that and it'll prompt for their credentials... And mount the share....

Or... This isn't quite the best way I would recommend to do it, but it'll work...

This is an apple script for Map Network Drive

tell application "Finder"
    try
        mount volume "afp://username@server/directory_to_mount"
    end try
end tell
  1. You have to save as application.

  2. Set it run everytime you logon computer by Go to system preferences -> accounts -> Login item

Alternatively,

"GNARLODIOUS" is in (list disks) 
if the result is false then 
   mount volume "smb://hostname/sharename" as user name "Username" with password "password" 
end if 

on idle 
if "DISKNAME" is not in (list disks) then 
  mount volume "smb://hostname/sharename" as user name "username" with password "password" 
end if 
return 60 
end idle 

Benjamin Schollnick

Posted 2010-03-05T17:53:10.067

Reputation: 4 313

I wish I could give two check-marks as answers. You and @lexu have both enlightened me equally. Thank you! – Taptronic – 2010-03-05T23:33:22.807