macOS users - AutoMount your Shares


Recommended Posts

The script is still working well under Mavericks.

 

With the announcement of unRAID 5.0.3 we have the following changes (amongst some others):

- emhttp: avahi smb service name changed from "%h-SMB" to "%h" (%h is your server hostname)
- emhttp: avahi afp service name changed from "%h" to "%h-AFP"; and generate proper time-machine records

 

I'm using different network drives with SMB and AFP (the script contains the afp protocol) but since I upgraded today to 5.0.3 I do see only those drives, that are included in the script.

 

Are there any changes needed with unRAID 5.0.3 ? Anyone else who experienced the issue?

Link to comment
  • Replies 232
  • Created
  • Last Reply

Top Posters In This Topic

The script is still working well under Mavericks.

 

With the announcement of unRAID 5.0.3 we have the following changes (amongst some others):

- emhttp: avahi smb service name changed from "%h-SMB" to "%h" (%h is your server hostname)
- emhttp: avahi afp service name changed from "%h" to "%h-AFP"; and generate proper time-machine records

 

I'm using different network drives with SMB and AFP (the script contains the afp protocol) but since I upgraded today to 5.0.3 I do see only those drives, that are included in the script.

 

Are there any changes needed with unRAID 5.0.3 ? Anyone else who experienced the issue?

 

If you're using afp, HOSTNAME must be set to HOSTNAME-AFP

Link to comment
  • 1 month later...

Script no longer works with OSX 10.9.1 and UNRAID 5.0.4.  When I run the script in Terminal, I get the following error:

 

Mounting Media
mount_afp: AFPMountURL returned error -1069, errno is -1069
Media mount failed. Check settings/server. Removing mount point.

 

Any ideas on solving this issue?

Link to comment
  • 1 month later...

The script still works for me (with 10.9.1 and 5.0.3), to a certain extent. When I don't change it (so leave HOSTNAME - hence without adding -AFP) it will mount the shares properly (like before). However, when I try to SMB mount (HOSTNAME) I get the AFP shares and the SMB disks (incl flash drive) are not accessible. Will try some more troubleshooting.

 

edit: when I change the script to HOSTNAME-AFP it doesn't seem to work.

Link to comment

Running unRAID 5.0.3, both SMB and AFP. Can't mount a single SMB share from latest Mavericks... unRAID itself works fine from other clients. Any hints highly appreciated? Thanks!

Well...in Mavericks there's not a lot you can do to turn off SMB...and in unRAID 5.0.3, SMB + Mavericks work great for me...although it took me a bit to figure it out.

(OBTW: You might want to upgrade unRAID to 5.0.5. There are a couple of minor improvements but that won't fix your problem.)

 

Try this:  You say SMB works fine from other clients, so the following may not be productive.

on unRAID web interface, go to TOWER/SETTINGS/SMB and make sure 'enable SMB' is 'YES (WORKGROUP)', and that your enduserid (not 'root') is authorized. Local master is 'yes'.  Then in the USER SHARE you're trying to get to, for the SMB Share settings, make sure the share is EXPORTED and SECURITY is set correctly. ('YES',and 'PUBLIC' if you dont' care about privacy. ('YES' and 'PRIVATE' if you do...in which case, make sure your end-user-id is on the allowed access list.)

 

Then try this on your Mac:

go to FINDER/GO/CONNECT TO SERVER.../ and select your tower. The address is important here...try 'smb://192.168.1.xx' where '192.168.1.xx' is your local IP address.  It *may* work as 'smb://tower.local'.  Connect using your end-user-id and pswd (not 'root')

Link to comment

Hi,

 

First of, thanks a lot for this script. a great solution compared to the programs that are available. And thanks for sharing it.

 

As a relatively new OSX user, I'm wondering if it is possible to start iTunes minimized. I run a Mac Mini as a media player with Plex. iTunes always runs minimized so my music is available for AirPlay. The script reopens iTunes when the server is available again, but iTunes takes focus. It would be nice if there is a way to open iTunes minimized.

Link to comment

You could try this... Adding argument -g to the open command will apparently not open the Application in the foreground. Open the script in a good text editor (like TextWrangler, etc), and edit the line:

 

...

echo "Attempting to open iTunes"

open /Applications/iTunes.app/

...

 

TO:

 

...

echo "Attempting to open iTunes"

open -g /Applications/iTunes.app/

...

Link to comment
  • 3 weeks later...

I'm having a problem getting my afp drive to mount.  I have a share that uses a guest account and no password.  I also tried HOSTNAME="tower._afpovertcp._tcp.local"  I have run the script manually from terminal and get the results below.  If I manually mount the share by clicking on tower in my side bar and my music iTunes opens right up and works properly.  So the checking of the mount status automatically is working and the problem seems to just be with mounting the share.  I'm running 10.9.2 for what it's worth.

 

_______________________

 

# Script Location

SCRIPTLOCATION="/Scripts"

 

# Username for server

USERNAME="guest"

 

# Password for server, check notes

PASSWORD=""

 

# IP Address/hostname for ping

PING="10.0.1.200"

 

# Hostname for server. Try sername.local, hostname or IP

HOSTNAME="tower-afp.local"

 

# Protocol in lowercase, afp or smb

PROTOCOL="afp"

 

# Shares, check notes

SHARES="Our%20Music"

_________________________

 

 

--- 10.0.1.200 ping statistics ---

5 packets transmitted, 5 packets received, 0.0% packet loss

round-trip min/avg/max/stddev = 0.396/0.492/0.810/0.159 ms

Mounting Our Music

mount_afp: AFPMountURL returned error -1069, errno is -1069

Our Music mount failed. Check settings/server. Removing mount point.

*************

Attempting to close iTunes

MacVM:~ brad$

 

Link to comment
  • 1 month later...
  • 4 months later...

So far the script worked flawless on two Mac's for me. This week I bought a new Mac Mini, installed the script as stated in the first post. No luck. I am unable to launch com.media.mount.plist. It doesn't show in the list when typing launchctl list. When typing /Scripts/mount.sh the script runs and mounts the volumes. It just is not working automated anymore.

 

Tried a lot of different options. Copying the script from a working machine, checking the script for typo's or wrong formatting, repaired permissions and even a clean install of OSX. It seems I'm missing something, any pointers for me?

Link to comment

So far the script worked flawless on two Mac's for me. This week I bought a new Mac Mini, installed the script as stated in the first post. No luck. I am unable to launch com.media.mount.plist. It doesn't show in the list when typing launchctl list. When typing /Scripts/mount.sh the script runs and mounts the volumes. It just is not working automated anymore.

 

Tried a lot of different options. Copying the script from a working machine, checking the script for typo's or wrong formatting, repaired permissions and even a clean install of OSX. It seems I'm missing something, any pointers for me?

 

I'm in the same boat.  I had it working on my main laptop but I trying to get it setup on a virtual mac on my server farm at home to use as my central iTunes library for my whole house sound system and hopefully setup all of our i devices to wirelessly sync off the central "mac server"  Having the iTunes server would be great as I could make all the changes too playlists there and my wives devices would update automatically.  Eventually I would like to present iTunes like a remote app but thats down the road.

Link to comment
  • 3 weeks later...

Thanks for this great script!

 

On Mavericks, I invoked this tool from a cron job, and "command not found" errors for ping and umount. The problem is that cron has a restricted PATH. You might consider adding:

 

PATH="$PATH:/sbin"

 

to the top of the script, or change all the sbin commands to use the full path.

Link to comment

Thanks for this great script!

 

On Mavericks, I invoked this tool from a cron job, and "command not found" errors for ping and umount. The problem is that cron has a restricted PATH. You might consider adding:

 

PATH="$PATH:/sbin"

 

to the top of the script, or change all the sbin commands to use the full path.

 

Best option is to use launchd. Feel free to modify the script as required  :-)

Link to comment

Thanks for this great script!

 

On Mavericks, I invoked this tool from a cron job, and "command not found" errors for ping and umount. The problem is that cron has a restricted PATH. You might consider adding:

 

PATH="$PATH:/sbin"

 

to the top of the script, or change all the sbin commands to use the full path.

 

 

 

So do I add

PATH="$PATH:/sbin"

  to the top of speedingant's mount.sh script? 

 

Best option is to use launchd. Feel free to modify the script as required  :-)

Link to comment
  • 1 month later...

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.