I got a shiny new M1 Max MacBook Pro this week. When I setup new computers I tend to opt for setting them up new and transferring the data over “manually”; i.e. not using Migration Assistant.
I started this migration the same way that I traditionally have, using Share Disk (formerly Target Disk Mode (TDM)) and
rsync. I made a few observations and, in the end, changes to how I’ll be doing data migrations going forward.
- You can easily connect Macs over ThunderBolt (TB) while booted
- Macs connect using the Thunderbolt Bridge and get a 169.254/16 address
- rsync over SSH is, as far as I’m aware, the fastest way to transfer data between two Macs
- See the SSH section for my rsync over SSH command
My first observation was that two Macs can charge each other. If one or neither of the Macs are charging, and then you plug the two into each other, they will pick one to charge. From my observations, if one Mac is charging, it’ll pass some of that charge on to the non-charging Mac. If no Macs are charging, they’ll pick the Mac with the highest charge and it will start charging the other.
As far as I’m aware, there isn’t a way to disable this.
My second observation was that my transfer speeds were slow. I was using a Belkin ThunderBolt 3 (TB3) cable. TB3 has a theoretical speed of 40 Gbps (Gigabits per second) or roughly 5,120 MB/s (MegaBytes per second). I was transferring at roughly 30 MB/s.
Charge Cable Theory
I’ve noticed that there are a lot of USB cables that offer a high power rate, but a lower (USB-2 ~480 Mbps) data rate (like Apple’s USB-C charge cables). This made me wonder if because my TB3 cable was charging the other Mac if it had prioritized charging and degraded the data transfer speed to USB-2.
To test this theory, I unshared the old Mac’s disk, unplugged the TB3 cable from both, plugged both into power, reconnected the TB3 cable, and then re-shared the disk.
I started a new transfer and was now transferring at around 100 MB/s. Being over 3x faster was still slower than I expected. Mike’s theory echo’d mine, that the Macs are negotiating the TB3 connection at Gigabit speeds. Since Share Disk uses SMB, I’m assuming that I was then losing ~28 MB/s to SMB overhead.
Mike then schooled me that I don’t even need Share Disk/TDM. Macs will automagically network with each other when connected over TB3.
I rebooted the old Mac and sure enough with the two connected they automagically networked with each other. You can see this by opening System Preferences -> Network and looking at the Thunderbolt Bridge interface. Both Macs should have a 169.254.x.x/16 address.
With this new knowledge I set out to run a few more tests. I wanted to test the speeds while booted over SMB, SSH, and Mat mentioned NFS.
I used the same folder for all of my tests. It was an ~11.76 GB folder that contained two virtual machines. For all three protocols I used
rsync -a to transfer the data.
I started with SMB since that’s what Share Disk was using. I set SMB up the usual way – System Preferences -> Sharing -> check File Sharing. I didn’t make any adjustments to the SMB config.
- ~65 MB/s, ~2m54s to transfer
I was surprised to find that my transfer speed was a lot slower than when in Share Disk mode.
Next up was NFS. I was curious about NFS since I haven’t used it much and I’ve never created an NFS share on macOS before.
To configure NFS I did the following:
sudo vi /etc/exports
/Users/bryan -maproot=nobody -sec=sys -network 169.254.0.0 -mask 255.255.0.0to the file
- Started NFS
sudo nfsd enable
Here’s the result:
- ~85 MB/s, ~2m17s to transfer
Faster than booted SMB, but slower than Share Disk SMB.
The final protocol that I tested was SSH. I set it up the usual way – System Preferences -> Sharing -> check Remote Login. I didn’t make any adjustments to the SSH config.
The one tricky thing for me was rsync’ing a folder with a space in the name. This was the command that worked for me:
time rsync -av -e ssh email@example.com:~/Documents/"Virtual\ Machines.localized" ~/Desktop/
Here’s the result:
- ~209 MB/s, ~55s to transfer
Rsync over SSH obliterated SMB and NFS.
My haunch is that booted SMB was ~30 MB/s slower due to Share Disk SMB config optimizations. It might be possible to configure SMB to be even faster than SSH.
While rsync over SSH is the clear winner in terms of speed, I still don’t know why I can’t get speeds over 230 MB/s. Please reach out if you have any tips on achieving higher speeds.
Going forward I’ll be using booted rsync over SSH whenever I can.