APFS Snapshots: How To Roll Back To a Previous Known State

Apple file system lets you go back in time

One of the many features built-in to APFS (Apple File System) on the Mac is the ability to create a snapshot of the file system representing the state of your Mac at a specific point in time.

Snapshots have a number of uses, including creating backup points that allow you to return your Mac to the state it was in at the point in time the when snapshot was taken.

Although there is support for snapshots in the files system, Apple has only provided minimal tools for taking advantage of the feature. Instead of waiting for third-party developers to release new file system utilities, we're going to take a look how you can use snapshots today to help you in managing your Mac.

01
of 03

Automatic Snapshots For macOS Updates

Mac App Store with macOS High Sierra featured.
APFS snapshots are automatically created when you install a system update on an APFS formatted volume. Screen shot courtesy of Coyote Moon, Inc.

Starting with macOS High Sierra, Apple is using snapshots to create a backup point that would allow you to recover from an operating system upgrade that went wrong, or just return to the previous version of the macOS if you decided you didn’t like the upgrade.

In either case, the rollback to the saved snapshot state does not require you to reinstall the old OS or even restore information from backups you may have created in Time Machine or third-party backup apps.

This is a good example of how snapshots can be used, even better the process is fully automatic, there is nothing you need to do other than run the macOS update from the Mac App Store to create a snapshot you can rollback to should the need arise. A basic example would be the following:

  1. Launch the App Store located either in the Dock or from the Apple menu.
  2. Select the new version of the macOS you wish to install or select a system update from the Updates section of the store.
  3. Start the update or install, the Mac Apps store will download the needed files and start the update or install for you.
  4. Once the install starts, and you have agreed to the license terms, a snapshot will be taken of the current state of the target disk for the installation before needed files are copied to the target disk and the install process continues. Remember snapshots are a feature of APFS and if the target drive is not formatted with APFS no snapshot will be saved.

Although major system updates will include the creation if an automatic snapshot, Apple has not specified what is considered an update significant enough that will automatically invoke a snapshot.

If you would rather be sure about having a snapshot to roll back to if the need arises, you can create your own snapshots using the following technique.

02
of 03

Manually Create APFS Snapshots

Use Terminal to manual create an APFS snapshot.
You can use Terminal to manual create an APFS snapshot. Screen shot courtesy of Coyote Moon, Inc.

Automatic snapshots are all fine and good, but they are only created when major system updates are installed. Snapshots are such a reasonable precautionary step that it may make sense to create a snapshot before you install any new app or perform tasks such as cleaning up files.

You can create snapshots at any time by making use of the Terminal app, a command line tool that is included with your Mac. If you haven't used Terminal before, or you're not familiar with the Mac's command line interface, don’t worry, creating snapshots is an easy task and the following step-by-step instructions will guide you through the process.

  1. Launch Terminal, located at /Applications/Utilities/
  2. A Terminal window will open. You will notice the command prompt, which usually includes the name of your Mac followed by your account name and ending with a dollar sign ($). Were going to refer to this as the command prompt, and it marks the place where Terminal is waiting for you to enter a command. You can enter commands by typing them in or copy/pasting the commands. Commands are executed when you hit the return or enter key on the keyboard.
  3. To create an APFS snapshot, copy/paste the following command into Terminal at the command prompt:
    tmutil snapshot
  4. Press enter or return on your keyboard.
  5. Terminal will respond by saying it has created a local snapshot with a specific date.
  6. You can also check to see if there are any snapshots already present with the following command:
    
    tmutil listlocalsnapshots /
  7. This will display a list of any snapshots that are already present on the local drive.

That is all there is to creating APFS snapshots.

A Few Snapshot Notes

APFS snapshots are stored only on disks that are formatted with the APFS file system.

Snapshots will only be created if the disk has plenty of free space.

When storage space decreases, snapshots will be deleted automatically starting with the oldest first.

03
of 03

Returning to an APFS Snapshot Point in Time

APFS snapshots are accessed from the Time Machine utility
APFS snapshots are stored along with local Time Machine snapshots. screen shot courtesy of Coyote Moon Inc.

Returning your Mac's file system to the state it was in at an APFS snapshot requires a few steps that include the use of the Recovery HD, and the Time Machine utility.

Although Time Machine utility is used, you do not have to have Time Machine setup or have it being used for backups, though it is not a bad idea to have an effective backup system in place.

If you do ever need to restore your Mac to a save snapshot state, follow these instructions:

  1. Restart your Mac while holding down the command (cloverleaf) and R key. Keep both keys pressed until you see the Apple logo appear. Your Mac will boot into recovery mode, a special state used for reinstalling the macOS or repairing Mac issues.
  2. The Recovery window will open with the title macOS Utilities and will present four options:
    • Restore From Time Machine Backup.
    • Reinstall macOS.
    • Get Help Online.
    • Disk Utility.
  3. Select the Restore From Time Machine Backup item, then click the Continue button.
  4. The Restore from Time Machine window will appear.
  5. Click the Continue button.
  6. A list of disks connected to your Mac that contain Time Machine backups or snapshots will be displayed. Select the disk that contains the snapshots (this is usually your Mac's startup disk), then click Continue.
  7. A list of snapshots will be displayed sorted by date and the macOS version they were created with. Select the snapshot you wish to restore from, then click Continue.
  8. A sheet will drop down asking if you really want to restore from the selected snapshot. Click the Continue button to proceed.
  9. The restore will begin and a process bar will be displayed. Once the restore is complete, your Mac will reboot automatically.

That's the entire process for restoring from an APFS snapshot.