16

So I am trying to silence the "Your Disk is Almost Full" notification from a mac running Mojave, as right now it pops up way too frequently and it is so annoying.

I followed all answers from this thread but none of them work with Mojave.

However, I made some progress as @kenorb's answer includes this command:

grep -A6 debugLog <(strings $(find /System/Library/PrivateFrameworks -name diskspaced -print -quit))

which does give some insight into how things have changed, as when I run a modified version of it, I get this:

MacBook-Pro-7:~ QH$ grep -A15 debugLog <(strings $(find /System/Library/PrivateFrameworks -name diskspaced -print -quit))

debugLog (BOOL) - log additional debug information. Default: NO
Commands:
removeAllNotifications - Removes all scheduled and delivered user notificiations.
removeAllNotifications
com.apple.diskspaced
_mbsetupuser
Ignoring low disk notification during migration.
event
low_disk
STORAGE_CRITICALLY_LOW
STORAGE_CRITICALLY_LOW_INFO
volumeURL
Low space alert: %@ free on '%@'
Unknown command
peer error: %s
unexpected peer event
--
debugLog
systemUpdateDate
com.apple.updatesettings
Interval since system update :%f
alloc
init
lowSpaceTimer
invalidate
setLowSpaceTimer:
_centerForIdentifier:type:
deliveredNotifications
countByEnumeratingWithState:objects:count:
removeDeliveredNotification:
scheduledNotifications
removeScheduledNotification:
count

Now I don't understand much about that command or macOS daemons at all, but it seems to me that the lowSpaceTimer or setLowSpaceTimer: might be the key to fixing things. If I can get access to one of them, and set the timer to be something high enough, I will finally get some closure on that annoying pop up. The thing is... I have no idea how to access it.

I've tried:

defaults read lowSpaceTimer

defaults read com.apple.diskspaced lowSpaceTimer

defaults read com.apple.diskspaced (this outputs the minFreeSpace k-v entry I wrote while trying to get it to work, but does nothing to help things as minFreeSpace is obsolete)

Right now the popup shows up once every 6 minutes and it's driving me insane when I try to get work done.

JoeVictor
  • 293
  • 3
  • 8
  • ...then move some data to another location. The warning is like the oil light in your car; if you ignore it, or put a piece of black electrical tape over it, who is to blame when the engine blows up? – Tetsujin Nov 14 '18 at 19:45
  • 2
    I have 15 GB free on my laptop. If the oil light in my car is faulty, and I can't fix it (set the threshold to lower as in the linked thread), I might as well turn it off. – JoeVictor Nov 14 '18 at 19:52
  • to carry the metaphor - 15GB is in danger of seizing the engine altogether. Your oil light isn't faulty, you just think that 150ml of oil from a capacity of 2.5 litres is enough... it isn't. – Tetsujin Nov 14 '18 at 20:01
  • 2
    Ok, so I have 128GB's of storage on my laptop. I always operate on 10-15 GB's of free space. I have a lot of applications/files that are critical to my daily functions that I can't remove. Is this a good setup? no. Can I fix it? not realistically, no. Have I been working with this setup for the past 4 years? Yes. I clear my browser's cache and file system regularly but the best I can practically have is 15GBs free. As much as I understand and appreciate your advice, I know what I'm doing. I just want that popup to stop showing up. – JoeVictor Nov 14 '18 at 20:10
  • So... your SSD is under-specced for the tasks you require of it. that is not the OS's fault. – Tetsujin Nov 14 '18 at 20:14
  • Yes, that is true. I cannot afford a new laptop. Never blamed the OS, I just want to tailor a specific aspect of it to my setup. I accept all possible engine explosions that may come with my actions. – JoeVictor Nov 14 '18 at 20:19
  • 2
    What if you try: defaults write com.apple.diskspaced removeAllNotifications? – kenorb Nov 14 '18 at 20:20
  • I get: Rep argument is not a dictionary

    Defaults have not been changed.

    – JoeVictor Nov 14 '18 at 20:21
  • 1
    This expects a boolean, so please try, defaults write com.apple.diskspaced removeAllNotifications true, this worked for me in Mojave (july 2019), then if you'll need to know which value is been set, then do defaults read com.apple.diskspaced removeAllNotifications – ximbal Jul 18 '19 at 11:04
  • @Tetsujin According to OmniDiskSweeper, 52GB is used, which includes /usr, /opt, /System, the home folder, and Library folders. I've meticulously deleted or moved to the cloud every irrelevant or unneeded file. However, every time I clear up more disk space, this hidden data which I believe is in "/private" grows. 5 weeks ago, the sum of all my user data was 100GB, and I did not have this warning. – noɥʇʎԀʎzɐɹƆ Jul 27 '19 at 22:04
  • 1
    15GB is not "in danger of seizing the engine altogether." 15GB is enough to synthesize English with an Indian accent (Veena) and (generate story prompts with the BookCorps GPT language model)[https://resources.wolframcloud.com/NeuralNetRepository/resources/GPT-Transformer-Trained-on-BookCorpus-Data], and still have 10GB left. Sure, Office 365, the Xcode suite, and a few projects' build artifacts might be 200GB total, but your computer is entirely usable with 15GB of free disk space. Just mount an external disk and build your projects there if you need it. – noɥʇʎԀʎzɐɹƆ Jul 27 '19 at 22:09
  • 1
    As an update to this post, I downloaded Clean My Mac, and it showed me just how many files and folders were left from old applications and their caches. About 20GBs alone were from an old docker installation's VM. I'm now consistently running with around 50 GB's of free disk space on my machine and haven't seen the message since! – JoeVictor Jul 27 '19 at 22:13

3 Answers3

5

It's most likely not the answer that you're looking for, but suddenly I discovered a simple and trivial thing - "do not disturb" mode silences that notification, along with all the others of course...

I know that it's not a proper solution, but I'll stick with it by now. How could I've been so blind :D

  • 1
    Yeah, I use do not disturb when I need to focus and it keeps popping up. The problem is that the other notifications are actually important and relevant. You can toggle Do Not Disturb by alt-clicking on the notification center symbol on the top right of the menu bar by the way – JoeVictor Dec 05 '18 at 15:52
  • Worked for my purposes. Got to notification center and click the slider. – akahunahi May 03 '19 at 18:33
2

Try the following command:

defaults write com.apple.diskspaced removeAllNotifications -bool true
kenorb
  • 12,695
0

defaults read com.apple.diskspaced yields:

{
     checkAllVolumes = 0;
     debugLog = 1;
     freeSpaceWarningLevel = 4;
     minFreeSpace = 4;
     removeAllNotifications = 0;
     warningInterval = 3600;
}

Now you can change it with, say, defaults write com.apple.diskspaced freeSpaceWarningLevel 1, and restart: killall diskspaced.

  • 1
    Mine yields this and I still get the damn notification: { lastWarningDate = "2018-10-11 20:54:07 +0000"; minFreeSpace = 2; removeAllNotifications = 1; } Note how the lastWarningDate is very old, but I got a notification one minute ago. – Martin Braun Jul 17 '19 at 13:49