Home > Apple File System, Mac administration, macOS, Time Machine > Mounting Time Machine local snapshots as read-only volumes

Mounting Time Machine local snapshots as read-only volumes

Starting with macOS High Sierra, Time Machine on Apple File System-formatted (APFS) boot drives gained the ability to create APFS snapshots. These snapshots are stored on the boot volume, but are not the same as the local backups that Time Machine uses on HFS+-formatted drives.

On HFS+ formatted drives, Time Machine local backups are stored in an invisible directory named .MobileBackups on the root level of the boot drive.

Screen Shot 2019 02 23 at 10 44 17 AM

In turn, this .MobileBackups directory is mountable as /Volumes/MobileBackups and you can access the backed-up files stored inside by navigating via the command line or Finder window.

Screen Shot 2019 02 23 at 10 59 43 AM

On APFS-formatted drives, the /.MobileBackups directory and /Volumes/MobileBackups are no longer available. Instead, Time Machine is now using APFS snapshots to store a read-only copy of the state of your Mac at the time when that snapshot was taken. These snapshots are invisible to the file system, so unlike HFS+, there isn’t a directory or file you can access. Instead, you now need to use the mount_apfs command’s -s option to mount APFS snapshots as read-only volumes.

Screen Shot 2019 02 23 at 11 45 51 AM

For more details, please see below the jump.

To mount a Time Machine local snapshot as a read-only volume, you will need to first create a directory in a preferred location. This directory will act as the mount point for the snapshot.

For this example, a directory named snapshotbackup will be created in the /tmp directory.

Screen Shot 2019 02 23 at 11 20 20 AM

Next, the snapshot to mount must be identified. The snapshots currently stored on the boot drive can be listed using the following command:

tmutil listlocalsnapshots /

Screen Shot 2019 02 23 at 11 13 43 AM

 

For this example, the following snapshot will be used:

com.apple.TimeMachine.2019-02-23-102421

Screen Shot 2019 02 23 at 11 21 02 AM

 

Once the mount point and snapshot have been identified, a command similar to the one shown below should mount the snapshot:

mount_apfs -s snapshot_name_here backed_up_volume_name_here mountpoint_name_here

For this example, the command should look like this:

mount_apfs -s com.apple.TimeMachine.2019-02-23-102421 / /tmp/snapshotbackup

Screen Shot 2019 02 23 at 11 25 39 AM

The snapshot should then mount and appear as a read-only volume in the Finder.

Screen Shot 2019 02 23 at 11 26 43 AM

Screen Shot 2019 02 23 at 11 26 49 AM

To access the snapshot’s contents via the command line, you will need to access it via the mount point. For this example, this means the following directory path:

/tmp/snapshotbackup

 

Screen Shot 2019 02 23 at 11 29 44 AM

Once finished with the snapshot, it can be unmounted via the command line or the Finder. To unmount via the command line, a command similar to the one shown below should unmount the snapshot:

diskutil unmount mountpoint_name_here

For our example, the following command will unmount the snapshot:

diskutil unmount /tmp/snapshotbackup

Screen Shot 2019 02 23 at 11 34 11 AM

  1. August 28, 2019 at 12:28 pm

    This does not seem to work after Catalina – “No such file or directory” from mount_apfs

  2. September 3, 2019 at 9:11 pm

    Same issue here on Catalina `mount_apfs: volume could not be mounted: No such file or directory`.

  3. October 8, 2019 at 7:37 pm

    The following works for me on Catalina: /sbin/mount_apfs -o nobrowse,ro -s com.apple.TimeMachine.2019-10-08-210010.local / $TMP/foo

  4. Csaba Fitzl
    November 17, 2019 at 10:31 am

    On Catalina, the Volume is different. This works:
    mount_apfs -o nobrowse,ro -s com.apple.TimeMachine.2019-11-16-182353.local /System/Volumes/Data /tmp/snap

  1. No trackbacks yet.

Leave a comment