The story of my new 47 PB hard drive

At some point, my Time Machine started to complain that there is no enough space to make a complete backup of my disk



When I tried to figure out what was happening, it turned out that my $HOME was the place that occupied most of the space.

I have tried to use typical approach to locate huge directories (based on du) but it lead to no results at all. Everything looked quite normal when it comes to size of directories.

Eventually, I decided to descent to the location that takes most space (by looking at Finder's reports; Finder was still able to provide incorrect size for each subdirectory) – eventually, I have found out there was a directory created by IntelliJ, and it contained a really huge file.

Funny thing was that the size of the file was reported as 47PB, however, the directory size (containing the file) was reported as a way smaller (in fact, dozen orders of magnitude smaller ;) ).

> stat -f %z ./storage.storageData
43193008631644577
> du -s -h frameworkLessonHistory
 20K	frameworkLessonHistory

The very same thing happened in another IntelliJ's directory. This time, size of the file was way smaller, but still way bigger than my hardrive

> stat -f %z ./storage.storageData
4595851234443899
> du -s -h frameworkLessonHistory
 28K	frameworkLessonHistory

After removing all these files I have eventually got my space back, and Time Machine was (again) able to perform regular backups, as usual.

Removing IntelliJ's directories made me go from here

to there

Note that for Finder, to properly pick up new sizes, you have to go to /Users directory and enforce recalculation of directory sizes by pressing ⌘ + J and checking the check box Calculate all sizes.