Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Free disk space in Finder vs Terminal df command

i am in process of writing a shell script to backup our data.

before starting the backup process, i am checking how much space is left on the disk:


terminal> df -k /my_data_directory/

Filesystem 1024-blocks Used Available Capacity Mounted on

/dev/disk0s2 244781464 173055384 71470080 71% /



this states 71.47 GB free space on /


however, the Finder reports 96.17 GB free space on Macintosh HD (which is also mounted on /).


where does that difference come from? how can i "calculate" the real free disk space?


User uploaded file

MacBook Pro, Mac OS X (10.7.4), 13" 2.8 GHz i7 (late 2011)

Posted on May 30, 2012 5:05 AM

Reply
7 replies

May 30, 2012 5:50 AM in response to tuscan

See

OS X Lion: About Time Machine's "local snapshots" on portable Macs


which includes the following:

---------------------

Note: You may notice a difference in available space statistics between Disk Utility, Finder, and Get Info inspectors. This is expected and can be safely ignored. The Finder displays the available space on the disk without accounting for the local snapshots, because local snapshots will surrender their disk space if needed.

------------------------

May 30, 2012 5:53 AM in response to etresoft

do i get your answer right:


this means the Finder is reporting an amount of free space one can never use?

its number includes those bytes that are unused in used disk blocks?


e.g. say a block is 8k an my specific disk, and i'm saving a file with 1k of text.


the Finder would report 7k of these 8k as free space?

while df takes the whole 8k block as "used"?

May 30, 2012 6:53 AM in response to tuscan

tuscan wrote:


do i get your answer right:


this means the Finder is reporting an amount of free space one can never use?

its number includes those bytes that are unused in used disk blocks?


e.g. say a block is 8k an my specific disk, and i'm saving a file with 1k of text.


the Finder would report 7k of these 8k as free space?

while df takes the whole 8k block as "used"?

As jsd2 points out, it is more complicated than that. I don't have local snapshots running on my machine but I still have a significant discrepancy, although not as large as yours.


df is a fast tool and only looks at blocks. The Finder does more work and keeps track of file sizes and, apparently, the potential to delete them. But if you had a one-byte file, those other 4095 bytes wouldn't necessarily be wasted. You could write another 4095 bytes to that file without losing any disk space.

Free disk space in Finder vs Terminal df command

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.