Disable local snapshots in High Sierra with APFS
I want to disable this. I do not want any local snapshots in my ssd. Is this possible or will I have to disable time machine completely?
Regards,
I want to disable this. I do not want any local snapshots in my ssd. Is this possible or will I have to disable time machine completely?
Regards,
There is a terminal command to turn off local snapshots: sudo tmutil disablelocal
It's from this Apple Developer's page: https://forums.developer.apple.com/thread/81171
If you don't have a Developer's account here's what it says:
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.
Correct Answer by tclementdev on Jun 30, 2017 9:08 AM
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.
There is a terminal command to turn off local snapshots: sudo tmutil disablelocal
It's from this Apple Developer's page: https://forums.developer.apple.com/thread/81171
If you don't have a Developer's account here's what it says:
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.
Correct Answer by tclementdev on Jun 30, 2017 9:08 AM
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.
And to directly answer your question, in High Sierra you can no longer ONLY disable local snapshots. You can, however, turn of automatic backups. Then whenever you want to do a backup on your external Time Machine drive, make sure it's connected then click the Time Machine icon and select Backup Now. Simple.
I want to disable this. I do not want any local snapshots in my ssd.
Turn off Time Machine's automatic backups. That's the only way to do it.
Local snapshots affects to the overall SSD lifespan.
There is no evidence of that, and Time Machine's local snapshots have little influence on the millions of write / erase cycles that occur just in a normal course of using a Mac.
Apple has many years of using solid state memory, in hundreds of millions of devices. There have yet to be any widespread reports of life-limited failures.
Do as you please though.
I decided to sort of do away with local snapshots. I have a cron job that runs every night at 1AM and deletes them all.
0 1 * * * /usr/bin/sudo /usr/bin/tmutil thinLocalSnapshots / 10000000000 4
(I have my sudo running with NOPASSWD for my ID)
This topic from the Apple Developer's forum might shed some light on this: APFS snapshots: where are they located? | Apple Developer Forums. See the reply by tclementdev.
That's true in theory, but in High Sierra, all of a sudden I'm getting this: "Time Machine could not create a local snapshot to back up from because there was insufficient free space on the source volume(s)."
This seems to be a common problem under High Sierra and there is no way to turn off the local snapshots, which is the problem.
I'm trying to manually delete local snapshots with tmutil, and even though it says it deleted, the snapshot still is listed when I list the local snapshots. There appears to be a bug in the local snapshot management where High Sierra isn't deleting them un APFS.
I feel the same way about these snapshots "sudo tmutil thinLocalSnapshots / 10000000000 4" Go to terminal and copy and paste and login this will thin out a lot of these snapsots . I found that unchecking automatic updates and removing your disks slowed it down but didn't stop it ! If this continues and they don't fix this I am fuming about not being able to disable this . I want to keep my backups on an external drive where I have access to the fifes so I can delete them if I want , not in a hidden file I don't have permission to edit or even access it .I will get carbon copy cloner and disable time machine for good and wish I could delete it! "sudo tmutil disablelocal" was my go to command in terminal till they removed it.
Thank you so much. This has worked for me: "sudo tmutil thinLocalSnapshots / 10000000000 4". Please see full thread: Re: Disable local snapshots in High Sierra with APFS.
Your command "thinned" a local snapshots that I was not aware the system had created. As a result, I have freed up nearly 40GB in SSD hard drive.
DaisyDisk still shows 8GB hidden space...so a bit more digging...
-T
Only Real way is to Type
tmutil listlocalsnapshotdates / |grep 20|while read f; do tmutil deletelocalsnapshots $f; done
The snapshots are deleted as space is needed. There is no real advantage to disabling them or turning off Time Machine. See the last section of this article.
kaczurzsolt wrote:
That’s not (always) true.
TM local snapshots often occupies large SSD space, and you can’t do anything.
Try the following: if you have a 100 GB folder and you want to copy to your Mac which only has 90 GB free space (AND the local snapshot occupies cca 30 GB!) you can’t do that.
Simply try it if you don’t believe me!
If you run a Daisydisk, you can see the so called system files.
Try run these terminal command:
sudo tmutil listlocalsnapshots /
Here is the detailed steps to reclaim you SSD space - unfortunately this is only a temporal solution 😟
Solution: Reclaim storage back from "System" | MacRumors Forums
Best wishes,
Zsolt from Hungary
There was a bug among my snapshots
this is the only thing that fixed it
An APFS snapshot is done with copy-on-write and tracking of allocated blocks. That means that very little is written to create one, just enough to account for multiple references to metadata and storage. Because there is very little writing involved, there should be very little wear (esp. compared to local snapshots before High Sierra!). And they should be very quick, almost instant.
A snapshot is not free, though; as the current filesystem diverges from the snapshot, it uses more space. In the extreme, it could use as much space as if it were a regular copy (i.e. once every block was different between the snapshot and the base filesystem).
The snapshots do mean that less free space is available than otherwise would be; but the Time Machine snapshots are supposed to be automatically deleted. If you sometimes run very full, that could be a problem; otherwise, they're useful and much cheaper in time, CPU, battery, wear, etc. than Time Machine snapshots prior to APFS and High Sierra.
I use Growl and HardwareGrowler; Growl can be given an AppleScript to do automatic actions based on certain notifications, and HardwareGrowler generates notifications of disk mount or eject, power changing from AC to battery, etc. My script would disable Time Machine and eject the backup disk when AC power was removed. It also disabled local snapshots, regardless, since I didn't want them. (It also enabled Time Machine when the external backup disk was again mounted.) Given that "tmutil disablelocal" no longer works, I should remove that from my script. Other than that, I don't guess I'll care too much.
Supposedly, OS updates (the minor ones that only need one reboot) may also create snapshots...not a bad idea IMO, since apparently one can always boot the Recovery partition and restore from one of those if needed. I wouldn't want to turn _that_ off, even if I could stop the regular Time Machine snapshots from happening.
That’s not (always) true.
TM local snapshots often occupies large SSD space, and you can’t do anything.
Try the following: if you have a 100 GB folder and you want to copy to your Mac which only has 90 GB free space (AND the local snapshot occupies cca 30 GB!) you can’t do that.
Simply try it if you don’t believe me!
If you run a Daisydisk, you can see the so called system files.
Try run these terminal command:
sudo tmutil listlocalsnapshots /
Here is the detailed steps to reclaim you SSD space - unfortunately this is only a temporal solution 😟
Solution: Reclaim storage back from "System" | MacRumors Forums
Best wishes,
Zsolt from Hungary
There is a small problem. A lot of apps don't recognize the "purgable" files and therefore thinks that there is no avaible space on the drive for some operations. For people who might need some more drivespace to install stuff, snapshots might get in the way. For example, bootcamp instalations don't recgnize that here is purgable space, and can't make big partitions because of that, even if you free space. You have to wait hours, maybe days to have that space back actually instead of a single backup before the operation. It's a hassle sometimes.
fe_quirino wrote:
There is a small problem. A lot of apps don't recognize the "purgable" files and therefore thinks that there is no avaible space on the drive for some operations. For people who might need some more drivespace to install stuff, snapshots might get in the way. For example, bootcamp instalations don't recgnize that here is purgable space, and can't make big partitions because of that, even if you free space. You have to wait hours, maybe days to have that space back actually instead of a single backup before the operation. It's a hassle sometimes.
Apps dont make that decision. Apps make the request for unallocated space to the kernel. If the kernel doesn't unallocate that space, then you have an entirely different problem. Bypassing the kernel's i/o & disk management is absurd.
Disable local snapshots in High Sierra with APFS