Why the "system" storage is so huge in Mac?
[10/05, 2019] |
Hi, it's Tomo. My MacBook has 500G storage but my Mac notified me that it is "The storage you have left is not enough to run a program...". So I checked in my storage of my MacBook what are placed in. And there is a huge section of the "System". What is the system🤔??
So I decided to search for what the system is.
-- When you try the contents, please do it at your own risk! --
What is the system?
First, I thought the system is that things are managed/needed by Mac OS. But it's too huge for running the OS. I searched a bit, it seems to contain cache files created by some applications.
Find by Finder
I tried that open Finder app,
Menu bar > computer > Macintosh HD > system > right-click to show information
Then the information showed about storage is just 10G bytes. So I searched again more deeply, I found one of the possibility is that Mac OS misunderstood about disc space. So I tried 2 things just below.
- Boot with safe mode
- Reset the NVRAM
Boot with safe mode
Mac OS check your storage when it's booted with safe mode, so if you are lucky, the system section will be fixed to small.
To boot with safe mode, keep pressing the "Shift" key when booting your MacBook.
This is the link to Apple's page what/how safe mode is.
To log into your Mac, Input your password twice. And then check whether booted with safe mode.
You can check it at...
About this Mac > Overview > system report > software > boot mode
In my case, just boot with safe mode didn't work for shrink system section of storage😭
Reset NVRAM
So, I tried the next solution that is "Reset NVRAM or PRAM".
According to Apple's page, to Reset NVRAM or PRAM...
Shut down your Mac, then turn it on and immediately press and hold these four keys together: Option, Command, P, and R. You can release the keys after about 20 seconds, during which your Mac might appear to restart.
But it doesn't work too😭.
Using Disk Utility
I used Disk Utility to check a disk for problems with following Apple's page.
If you use the "spotlight", you can find "Disc Utility" easily. Then click the First Aid button, then click Run.
But... it doesn't work for my case too😭
By the way, this process is very heavy and needs a long time. I recommend you to do this during going lunch or when you have time enough to wait for it.
Find what cause is more deeply
I had tried some ways to fix it but not working for me, and I was thinking I should re-install Mac OS. But I found the new way that is listing folders contain huge files so I tried it.
Permit your Terminal to do it.
The way to show folders is using Terminal, so the Terminal needs permission to access your files. By default, Terminal has no permission.
To give permission...
System Preferences > Security & privacy > Full Disk Access > 「+」Button > Terminal
Even you do this setting, your Terminal can't access the "privacy" folder, but you don't need to touch this folder.
Calculate sizes
To calculate folder sizes, input this command to your Terminal.
sudo du -g -x -d 6 / | awk '$1 >= 5{print}'
This means, dig into 6 directory hierarchies and find folders/files that are over 5G bytes. So you can change these numbers to like 3 or 4 whatever. The terminal might ask you a login password. And this calculating process is also taking a long time depends on how many files you have.
After finishing this, You may see fat folders over 5G bytes. If you find the folder, check it what files inside, and then delete files if you don't need them anymore.
In my case, found 2 folders related to Adobe and Xcode.
Adobe Premiere made huge caches
Apps fo Adobe makes caches to apps that can smoothly. Especially, Premiere makes tons of caches. I make a movie for my youtube so there are many caches I didn't know.
How to delete premiere's caches is
Premiere > Preferences > Media cache > Media cache database > Clean Unused
In my case, I can't delete caches enough. So I also tried access to the cache folder directory and delete them.
Way to access thereby Finder is
Finder > Click "Go" Pressing with "Option" > Library > Application Support > Adobe > Common > Media Cache Files
Xcode
Xcode has many files more than Adobe, the size was 150G bytes!!
Clear cache
The simplest way to delete caches is this command in the terminal.
rm -rf ~/Library/Developer/Xcode/DerivedData
"Archives" had many huge files.
I figured out that the folder "/Users/(Your user name)/Library/Developer/Xcode/Archives" contains more than 60G bytes.
When you build your app to submit to Apple, Xcode saves binary files as "Archives". Update by update, archives are increased. You might think "My app is just less 30M bytes on AppStore.", but the size on AppStore and the archive you built is different. One of my app's size is just 18M bytes on AppStore but the archive was 400M bytes.
I wanted to delete all of my archives but I didn't know what happens if I do, so I just delete archives that are too old to keep having.
You can see those archives at Xcode. Then right-click to delete it one by one if you don't need it.
Xcode > Window > Organizer > Archives
So I got new disk space about 130G bytes!!
Eventually, I could shrink the "system" and got 130G bytes disc space. I didn't have the idea that Xcode has huge files like this.
Why Mac doesn't tell me about this truth😵.