SMB and AFP


Nem

Recommended Posts

I use both mac and windows computers on my network - are there any issues (is it recommended) with exporting a share as both SMB and AFP?

 

I cant seem to find a way on my macbook to automount SMB shares without using something like controlplane, and I believe Macs can automount AFP shares, hence the reason for asking

Link to comment

I use AFP with OS X and SMB with Windows at the same time without problems. For automounting shares on a reboot of OS X I do the following to set them up:

 

1. Mount a share manually using the Finder

2. Open System Preferences -> Users & Groups -> Login Items

3. Make sure your current user is correctly selected in the left pane

4. Drag the icon of the share from the Desktop and drop it into the pane that already contains such things as iTunesHelper (and DropBox, in my case)

 

Next time you log in the share will be mounted. It doesn't need any fancy scripts as it's built into the OS and it works with both SMB and AFP shares.

 

Link to comment

I use AFP with OS X and SMB with Windows at the same time without problems. For automounting shares on a reboot of OS X I do the following to set them up:

 

1. Mount a share manually using the Finder

2. Open System Preferences -> Users & Groups -> Login Items

3. Make sure your current user is correctly selected in the left pane

4. Drag the icon of the share from the Desktop and drop it into the pane that already contains such things as iTunesHelper (and DropBox, in my case)

 

Next time you log in the share will be mounted. It doesn't need any fancy scripts as it's built into the OS and it works with both SMB and AFP shares.

 

I use the same procedure. The only difference is that if the share unmounts it won't get re-mounted and I don't think there is any iTunes support.

Link to comment

I'm often on 2 different networks. One at school and one at home.

 

When I'm at home I'd like to automount the SMB/AFP shares as I'm on the same network as my server. This is not the case when I'm at school. However, I have a VPN set up on my server so I can access the shares of my home network while I'm away.

 

I think the methods outlined above will automount the shares if I'm on the home network and I log in to my laptop. But do they/is there a way to automount then when connecting through my VPN?

Link to comment

I use the same procedure. The only difference is that if the share unmounts it won't get re-mounted and I don't think there is any iTunes support.

 

A share doesn't unmount itself. You either unmount it manually or it is unmounted when you log out, in both cases it will remount when you log back in again.

 

What kind of iTunes support do you think is missing? I moved my iTunes library off my MacBook Pro and onto a Mac Mini server connected by AFP and it worked as expected. (I did it initially because I was short of local disk space after replacing the HD with an SSD, but I've since moved the library back again now that I have enough space for it). It's not just a case of moving files though, as iTunes needs to keep a track of them, so it's easiest if you have iTunes relocate the files for you.

Link to comment

A share doesn't unmount itself. You either unmount it manually or it is unmounted when you log out, in both cases it will remount when you log back in again.

Perhaps my MacPro is unique? When it loses the network connection to the server it will give a popup saying the connection was lost and the share is unmounted. So far, it's never mounted again when I restart the server or switch to re-establish the network connection. I've always had to manually re-connect.

 

What kind of iTunes support do you think is missing? I moved my iTunes library off my MacBook Pro and onto a Mac Mini server connected by AFP and it worked as expected. (I did it initially because I was short of local disk space after replacing the HD with an SSD, but I've since moved the library back again now that I have enough space for it). It's not just a case of moving files though, as iTunes needs to keep a track of them, so it's easiest if you have iTunes relocate the files for you.

 

**NEW** Added functionality to wake the server via WOL **NEW**

28/12/2012 - Added the ability to call "wake" at the end of the script to wake the server, no matter which time it is. eg: /scripts/mount.sh wake

 

You must have wolcmd (included) in the same folder as the script. This is a definable directory. If the server is unavailable via ping, WAKE is set to TRUE, and the time is within the hours specified, then the script will attempt wake on lan. You must have your server MAC address and subnet in the options. This is all shown in the script.

 

Now if the server is unavailable it will exit iTunes. I found iTunes to be unstable if it can't resolve links to its music. You can set this in the script.

This is the extra functionality I was referring to. Not sure that it is still needed. I don't sleep my server and don't use it to store iTunes files so don't use these features.

 

Link to comment

Sorry Walter, but losing the network connection is not a normal occurrence but an error condition. Network shares should be unmounted before the network is disconnected. It's quite unreasonable to expect automatic recovery from an error condition. Similarly, sleeping a server is not normal practice.

 

Link to comment

Sorry Walter, but losing the network connection is not a normal occurrence but an error condition. Network shares should be unmounted before the network is disconnected. It's quite unreasonable to expect automatic recovery from an error condition. Similarly, sleeping a server is not normal practice.

 

Perhaps, but speeding_ants script makes provision for these. Network connections do get dropped and many people sleep their servers. I had my server shutdown a few months ago due to a misconfigured ups. It restarted but I had to wait until I got home to re-mount my MacPro. The script would have re-mounted the server as soon as it was back up. It's a similar situation when connecting via VPN. Shares on your home network won't mount automatically without the script AFAIK. I know that manually mounting shares is a simple process. This script is just a tool to simplify it even more.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.