Time Machine backup disk migration to network drive

Blog

A Guide to Using Apple Time Machine and your NAS

Apple Time Machine is a backup software application included with macOS operating system from Apple. The software is designed to work with their range of AirPort Time Capsule devices, the Wi-Fi router with built-in hard disk (which apple are pulling out of), as well as other internal and external disk drives connected via USB and Thunderbolt. It was introduced in Mac OS X Leopard quite a few years ago and has become a backup essential for Mac users worldwide. With the growth of popularity in NAS devices from QNAP and 3rd party clouds like Google Drive, Amazon Drive and CrashPlan it has become a common requirement to store backup images of a Mac system off-site.

How to stop a Time Machine backup

If you don’t have time to back up now – perhaps you need to shut down your Mac and rush home – you can stop Time Machine from backing up your Mac.

Next to the progress bar described above you will see an X. Click on this to stop the backup. The system will start the back up again in one hour. To start it again see how to force a Time Machine backup above.

If you want to pause a backup and finish it later, select Skip This Backup from the Time Machine menu.

How to stop Time Machine backing up automatically

If the hourly backups become annoying you can disable them – but don’t forget to use Time Machine to backup from time to time, and remember that when you do it will take longer because the system won’t be making the incremental hourly backups so there will be more to cover.

  1. To stop automatic backups go to System Preferences > Time Machine
  2. Deselect Back up Automatically. (In Mac OS X El Capitan or earlier choose Turn off Time Machine).
  3. When you next want to back up your Mac click on the greyed-out Time Machine icon in your menu bar and choose Back Up Now.

Video

What You Need

  • A Mac: The computer should have OS X Mountain Lion (10.8) or later installed on it.
  • Three drives: Each drive must be large enough to store the data you have on your Mac and then some. The more space available on the backup drives, the more historical Time Machine data they can hold.

If you only want to create a two-drive backup system, you can follow this process. Just modify the number of drives from three to two as you work through the instructions.

This guide works for local internal drives, external drives, and network drives that Time Machine supports.

Step 3: Copying contents

Method 1: Copy using disk cloning (fast, unstable)

There is an easier and faster way – clone external backup disk to sparse bundle disk using dd as it is. No need to care about case sensitivity or ownership flag – your sparse bundle will have exactly the same byte to byte state as your external backup disk. Your sparse bundle volume must have the same or a little bit larger size than source disk. You can resize (grow) HFS+ partition on sparse bundle disk after but it is not fast.

Steps:

  • Make sure that both source backup disk and target sparse bundle disk are visible in Disk Utility.
  • Unmount partitions (but not eject volumes) on source disk and target image.
  • Enable “Terminal” to have full disk access:
    • Open “System Preferences”
    • Then “Security and Privacy”
    • Then “Privacy”
    • Then “Full Disk Access”
    • Press “+” and add “Terminal” application
  • Quit “Terminal” if it is already started and start “Terminal” application.
  • Start copy process
    • Run sudo dd if=/dev/r{SourceDisk} of=/dev/r{DestinationDisk} bs=2m
    • Example with macOS dd: sudo dd if=/dev/rdiskA of=/dev/rdiskB bs=2m
    • Use r prefix, this will make process faster
    • Use disk ID, not partition ID
    • Grab identifiers from Disk Utility or using diskutil list.
      • rdiskA must be a physical disk where you are copying form
      • rdiskB must be a sparse bundle disk located on physical disk where you are copying to
    • Block size 2m should improve performance. You could experiment with different values. Terminate the process with Control + C, unmount volume again (otherwise macOS will auto mount it) and test the speed.
    • Press Control + T to see the progress and the speed.
    • If you have HomeBrew and coreutils installed then you could use GNU dd that can automatically report progress
      • Run sudo gdd if=/dev/r{SourceDisk} of=/dev/r{DestinationDisk} bs=2M status=progress
      • Example:sudo gdd if=/dev/rdiskA of=/dev/rdiskB bs=2M status=progress
      • Block size units have slightly different format (M instead of m).
  • Rename HFS+ volume on sparse bundle disk to Time Machine Backups after (not sure if it is required, but macOS created sparse bundles have this name for backup volume).
    • Open Disk Utility
    • Select partition inside sparse bundle image
    • Right click -> Rename
    • Type the name Time Machine Backups
  • Sparse bundle won’t have exactly the same size as source disk, so need to fix that:
    • You could skip this step if source backup disk and sparse bundle have the same or about the same size.
    • Repair sparse bundle partition map (this will grow partition size in GPT)
      • Run sudo diskutil repairDisk {SparseBundleDiskID}
      • Example: sudo diskutil repairDisk diskX
    • Grow backup HFS+ volume in sparse bundle (grow volume size to partition size)
      • Run sudo diskutil resizeVolume {TimeMachineBackupPartID} 0
      • Example: sudo diskutil resizeVolume diskXs2 0
      • Resize will also trigger HFS+ file system check and it is good to confirm that partition after this hardcore migration is still not damaged
      • This procedure will take a lot of time because file system check is slow.

Paragon ExtFS did not show perfect stability for me. It crashed macOS a few times until succeded.

The only time the process has succeded was with these steps and in ~3.5 hours:

  • fresh rebooted macOS
  • all applications besides Terminal were closed
  • default band size was used
  • gdd instead of dd
  • disabled macOS sleep using Amphetamine app

Let me know if you will find what exactly can crash the copying process, so I can share more details here for others.

Example:

Method 2: Copy using Finder (slow, stable)

Your external backup disk most-likely has case-insensitive HFS+ and the sparse bundle will have by default case-sensitive HFS+ so copying Backups.backupdb using Finder won’t work by default.

Steps:

  • Reformat sparse bundle volume to case-insensitive HFS+ (same filesystem as external backup disk) using Disk Utility.
  • Manually set ownership flag on it using Terminal and the remount: sudo diskutil enableOwnership {PartID}.
  • Only after that you can copy Backups.backupdb using Finder from one volume to another volume.

But it will take EXTREME amount of time. In my case even whole night was not enough to build just list of files to copy. I can only imagine how long will it take to also copy files. I gave up and decided to go forward with local cloning solution.

Mac shared as a Time Machine backup destination

To use another Mac on your network as a Time Machine backup destination, complete these steps on the other Mac:

  1. Choose Apple menu  > System Preferences, then click Sharing.
  2. From the list of services on the left, select File Sharing.
  3. From the Shared Folders list on the right, click the add button (+), then choose a folder to use for Time Machine backups.
  4. Control-click the folder that you added, then choose Advanced Options from the shortcuts menu that appears. From the Advanced Options dialog, select “Share as
  5. From the Advanced Options dialog, select “Share as a Time Machine backup destination.”

When setting up Time Machine on your other Mac computers, you should now be able to select the shared folder as a backup disk.

Step Three: Download and Run the Time Machine Shell Script

Advertisement

In the previous guide, this step required a bit of Terminal kung fu. Now all you have to do is download this shell script (read more about it at InsanelyMac), open Terminal, cd to the folder containing the makeImage.sh script, and then run the following command:

Be sure to replace 130 with the size you'd prefer your Time Machine backup to be, and replace /Volumes/TimeMachine/ with the path to the mounted Windows volume you set up above. (Assuming you mounted that Windows share, you can simply type /Volumes/ and press Tab twice to see the mounted volumes on your machine. You should see your mounted Windows folder there.)

Advertisement

How to back up multiple Macs

If you have more than one Mac you don’t need more than one external drive for your backups. You can backup more than one Mac to your Time Machine drive. You’ll need a external drive big enough to accommodate all the backups though – it’s recommended that you add up the space currently used by all your Macs and multiply that by 1.2 for the absolute minimum you will need.

You could just plug your Time Machine backup drive into another Mac. That Mac will start recording its own backups to a separate folder on that drive.

If you don’t fancy plugging and unplugging the drive all the time you can back up over the network – but beware that this might be slower than doing so via a wired connection. You could set up a network attached storage device, or a macOS Server, or you could use Personal File Sharing and connect both Macs via the network.

Tags