you are at bobd.tech

← back in the day

SMB vs AFP to my Drobo FS

· bobs tech

The recent Mavericks update broke an automator script i had that would simply “Connect to Servers”. It seems if the servers had already been connected, the script would fail…  i couldn’t find a quick workaround. So I decided to write a bash script to do the same thing.

In doing so I decided to do some benchmarks to see if SMB or AFP was faster. In a quick test here is what i found:

  • Finder access was noticeably snappier to list the files when the drive was mounted via SMB

  • Copying from my Drobo to my MBP over wifi, faster for AFP. A 367MB file copied in:

  • SMB: 37.75s, 34.58s, ~10MB/s

  • AFP: 25.93s, 21.88s, ~15MB/s

Still seems pretty slow, but I can live with it.

Here is the bash script for any interested:

#!/bin/bash
#
# Script used to mount B and MP3 from mediasrv so we can access them for torrent copying
# or for itunes
#

PROTOCOL=afp

mountShare () {
        # check if the dir exists and has files - if it does, we're done
        FC=`ls -l $2 2> /dev/null | wc -l`
        if [ "$FC" -eq 0 ]
        then    
                mkdir $2
                mount -t $PROTOCOL $1 $2
        fi
        return 0
}

mountShare "afp://user:pass@mediasrv/B" "/Volumes/B"
mountShare "afp://user:pass@mediasrv/MP3" "/Volumes/MP3"

If anyone has comments regarding if I should just automount these drives, let me know!