A guide to managing your Time Machine backup disk

Matt Miller
7 min readMar 27, 2021

One of the best features of macOS is Time Machine. Time Machine automatically backs up your data, applications, and settings periodically whenever your Mac is plugged into power and connected to your external hard drive. It comes with a visual interface that lets you very easily revert the state of your system to another time in history, or restore specific files or settings.

I don’t have a ton of photos and videos, so my backups don’t take up a lot of space. I purchased a 2 TB SSD to use as my backup drive back in 2016. Since then, macOS has much improved in way of introducing the APFS file system, as well as automatically partitioning your drive so that if you want to use the same disk to back up multiple computers, each one will have a dedicated partition with its own password protection.

While Time Machine is pretty easy to set up, after five years of experience with it, I’ve learned that there are some things you need to watch out for. So in this article, I’m going to outline how you can configure your Macs optimally for backups.

Format your drive as APFS (Case-sensitive)

When setting up a new SSD to serve as a Time Machine backup drive, I recommend formatting the disk as APFS. It’s the optimal file system for performance on your Mac, and reduces the risk of data corruption when a transfer gets interrupted.

You can do this by opening the Disk Utility app, selecting your drive from the list, and clicking Erase. Then, in the Format dropdown, select APFS (Case-sensitive).

Format your drive as APFS (iirc you do not need to choose Encrypted, as you have the option to set a password when configuring Time Machine)

You’re now ready to configure Time Machine. Open System Preferences and click Time Machine.

You’ll want to choose a password to encrypt the drive with. Choose a strong password and make sure you write it down or fully commit it. Most likely, you will configure your Mac to store the password in the Keychain so that you don’t need to enter it every time you connect and disconnect your backup drive — but you will definitely need it if your computer fails in the future and you need to recover from your backups!

System Preferences > Time Machine

Select your backup disk, set the password, and tick Back Up Automatically, and you should be all set!

Exclude unimportant data from your backups

While you’re in Time Machine preferences, it might be a good idea to choose some of your bulkier folders, files, or applications to exclude from backups to save time and space. Click the Options… button to add items to skip backing up.

You probably don’t need backups of every version of Xcode 😄

Tip: If you use the app Karabiner-Elements, make sure to exclude Karabiner-Elements and Karabiner-EventViewer from your backups. Trust me on this — these application files are very difficult to remove without the uninstaller, and it makes cleaning up old backups extremely difficult (something which, otherwise, is automatically performed by Time Machine when your drive starts to run low on space).

Always eject

Everyone has seen this error message before, and it’s easy to dismiss. However, on three occasions I’ve had my backup drive partially corrupted by carelessly unplugging my MacBook from its USB-C hub.

It’s easy to eject!

  • If the drive appears on your desktop, you can right-click and click Eject. Wait until the icon disappears from your desktop before removing.
  • You can open Finder and click the eject icon next to the drive name. Wait for the drive to be removed from the list.
  • If you’re a nerd, you can customize your touch bar or menu bar like me to add a custom eject button. I accomplished this with BetterTouchTool, and I’ll show how I did it at the end of this article if you’re interested.

If you have multiple computers, configure them to only mount their own backup partition

I use the same physical drive to back up my work and personal Macs, so they each have their own partition.

If you want to do this too, it’s pretty simple! Once you’ve set up Time Machine on one computer, simply eject it and plug your drive into your other computer. If you are prompted to enter the password to unlock the drive, just cancel out of that prompt — that is the password to unlock the other partition for your other computer.

Open Time Machine in System Preferences and select your disk. You will be prompted with some choices.

If you select “Use Both”, macOS will create a new encrypted partition on your drive

Choose Use Both. Time Machine will automatically create a new encrypted partition on your drive that will store backups for this computer!

One annoying thing about this is that both partitions are going to be mounted every time you connect the drive to either computer. However, if I connect my SSD to my personal Mac, I only want to mount the backup partition for my personal Mac, and vice versa for my work computer.

To fix this, you need to update a configuration file on your computer.

First, you need to find a special unique ID. Open Disk Utility and find the backup drive that you don’t want to mount automatically (i.e. whichever backup partition is for your other computer). Right-click and select Get Info.

The File system UUID is used to uniquely and permanently identify the partition

Find the row labeled File system UUID. Select it and press ⌘ + C or choose Edit > Copy.

Paste the contents into any text editor program. You’ll see something like this:

File system UUID : 8E2258F5-7D78-4FE9-B657-1CA24DDE16AB

Select the ID part and copy that to the clipboard, e.g. 8E2258F5–7D78–4FE9-B657–1CA24DDE16AB in my case.

Open Terminal, then enter this command:

sudo nano /etc/fstab

Enter your password when prompted.

Type out the contents of the file like this. In place of the bold ID below, you should paste your ID value.

UUID=8E2258F5-7D78-4FE9-B657-1CA24DDE16AB  none  APFSX  rw,noauto

To save, press Ctrl + O, then Return. To exit the nano editor, press Ctrl + X.

Eject both partitions first, then unplug your external SSD. Wait a minute, then plug it back in.

If everything worked, you should see that only the right backup partition is mounted when you connect it. If you open Disk Utility again, you should see the other partition as greyed-out.

The other backup drive is no longer mounted automatically

Bonus: Use BetterTouchTool to create shortcuts for ejecting your disk safely

Being a programmer, I wanted to automate the process of ejecting before I disconnect my external SSD. I am a fan of using BetterTouchTool to customize my MBP’s touch bar, the macOS menu bar, snap-to-resize windows, and global keyboard shortcuts. It has some bugs, but overall it’s easy to add custom behavior and I love using it!

I created both a menubar icon button and a touch bar icon button. They are highlighted in orange when my backup disk is connected to my computer to remind me that I need to eject. When the button is pressed, an AppleScript is executed that instructs Finder to eject the disk and display a notification when it’s safe to remove.

There are two main scripts involved (technically four — they are essentially copy/pasted between the menubar and the touch bar; the menu bar script and configuration is slightly different due to bugs I encountered and limitations in the configuration in BTT).

The first script is executed at an interval (every 5 seconds) and is used to determine whether to highlight the button to indicate that the disk is currently mounted:

tell application "System Events" to
set diskNames to name of every disk
set computer_name to
computer name of (system info)
set partition_name to
"Backups of " & computer_name
set is_mounted to
(partition_name is in diskNames)
return is_mounted

The second script is executed when you click/tap the button. It commands Finder to eject the disk and then waits for it to complete before displaying a desktop notification. Note: in order to display notifications, the script has to be executed synchronously. This means that, while you are waiting for the disk to eject, your computer will likely lock/freeze up. If you don’t care about the notification, you can check the box in BTT to execute the script non-blocking.

set computer_name to
computer name of (system info)
set partition_name to
"Backups of " & computer_name
tell application "Finder"
eject disk partition_name
end tell
display notification
"It's now safe to remove the "
& partition_name
& " media from your computer"
with title
"Time Machine disk ejected"

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Matt Miller
Matt Miller

No responses yet

Write a response