APFS snapshots: where are they located?

The WWDC keynote told us that the Mobile Time Machine on High Sierra will now leverage the APFS's snapshots feature. A few questions:


1) Where are the snapshots actually located? On Sierra, there was a hidden folder called /.MobileBackups. Is there a similar folder on High Sierra?


2) Will High Sierra use a similar policy on local TM snapshots, i.e. treat them like temporary files ("purgeable") and automatically remove them in part or fully, when the user runs low on disk space? Will the snapshots be removed after syncing with the external persistent storage such as Time Capsule?


3) Is there a way to turn on and off the local TM snapshots? On Sierra, there was "sudo tmutil enablelocal" but it's no longer supported.

Accepted Reply

1. Yes, this is similar to the current local snapshots implementation. I think it is represented in Disk Utility or About this Mac as "backup" or "purgeable" disk space. It's supposed to be automatically reclaimed as needed. And I think there was a trick where the Finder would display the free size of a disk as the actual free size + the purgeable size, so users wouldn't be confused as much.


But Snapshots (and clones) can be way more confusing, for example deleting files will not necessarily give you back disk space, if the files data is still referenced somewhere in clones or snapshots. So it's quite important to harvest snapshots periodically.


The 'tmutil listlocalsnapshots /' command will list all the snapshots but will not tell you how much size they occupy. By that, I mean the size that only they are referencing (.i.e. the size you would get back by deleting the snapshots). But that can be done, I just don't think Apple is showing that information anywhere for now. You're not supposed to have to worry about all this if Time Machine does its job correctly of managing the snapshots.


2. As far as I know, APFS snapshots are only exposed through the Time Machine local snapshots feature. That being said, you don't need to configure any backup disk or enable automatic backups to be able to create local snapshots (but they will be created for you as part of the automatic backups of Time Machine). I think local snapshots and regular backups will just be shown together when you browse the Time Machine history of your disk as is currently the case.


3. Just enable the "Back Up Automatically" checkbox from System Preferences > Time Machine. This will ask you to configure a backup disk. I don't think there is currently a way to have only local snapshots being created automatically, without also configuring a regular backup disk.

Replies

1. Snapshots are APFS snapshots, they're part of the filesystem. They may be mounted as read-only hidden volumes under /Volumes/com.apple.TimeMachine... as needed (for example when you browse the Time Machine history).


2. Yes, it seems local snapshots are purged based on space and age heuristics. It does not seem to be related to backing up to an external storage, and at this point, snapshots do not seem to be synced/pushed to persistent storage.


3. You can trigger a local snapshot using 'tmutil snapshot', unfortunately there is no command to disable local snapshots as part of regular backup operations, please file a bug report (enhancement request) asking for a way to do this.

1. So does it effectively mean that unlike files, the snapshots are invisible in the file system, but will occupy disk space (similar to file system metadata overhead), and this will make users wonder where their disk space is going? Is there an API which tells how much backup snapshots are there on disk?


2. Does it mean that the snapshots are like a separate temporary backup system independent from the Time Machine? Can those backups be seen when the user launches the Time Machine app? Is this local backups system regulated by the Time Machine Settings in the OS?


3. I've been using High Sierra for a while and I don't see any past records when I launch Time Machine app. How do I turn on the regular hourly backups?


Thanks!

1. Yes, this is similar to the current local snapshots implementation. I think it is represented in Disk Utility or About this Mac as "backup" or "purgeable" disk space. It's supposed to be automatically reclaimed as needed. And I think there was a trick where the Finder would display the free size of a disk as the actual free size + the purgeable size, so users wouldn't be confused as much.


But Snapshots (and clones) can be way more confusing, for example deleting files will not necessarily give you back disk space, if the files data is still referenced somewhere in clones or snapshots. So it's quite important to harvest snapshots periodically.


The 'tmutil listlocalsnapshots /' command will list all the snapshots but will not tell you how much size they occupy. By that, I mean the size that only they are referencing (.i.e. the size you would get back by deleting the snapshots). But that can be done, I just don't think Apple is showing that information anywhere for now. You're not supposed to have to worry about all this if Time Machine does its job correctly of managing the snapshots.


2. As far as I know, APFS snapshots are only exposed through the Time Machine local snapshots feature. That being said, you don't need to configure any backup disk or enable automatic backups to be able to create local snapshots (but they will be created for you as part of the automatic backups of Time Machine). I think local snapshots and regular backups will just be shown together when you browse the Time Machine history of your disk as is currently the case.


3. Just enable the "Back Up Automatically" checkbox from System Preferences > Time Machine. This will ask you to configure a backup disk. I don't think there is currently a way to have only local snapshots being created automatically, without also configuring a regular backup disk.

Is it possible to use snapshot to revert to a previous state - not recover lost file but delete added files and revert config file etc back to snaphot state?

We have been re-imaging when we want to start fresh but we can't seem tot do that with 10.13.

Last time I checked (in a previous beta), this was available when booted from the recovery partition inside the "restore from a Time Machine backup" option.

Unfortunately, this seems to be badly broken. Woke up this morning to all sorts of warnings of a full boot volume, while Finder showed almost 30GB of free disk space. df revealed that in reality there were just a couple hundred MB free, and also revealed that several local TM backups were mounted as volumes.


After a bit of digging in the man pages, I deleted manually all the snapshots with the tmutil. Unfortunately, that still didn't free the space!


Only after a reboot was the space actually freed. Unfortunately, it seems the same game starts all over. On a 1TB drive with only a bit over 30GB free, TM should not retain local backups. It should either stop completely, or it should at most retain the most recent one. The old


sudo tmutil disablelocal


command is sorely missed. 😟

sudo tmutil disable localsnapshot


This command passes, but I am not certain of its action ??

Isn't this treated as `sudo tmutil disable`?

Exactly, this command 'sudo tmutil disable localsnapshot' disable TM

Hi, I could only find the following commands being related to local snapshots:


Usage: tmutil localsnapshot

Usage: tmutil listlocalsnapshots <mount_point>

Usage: tmutil listlocalsnapshotdates [<mount_point>]

Usage: tmutil deletelocalsnapshots <snapshot_date>

Usage: tmutil thinlocalsnapshots <mount_point> [purgeamount] [urgency]


I have not tried them (haven't had enough time), but the las 2 seem to obviously be related with this topic. I don't know if they actually delete/purge the local snapshots and recover the taken space. If someone tries them, please comment on the outcomes. Regards.

$tmutil listlocalsnapshots /

com.apple.TimeMachine.2018-08-03-130116

com.apple.TimeMachine.2018-08-03-135423



$ tmutil thinlocalsnapshots /

Thinned local snapshots:

com.apple.TimeMachine.2018-08-03-130116



$ tmutil listlocalsnapshots /

com.apple.TimeMachine.2018-08-03-135423




----------------------------------------------------------

man tmutil 😉

localsnapshot

Create new local Time Machine snapshots of all APFS volumes

included in the Time Machine backup.


listlocalsnapshots mount_point

List local Time Machine snapshots of the specified volume.


listlocalsnapshotdates [mount_point]

List the creation dates of all local Time Machine snapshots.


Specify mount_point to list snapshot creation dates from a spe-

cific volume.


Listed dates are formatted YYYY-MM-DD-HHMMSS.


deletelocalsnapshots date

Delete all local Time Machine snapshots for the specified date

(formatted YYYY-MM-DD-HHMMSS).


thinlocalsnapshots mount_point [purge_amount] [urgency]

Thin local Time Machine snapshots for the specified volume.


When purge_amount and urgency are specified, tmutil will attempt

(with urgency level 1-4) to reclaim purge_amount in bytes by

thinning snapshots.


If urgency is not specified, the default urgency will be used.