macOS not showing the actual free space
I'm in the process of installing Windows 10 on my Macbook Pro (macOS 10.13.4/17E202, 256 GB of storage, no partition), but Boot Camp says I need at least 40 GB of storage.
So I freed up some space by removing some files, and "About My Mac" now shows almost 100 GB of free space on my Mac:
However, the Disk Utility shows only 33 GB of free storage... 3 times less:
The trash is empty, and I restarted my computer twice. I also used Onyx utility to free up some more space, empty caches, etc. But there is still this huge difference.
I tried to find "hidden files", that could cause this difference, using the Disk Inventory X app, but it shows 100 GB of free storage...
Another strange thing that happened: after I restart the computer, the status bar at the end of the finder shows 33 GB of free storage. But after 2-3 minutes, this number changes to about 100 GB... As if some cached values were used while the Mac is updating the folder sizes.
I'm pretty sure I have 100 GB of free storage, because I removed dozens of GB of photos and apps.
What's wrong? I'm kind of lost!
You probably have some local snapshots on your drive, you can try to list the local snapshots with
tmutil listlocalsnapshots /
and with
tmutil thinlocalsnapshots / 9999999999 1
you can delete all local snapshots and release the storage space.
You can find more information here How to thin your local Time Machine Snapshots on macOS High Sierra
Commands given below resolved the issue for me. Listed and deleted local snapshot and it freed 230 GB on my machine.
$ tmutil listlocalsnapshots /
com.apple.TimeMachine.2019-01-28-143406
$ tmutil deletelocalsnapshots 2019-01-28-143406
$ tmutil listlocalsnapshots /
$
Make sure it shows no file at the end.
The amount of free space that can be allocated to run Windows can be determined by entering the following command in a Terminal application window. Here, I have assumed you are using a single internal drive with just macOS installed.
diskutil apfs resizecontainer disk0s2 limits
Note: This command does not change the computer in any way.
Normally, you can subtract the minimum about from the maximum to get the free space that can be allocated for Windows. Also, there is an alternate "Recommend" minimum amount when macOS is installed.
Below is an example of the output from the above command.
Resize limits for APFS Physical Store partition disk0s2:
Current Physical Store partition size on map: 250.8 GB (250790264832 Bytes)
Minimum (constrained by files/snapshots): 175.6 GB (175553185382 Bytes)
Recommended minimum (if used with macOS): 186.5 GB (186453185382 Bytes)
Maximum (constrained by partition map space): 250.8 GB (250790264832 Bytes)
In this example, the maximum space that can be allocated to Windows is 250.8 GB - 175.6 GB = 75.2 GB
. Although, since you have macOS installed, the recommended maximum space that can be allocated to Windows is 250.8 GB - 186.5 GB = 64.3 GB
.
Note: For 2015 an newer Macs, the maximum amounts may be reduced by the amount of storage required to hold the Windows installation files. In other words, the newest Macs no longer require a USB flash drive or DVD to install Windows. During the installation of Windows, files from both Microsoft and Apple are temporarily stored on the internal drive. This can reduce the maximum amount of storage that can be allocated to Windows. The amount of storage for these temporary files should be less than 16 GB.