ESN 53055-090831-447685-23


Document Name: Snow Leopard is not lying to you
Document Description: something has changed with regard to file sizes and the output of programs like"df". That's simply not the case.

Snow Leopard is not lying to you


2009/08/31

There's been some confusion about changes in Snow Leopard relating to how it reports disk sizes. Some bloggers have completely misunderstood this and think that something has changed with regard to file sizes and the output of programs like "df". That's simply not the case.

When I upgraded to Snow Leopard, my free disk space jumped impressively, going from 52% used to just 37% - a savings of 11,514,359,808 bytes. Most of that is probably due to dropping Universal Binaries - no point to those as Snow Leopard only works on Intel Macs (Rosetta, which lets you *run* Power PC binaries, is still an optional install). None of it has anything to do with Apple's "Base 10 change".

To prove that, let's look at a 1MB file. I happen to have one handy, and Finder will tell you that it is a 1MB file and if you look at it in Terminal, you'll see that, yes, it is really what we've always called a 1MB file: 1,048,576 bytes. Of course it was 1,048,576 bytes both before and after upgrading to Snow Leopard.

If a disk manufacturer created a 1MB disk drive, it wouldn't be that big. It would be 1,000,000 bytes. That's the change we're talking about here. But before we get to that, let's look at "df".

 $ df
 Filesystem    512-blocks      Used Available Capacity  Mounted on
 /dev/disk0s2   155629664  67930040  87187624    44%    /
 $ cp my-one-mb-file newfile
 $ df
 Filesystem    512-blocks      Used Available Capacity  Mounted on
 /dev/disk0s2   155629664  67932088  87185576    44%    /
 $ expr 87187624 - 87185576
 2048
 

And, of course, 2048 * 512 is exactly 1,048,576 bytes, proving (if you really needed proof!) that neither Leopard nor df is lying about anything.

Finder DOES use base-10 and this could get confusing for larger files. For example, take this .iso image:

 -rw-r--r--   1 apl  apl  280926208 Aug 20  2008 osr505.iso
 

Snow Leopard Finder says that's a 280MB file. That's the "base 10" change; under previous versions that would have been shown as 267 MB. But that changes nothing about how big the file actually is or how it affects "df".

The disk space gained in Snow Leopard is NOT from this.


Author: Anthony Lawrence - Contact Author
Publisher: Anthony Lawrence
Licensee Name: Anthony Lawrence
Reference URL: http://aplawrence.com/MacOSX/snow-leopard-not-lying.html
Copyright: All Rights Reserved
Registration Date: 8/31/2009 7:50:41 PM UTC
Views: 247




NUMLY.COM