30

In home directory, df -h $HOME shows

Filesystem Size Used Avail Use% Mounted on /dev/disk1 231G 177G 54G 77% / 

But in finder

enter image description here

Any ideas?

EDIT

Attached df -h output

/dev/disk1 231G 177G 54G 77% / # this is memory disk /dev/disk2 7.0G 677M 6.4G 10% /Users/HOME/Library/Caches # this is an encrypted dmg /dev/disk3s2 9.3G 7.0G 2.3G 76% /Volumes/NOT_HOME # this is a bindfs /Volumes/NOT_HOME/xxxx 9.3G 7.0G 2.3G 76% /Users/HOME/Library/some-folder 
4
  • As you can see the mountpoint for $HOME is actually root (/). Therefor the complete disk space is shown compared to the actual data which the finder shows you. Try du -sh $HOME instead to see content for your home directory. Besides that some applications tend to divide by 1000 instead of 1024. Commented Mar 3, 2017 at 8:41
  • Is it possible to see more details like the whole df -h? Commented Mar 3, 2017 at 9:06
  • @JuliePelletier Just added to it. Is it related to the bindfs and memory disk? Commented Mar 3, 2017 at 9:09
  • I doubt it. I just searched up this issue and it seems to normally be related to backups, as mentioned in the answer below. Commented Mar 3, 2017 at 19:45

4 Answers 4

32

I was having this same problem and apparently it was caused by my local time machine snapshots filling up the disk. OSX supposedly clears those snapshots out automatically whenever more space is needed (and so it reports it as available space in Finder), but df doesn't know that.

To solve the issue, you can use the command line utility, tmutil, to purge old snapshots.

To list existing local snapshots:

sudo tmutil listlocalsnapshots / 

To clear out 20 gigs (21474836480 bytes) worth of old local snapshots (with a purge priority of 4):

sudo tmutil thinlocalsnapshots / 21474836480 4 
5
  • 1
    shouldn't sudo be required also on the second command? Commented Oct 7, 2019 at 14:21
  • Why are there shapshots on the main drive? Should they not be on the timemachine drive, which is not even connected? Is there any way to see how big these snapshots are? What is the effect if we delete all of them? Commented Oct 18, 2019 at 17:12
  • @JohnLittle As far as I know, that's just where OSX puts the snapshots. OSX tries to "intelligently" manage the snapshots invisibly in the background and make it invisible to the end user that they are even there, but it doesn't always succeed (especially when dealing with low level system utilities that bypass their abstraction layers). The effect of deleting them all seems to be that you lose your local Time Machine changes that might not have been synced to your external backup yet. It also appears to make your Time Machine backup process take a lot longer. Commented Oct 28, 2019 at 23:04
  • You can also delete local snapshots by date, for example sudo tmutil deletelocalsnapshots 2020-04-12-160315. Commented Apr 14, 2020 at 15:57
  • 1
    Even though sudo listlocalsnapshots / yielded nothing, I still freed up tons of space using the thinlocalsnapshots command. So I guess they were hiding? Commented Jul 3, 2020 at 1:19
7

You are very likely using Time Machine backups. Finder shows local time machine backups as free space. This is exaplained in this KB article by apple http://support.apple.com/kb/HT4878.

Local Time Machine backups are shown as free space in finder because they are automatically removed, if free space becomes an issue.

2
  • Hmm, Time machine is not actually configured ... Commented Mar 3, 2017 at 7:59
  • 2
    They are supposed to be removed if space is an issue, but Apple still hasn't quite got the memo. A few days ago my system ran out of space (according to df and numerous alarming popups about no free space and closing app after app). Rebooted (a troublingly long process), still had problems, then found the Q&A here. According to system information there was nearly 100GB free, but df said nearly zero. Manually trimmed the snapshots and voila, it worked. Bottom line: watch your free space because you just never know here. Commented Jun 17, 2020 at 20:51
1

FWIW, in my case (macOS Sonoma 14.4.1) using gdf from Homebrew's core shows the correct sizes:

$ df -h Filesystem Size Used Avail Capacity iused ifree %iused Mounted on /dev/disk3s1s1 926Gi 9.5Gi 443Gi 3% 404k 4.3G 0% / 

vs

$ gdf -h Filesystem Size Used Avail Use% Mounted on /dev/disk3s1s1 927G 483G 444G 53% / 
-2

the df command will display the space remaining on the filesystem where is your mountpoint $HOME (/Users/$USER) so on a Mac Os X that will be /

So when you are typing :

df -h $HOME 

as $HOME is part of the / filesystem it's the same as you type :

df -h / 

If you want to compare what says the Finder vs. what say some command in Terminal use :

du -sh $HOME 
1
  • 1
    This isn't very relevant, the Finder is displaying total disk statistics, just like df is, but du iterates through all the files and adds everything up. That's different because 1) the Finder isn't just showing $HOME, and 2) du will get the totals wrong depending on how the -H and -L flags are specified. Commented May 30, 2020 at 19:45

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.