Automount shared directory on Leopard

Following my last post, here’s another handy new thing to do in Leopard. I never used this in Tiger (MacOS X.4) because it was not practical (besides being possible), but I swear it was usable by the time.
Auto-mounting remote shared server (Samba, NFS, AFS) wherever I want, without being stuck with a dead Finder.app whenever I lost wifi network, I change room or my mac goes to sleep (yep I used to have some problems with this).
So now how to do this ? NetInfo is gone so where can I define my automount points, remember when I said NetInfo is dead for the best ?

First, you should edit /etc/auto_master :

sudo nano /etc/auto_master

The stock version should looks like this :

#
# Automounter master map
#
+auto_master    # Use directory service
/net      -hosts    -nobrowse,nosuid
/home      auto_home  -nobrowse
/Network/Servers  -fstab
/-      -static

You need to add a line like this, just before /- -static. :

/my/mount/point/path    auto.smb

Where /my/mount/point/path will be the full path to the directory where remote shared folders will appears. Mine is set to /Users/_myusername_/Desktop/Shares.

Now create a new file in /etc/auto.smb :

sudo nano /etc/auto.smb

And add one line per remote folder you want to mount automatically, each line should looks like this :

www -fstype=smbfs ://username:password@remote_server_name_or_ip/shared_folder_name

www : this is the name you want to give to the remote folder locally

-fstype=smbfs : specify the kind of filesystem to use, I only cover samba here.

://username:passwordremote_server_name_or_ip/shared_folder_name@ : this is the informations to connect to the remote server. Change username and password with yours, specify remote_server_name_or_ip to reflect the way you access the machine and set shared_folder_name to the name of the remote folder.

Then set permission on the new file :

sudo chmod 600 /etc/auto.smb

Now restart automount daemon :

automount -vc

You should see your new mount point as well as stock ones :

automount: /net updated
automount: /home updated
automount: /my/mount/point/path updated
automount: no unmounts

Notice just like /etc/hosts that Leopard seems to only detect a change if a line is added/removed, so anytime you make a change that does not change the line number in the file add a comment (#) at the beginning or end to force a reload.[…]

Published on Sat, 26 Jan 2008 21:28
2 comments

Multiple identities in one account with Apple Mail.app

Over the time I tend to accumulate mail adresses and accounts. Not so long ago, I decided to switch from a multiple mail accounts to a single imap account where I aggregated all others.

I used to be an Apple Mail.app user, but this switch caused me some troubles. How to specify different (legitimate) sender addresses with only one account configured ? I thought it was impossible and so decided to switch to Mozilla Thunderbird which allows you to set different sender addresses by account.

But recently, I found it was possible in Mail.app and here’s how :

In your account configuration, enter a comma-separated list of adresses in the “Email Address” field.

Multiple identities for one account

Then, you’ll be able to choose which sender address should be used when writing a new mail.

Choose which adresse to use when writing a new mail

For those of you interested in my configuration, I operate a simple linux box with Postfix, Courier-Imapd and Maildrop. Then I use Fetchmail to grab mails from my different accounts and put them in my imap setup.

[Update]
Drew leave a comment about a solution to have different names for each addresses. It require you edit the preferences plist file : Mac OS X Mail app config – EmailDiscussions.com[…]

Published on Sun, 05 Nov 2006 08:30
87 comments

RSS