If you have a Mac laptop (MacBook Pro, MacBook Air, or MacBook), you will be aware of its ability to make ‘local snapshots’ or local backups, using Time Machine, when you are working away from your normal Time Machine backup drive(s).
Mobile Time Machine up to Sierra
Because these backups are made to your laptop’s internal drive, they are not as useful as regular Time Machine backups. If your internal drive gets corrupted or damaged, chances are the local backups have gone too. By default, they are also made infrequently: whereas normal backups occur every hour or so, ‘local snapshots’ are made once a day from when you last started your Mac up, and a weekly snapshot is also made.
Time Machine is sensitive to the amount of storage space available: these snapshots will only be made if there is sufficient free space. The way it assesses that is fairly complex:
- when 20% or more of your startup drive is free, snapshots are made daily, and retained;
- when free space falls below 20%, snapshots are removed until 20% is free, then kept normally again; snapshots are made daily;
- when less than 10% remains free, snapshots are removed quickly in an effort to free space; when only one snapshot is left, Time Machine may stop making new snapshots until free space improves; it then replaces the remaining snapshot with a new one, until there is more than 10% free again.
Apple considers these snapshot backups to be akin to temporary files, so they are not included in the used space reported by the Finder (and in its Get Info dialog). The best way to tell how much space they occupy is to use the Storage tab in the About This Mac dialog, where they will be shown as Backups in the breakdown of space used. This can be confusing, as the free space reported in that dialog will then be less than that shown in the Finder or Get Info. They are also counted in the free space declared in Disk Utility, and third party tools vary in their treatment.
Although I cannot find any official documentation to confirm this, Apple engineers have warned that there are also limits to the size of files included in local snapshots, which could be as low as 20 MB. You may find it doesn’t back up files of several GB in size.
Local snapshots are removed if you turn Time Machine off, and of course no further snapshots are made until Time Machine is turned back on again.
Desktop Macs – that is, all models apart from MacBook Pro, MacBook Air, or MacBook – do not, by default, support local snapshots or ‘mobile Time Machine’, but it can be enabled at the command line. Enter
sudo tmutil enablelocal
and authenticate with your admin password to enable it, and
sudo tmutil disablelocal
and authenticate to disable it, which will also remove all existing snapshots.
You can also use the command
to make a local snapshot at any time on any Mac running a reasonably recent version of OS X / macOS.
The ‘local snapshots’ made at present (up to and including Sierra) use their own virtual file system, mtmfs (Mobile Time Machine File System), and are mounted in /Volumes/MobileBackups/Backups.backupdb, although it may be that their data are actually stored in /.MobileBackups, as they used to be.
When you want to restore files from a snapshot, use the Time Machine app in the normal way. Backups shown there which you can restore from are indicated in red in the scale along the right-hand edge of the display. When you are away from your normal external backup drive, only local snapshots will be shown in red like that. If the backup is shown in dimmed red, that is one which is available when you are reconnected to your external backup drive. Older versions of OS X use different colour conventions, which are detailed here.
A good way of thinking about these local snapshots is that they are like versions of all your documents and other files: when you are working away from your backup drive, you can still restore old versions of those files backed up locally, even when the app which has written them does not support versioning. Indeed, apps which support versioning properly will not have those versions included in local snapshots, as old versions will already exist, and they will be made available as if they were local snapshots.
In versions of OS X and macOS up to and including Sierra, Time Machine local snapshots, or mobile Time Machine, are run by a service which is scheduled and dispatched by the DAS and CTS systems, which I believe is identified as backupd-auto.dryspell, and loaded soon after startup. This does the complicated task of deciding which files to back up; it does not create the huge number of hard links seen in normal Time Machine backups to make the illusion that each backup is a complete copy of the volume being backed up.
Mobile Time Machine in High Sierra
High Sierra changes ‘mobile Time Machine’ completely, using a new mechanism dependent on the APFS file system; when you install High Sierra, your startup volume will automatically be converted to APFS, and Time Machine will then start using APFS snapshots (which are very different to the old ‘local snapshots’) when your Mac is away from its normal Time Machine backup storage.
APFS snapshots are a feature of the file system itself. In effect, they are a snapshot of the directories and other metadata which track the physical location of all your files on disk. These are amazingly quick to make, even for volumes with a very large number of files, and don’t require any of the files to be copied. Because they are so quick and easy to make, in High Sierra, mobile Time Machine should make its snapshots every hour, just like normal Time Machine.
When you want to revert to an old version of a file, or restore a file which has since been deleted, you use the regular Time Machine interface. High Sierra will then look back at the snapshot, and reconstitute the file at the time it was made from the data which still exists on the disk.
This depends, of course, on the old data still being present, another feature of APFS called copy on write. This ensures that changed files do not overwrite the original file, but are written out to unused areas of disk. Inevitably, depending on how full your disk is and how often new data has to be written to it, old versions of files will be lost over time, as they have to be re-used to make free space. But if you can keep a reasonable amount of space free on your internal disk, mobile Time Machine should give you a valuable means of going back to any version of a document over the last several days, maybe even weeks.
What in Sierra is of relatively limited value will, therefore, become very useful indeed in High Sierra – and come with no performance or storage penalties. For laptop users, this will be an important feature to consider when deciding how quickly to upgrade to High Sierra.