Solution: Reclaim storage back from "System"

Weaselboy

Moderator
Staff member
Jan 23, 2005
30,458
10,263
California
You have some app that is crashing and dumping the troubleshooting data in that folder. Other than just trial and error testing by watching the folder when you launch apps, I don't know a good way to tell what app is doing this.
 

findcoop

macrumors newbie
Dec 23, 2017
2
0
After upgrading to High Sierra the "System" storage was 260GB (About This Mac -> Storage). I also used DaisyDisk to confirm that there were "200GB of hidden system files" that can't be shown or deleted.

Turned to our good friend Google and I found that Time Machine local backups were the reason and 'sudo tmutil disablelocal' command was supposed to help, if only "disablelocal" verb had not been removed from High Sierra. So back to square one.

Did some digging a.k.a. opened the manual for tmutil. I found that there were two useful verbs "listlocalsnapshots" and "deletelocalsnapshots". Used the first one to get the exact date stamps required for the second one and deleted all local snapshots manually.

Result: "System" went from 260GB to 60GB.

Step by step I went as following:
Code:
sudo tmutil listlocalsnapshots /
This resulted:
Code:
com.apple.TimeMachine.2017-09-27-005259
com.apple.TimeMachine.2017-09-27-104645
com.apple.TimeMachine.2017-09-27-114218
com.apple.TimeMachine.2017-09-27-124220
I took these four date stamps and followed the next command with each as following:
Code:
tmutil deletelocalsnapshots 2017-09-27-005259
So in the end if i double checked with
Code:
sudo tmutil listlocalsnapshots /
there were no snapshots and after checking "About This Mac -> Storage" I was happy :)

Hope this helps!
It does help! If you care to script this to run automatically at login:

Create a new file, such as 'delete-local-tm.sh' and make it executable with 'chmod +x'

Inside of the file, paste this:

#!/bin/bash
tmutil deletelocalsnapshots $(tmutil listlocalsnapshots / | sed 's/com.apple.TimeMachine.//g')

Save the file, I used nano editor so Ctrl-X

Then in Preferences / Users, under your account, click Login items and add the script above.
 

mikeboss

macrumors 65816
Aug 13, 2009
1,295
478
switzerland
I am not affiliated with the author of this software in any way.

I today bought Marcel Bresink's "TinkerTool System" and amongst a lot of other things, it can create, list and delete local snapshots without the need to wrestle with the command line. exactly what I was looking for.

tts.jpg
 

Neilzone

macrumors newbie
Dec 29, 2017
1
3
Registered just to say thanks to @lainvoo and @Weaselboy

Spent the last hour+ trying to work out what on earth was taking all my hard drive space. The combination of listing the backups and the thinLocalSnapshots command did the trick, and reduced the system storage from 130Gb to around 50Gb!

I was trying to install Bootcamp and the free space reported in Boot Camp Assistant didn't match the free space shown in disk utility or in Finder. Clearly Apple hasn't got the partitioning part of the setup in Boot Camp Assistant to take account of the system storage. Crazy!

Anyway, thanks again, hopefully this will help other people struggling to find free space for Windows and Boot Camp!
 

gaedfly

macrumors 6502
Sep 12, 2014
291
235
After upgrading to High Sierra the "System" storage was 260GB (About This Mac -> Storage). I also used DaisyDisk to confirm that there were "200GB of hidden system files" that can't be shown or deleted.

Turned to our good friend Google and I found that Time Machine local backups were the reason and 'sudo tmutil disablelocal' command was supposed to help, if only "disablelocal" verb had not been removed from High Sierra. So back to square one.

Did some digging a.k.a. opened the manual for tmutil. I found that there were two useful verbs "listlocalsnapshots" and "deletelocalsnapshots". Used the first one to get the exact date stamps required for the second one and deleted all local snapshots manually.

Result: "System" went from 260GB to 60GB.

Step by step I went as following:
Code:
sudo tmutil listlocalsnapshots /
This resulted:
Code:
com.apple.TimeMachine.2017-09-27-005259
com.apple.TimeMachine.2017-09-27-104645
com.apple.TimeMachine.2017-09-27-114218
com.apple.TimeMachine.2017-09-27-124220
I took these four date stamps and followed the next command with each as following:
Code:
tmutil deletelocalsnapshots 2017-09-27-005259
So in the end if i double checked with
Code:
sudo tmutil listlocalsnapshots /
there were no snapshots and after checking "About This Mac -> Storage" I was happy :)

Hope this helps!
omg, thank you! In the past 2 days my 1tb drive went from oodles of available space to almost maxed out. I tried everything, including spending almost an hour with Apple senior support, all to no avail. After deleting the local snapshots I'm back to having 3/4 of the drive available again. What a huge relief. I think in my case the problem was that I tried to use my time capsule only as a network backup drive in bridge mode. The failed backups were probably the culprit. Time machine is great when it works but it's a monster when it doesn't. Considering options.
 

gaedfly

macrumors 6502
Sep 12, 2014
291
235
It does help! If you care to script this to run automatically at login:

Create a new file, such as 'delete-local-tm.sh' and make it executable with 'chmod +x'

Inside of the file, paste this:

#!/bin/bash
tmutil deletelocalsnapshots $(tmutil listlocalsnapshots / | sed 's/com.apple.TimeMachine.//g')

Save the file, I used nano editor so Ctrl-X

Then in Preferences / Users, under your account, click Login items and add the script above.
I tried this but neither running the script nor rebooting and letting it run as a login item removes the local snapshots. What am I doing wrong? To make the file executable i entered

chmod +x script.sh

Then I tried including the path so chmod +x pathname/sript.sh

None of that seems to work. The shell file is in my home folder.
 

jmaybe

macrumors newbie
Jan 25, 2018
1
0
Same problem here, but Time Machine not the issue (did not have it turned on).

In order to find the culprit I used ncdu as root from top directory. (Can't remember if you have to install ncdu from homebrew or not, but it is a great program; I use it all the time on my linux servers)

ncdu allows you to go through the directories to see what is using the most space (after it analyzes all of your drives).

I had set up the Wiki service under Mac's Server application a few years ago. I haven't used it for a long time as I've replaced it with open-source opens. However, the following directory was HUGE (350+gb):

/Library/Server/Wiki/Database.xpg

My backup file/directory had grown to enormous size.

cd moving to Wiki directory I just deleted it with the following:

rm -r /Database.xpg

Rebooted the system and now have 350+gb more free space.

If you have never used the Wiki service under Server then this probably won't help, but there may be someone out there that this will do the trick for.
 

fisherking

macrumors 604
Jul 16, 2010
7,238
2,149
ny somewhere
first thing i do with a new mac: reboot with SIP disabled. then i delete the desktop pics, run monolingual to remove language files i don't need (not as big a deal as it used to be); remove garageband & it's support files (including apple loops); i delete the voices (never use them). fwiw, i don't use time machine (i prefer CCC). then i reboot and re-enable SIP. maybe not for everyone, but great to clear out some weight...
 

Relixae

macrumors newbie
Jan 25, 2018
1
1
Thank you so much! I was wondering why after deleting over 50GB I actually lost space. Reclaimed 216GB from this method!
 
  • Like
Reactions: Weaselboy

J. J.

macrumors regular
Oct 15, 2012
120
8
Unfortunately, this didn't work for me. There are no local snapshots left on my SSD, but I am still missing about 100 GB of free space. Of course I tried rebooting and I made sure that there are no files taking up that space. I also tried running an "S.O.S. Check" of my SSD using Disk Utility and it looks like something is wrong with it. This may be the cause of the missing space, and it looks like I'm not the only one with this problem.

I'm thinking about trying these solutions:
  1. Reinstalling macOS without formatting or erasing data. I don't really think this will change anything if it's a filesystem-related issue, but it is worth a try in my opinion;
  2. Cloning the SSD, formatting, restoring the clone.
 

thejadedmonkey

macrumors G3
May 28, 2005
8,181
1,178
Pennsylvania
Thank you so much. I just spent an hour moving over 70gb off of my wife's MacBook, only to have Finder show 30gb free. This was the most frustrating thing ever, Apple should be ashamed of themselves for putting out an OS that even has the capability to do BS like this.
 

Fishrrman

macrumors Core
Feb 20, 2009
19,679
6,856
JJ wrote:
"I'm thinking about trying these solutions:
Reinstalling macOS without formatting or erasing data. I don't really think this will change anything if it's a filesystem-related issue, but it is worth a try in my opinion;
Cloning the SSD, formatting, restoring the clone."


THIS is "your answer".
 
  • Like
Reactions: k_gr

chasmo88

macrumors newbie
Feb 15, 2018
1
0
This thread was eventually very helpful.

Initially, "sudo tmutil deletelocalsnapshots <snapshot_date>" would run but did not do anything.

It turned out that timemachine had left local snapshot volumes mounted; "% df -H" showed several filesystems mounted as:
/Volumes/com.apple.TimeMachine.localsnapshots/Backups.backupdb/MacBookAir/<date1>/Macintosh HD
/Volumes/com.apple.TimeMachine.localsnapshots/Backups.backupdb/MacBookAir/<date2>/Macintosh HD
/Volumes/com.apple.TimeMachine.localsnapshots/Backups.backupdb/MacBookAir/<date3>/Macintosh HD

After unmounting these volumes; for example:
"sudo \
umount \
/Volumes/com.apple.TimeMachine.localsnapshots/Backups.backupdb/MacBookAir/<date1>/Macintosh HD"

"tmutil deletelocalsnapshots <date1>" worked as described in thread.

----
In this case, root cause was user error. I just switched to time machine on Mac which had been in use for several years and neglected to exclude folder containing VM disk image files.

-Chasmo
 

Superhai

macrumors 6502
Apr 21, 2010
473
366
I found that macOS creates local snapshot every time it does a system upgrade, no matter time machine enabled or not. The release function in the os, is too slow however, so while time machine reports cleaning up, I get out of space errors.

I work with a lot of large files, which was the reason I had to turn off time machine in the first place. Because the system will not report the free space without the snapshots, you have to guess how much space you have to work with. And large files quickly add up the time machine local snapshots.

So now before I do an OS upgrade I have to purge my users folder, so only small files which are rarely changed remains. The upgrade is now quick and I don't need to wait for time machine to "clean up" my drive of the snap shot.
 

donnietodd

macrumors newbie
Apr 22, 2018
2
0
Hi There, I came across your conversations on here after having 192gb of system files on my mac running High Sierra. iv tried running time machine snapshot codes but having nothing come up im guessing the issue isnt time machine backups. i ran the code that you gave to someone else on this thread and heres what i got

Code:
Last login: Sun Apr 22 07:47:36 on ttys000

Donnies-MBP:~ Donnie$ sudo du -d 1 -x -c -g /

Password:

0    /.HFS+ Private Directory Data

1    /home

1    /usr

1    /.Spotlight-V100

1    /net

0    /.PKInstallSandboxManager

0    /.PKInstallSandboxManager-SystemSoftware

1    /bin

0    /DamagedFiles

0    /Network

1    /sbin

32    /Library

0    /.Trashes

8    /System

1    /.fseventsd

du: /private/var/db/ConfigurationProfiles/Store: Operation not permitted

du: /private/var/folders/dr/k8th41qn6r18519qx98c2mc80000gn/0/SafariFamily: Operation not permitted

du: /private/var/folders/dr/k8th41qn6r18519qx98c2mc80000gn/0/com.apple.LaunchServices.dv: Operation not permitted

du: /private/var/folders/dr/k8th41qn6r18519qx98c2mc80000gn/0/com.apple.nsurlsessiond: Operation not permitted

du: /private/var/folders/dr/k8th41qn6r18519qx98c2mc80000gn/0/com.apple.routined: Operation not permitted

du: /private/var/folders/zz/zyxvpxvq6csfxvn_n00000y800007k/0/com.apple.nsurlsessiond: Operation not permitted

6    /private

1    /.DocumentRevisions-V100

0    /.vol

218    /Users

28    /Applications

1    /dev

1    /Volumes

0    /cores

291    /

291    total
Code:
Donnies-MBP:~ Donnie$ sudo du -d 1 -x -c -g ~/

1    /Users/Donnie//.config

61    /Users/Donnie//Music

1    /Users/Donnie//Conduit

1    /Users/Donnie//.adobe

1    /Users/Donnie//.local

7    /Users/Donnie//Pictures

54    /Users/Donnie//Desktop

15    /Users/Donnie//Library

1    /Users/Donnie//.oracle_jre_usage

1    /Users/Donnie//LuxVisDropbox

1    /Users/Donnie//.android

1    /Users/Donnie//.cups

1    /Users/Donnie//.bash_sessions

1    /Users/Donnie//Public

1    /Users/Donnie//.dropbox

1    /Users/Donnie//Wine Files

1    /Users/Donnie//.cisco

2    /Users/Donnie//Movies

1    /Users/Donnie//Applications

0    /Users/Donnie//.xbmc

1    /Users/Donnie//Dropbox

0    /Users/Donnie//.Trash

1    /Users/Donnie//Splice

4    /Users/Donnie//Documents

12    /Users/Donnie//Downloads

0    /Users/Donnie//.cache

152    /Users/Donnie/

152    total

Donnies-MBP:~ Donnie$
No idea where to go from here? any help would be much appreciated.

Thanks in advance :D
 
Last edited by a moderator:

Weaselboy

Moderator
Staff member
Jan 23, 2005
30,458
10,263
California
Hi There, I came across your conversations on here after having 192gb of system files on my mac running High Sierra. iv tried running time machine snapshot codes but having nothing come up im guessing the issue isnt time machine backups. i ran the code that you gave to someone else on this thread and heres what i got
The only thing I see there that looks odd is you have 54GB of files on your Desktop. Does that sound correct?
 

donnietodd

macrumors newbie
Apr 22, 2018
2
0
I do have quite a lot of stuff on my desktop but I bought 200gb on iCloud Drive and thought it had transferred everything to that as it freed up more memory when I got iCloud Drive, as it freed it up the system files section actually got bigger, started off around 120gb of system files. No idea what’s going on. :-/
 

Weaselboy

Moderator
Staff member
Jan 23, 2005
30,458
10,263
California
I do have quite a lot of stuff on my desktop but I bought 200gb on iCloud Drive and thought it had transferred everything to that as it freed up more memory when I got iCloud Drive, as it freed it up the system files section actually got bigger, started off around 120gb of system files. No idea what’s going on. :-/
So it sounds like the total space used is about correct then? So the only issue is it showing System wrong?

If that is the case, run the command below in Terminal to reindex Spotlight and give it some time to complete. That space used readout gets data from the Spotlight index and if that index is corrupt, the readout will be wrong.

Code:
sudo mdutil -E /
 
  • Like
Reactions: BigMcGuire

sscwpr

macrumors newbie
Apr 27, 2018
1
0
So it sounds like the total space used is about correct then? So the only issue is it showing System wrong?

If that is the case, run the command below in Terminal to reindex Spotlight and give it some time to complete. That space used readout gets data from the Spotlight index and if that index is corrupt, the readout will be wrong.

Code:
sudo mdutil -E /
Much of the discussion here was helpful to me in recovering about 200+GB of space in two Mac systems. In my case it was old files left over from a cloud storage service I had stopped using over a year ago. The recommendation of using DaisyDisk really helped in my case as I had tried all the Apple recommendations and also removed anything related to TimeMachine. I also found some really large Draft.mbox files in Gmail accounts that apparently had been growing over the years. Point being is that you need to be a bit creative sometimes in looking at this issue.

DaisyDisk also isolated something called MobileDocuments in ~/Library which apparently is where mirror from iCloud Drive is stored. DaisyDisk said you could delete it which I tried, but it comes right back. At least it gives you some idea of just what the OS is deciding to store locally vs. migrating to iCloud. Which begs the question of whether there is some sort of terminal command that can "adjust" the percentage of what is stored locally when using iCloud Drive versus what is migrated? Probably not that simple.
 

Weaselboy

Moderator
Staff member
Jan 23, 2005
30,458
10,263
California
Which begs the question of whether there is some sort of terminal command that can "adjust" the percentage of what is stored locally when using iCloud Drive versus what is migrated?
If you go to the iCloud Drive settings, there is a checkbox for Optimize Mac Storage that will move files off the Mac and into iCloud Drive only if the drive is starting to get full. That is the only control over iCloud Drive I know of.

Screen Shot 2018-04-27 at 6.21.19 AM.png
 

shafez

macrumors regular
Jul 3, 2011
104
24
Egypt
I am not affiliated with the author of this software in any way.

I today bought Marcel Bresink's "TinkerTool System" and amongst a lot of other things, it can create, list and delete local snapshots without the need to wrestle with the command line. exactly what I was looking for.

View attachment 744102
Please explain how you do this in tinker tools as I could not find this option.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.