19

I have an early '13 MBP running Mavericks. Today, I got a SSD external drive today, and moved my virtual machines and Lightroom catalog files over to it to free up disk space, since 256GB goes fast.

However, when I run df -h in the terminal, I get the following:

Filesystem                          Size   Used  Avail Capacity  iused    ifree %iused  Mounted on
/dev/disk0s2                       233Gi  118Gi  115Gi    51% 31026495 30042945   51%   /
devfs                              187Ki  187Ki    0Bi   100%      646        0  100%   /dev
map -hosts                           0Bi    0Bi    0Bi   100%        0        0  100%   /net
map auto_home                        0Bi    0Bi    0Bi   100%        0        0  100%   /home
localhost:/19YSQKN76Bmz377sW5fOwp  233Gi  233Gi    0Bi   100%        0        0  100%   /Volumes/MobileBackups
/dev/disk1s2                       119Gi   36Gi   83Gi    31%  9537194 21637536   31%   /Volumes/Jason SSD

According to that, I have 118GB used and 115GB free. However, when I get info from the drive on the desktop, I get

enter image description here

That is a pretty startling discrepancy, and it exists after a reboot. What is the correct value and what is the reason why?

27

Do you have Time Machine backups turned on? If so, the difference may be due to space used for "local snapshots" (essentially, backups to the local disk when your real backup disk is not available). Local snapshots are automatically deleted when the space is needed for something else (actually, it starts purging them when the volume reaches 80% full), so the Finder treats them as free space. du, on the other hand, sees them as used space (as do Disk Utility and System Information).

To find out if this is what's going on, take a look in System Information: From the Apple Menu, choose "About This Mac", then click "More Info", then select the Storage tab, and look for a light purple ("Backups") band on the usage chart. If it's around 47GB, this is the source of the difference.

If you want to disable this feature, you can use the Terminal command sudo tmutil disablelocal -- but I recommend leaving it enabled, as it does provide some useful protection against accidental deletion/file damage/etc when your real backup is not available.

EDIT: As @chillin pointed out, there's an additional source of confusion: df and the Finder are using different units to report the sizes. df is using Gibibytes (=1,073,741,824 bytes), while the Finder is using Gigabytes (=1,000,000,000 bytes). If the Finder had reported in GiB, it would've said Capacity: 232.96 GiB, Available: 166.41 GiB, Used: 66.55 GiB. So there was actually about 52 GiB used for the local snapshots.

  • ! That's a good point. Didn't even cross my mind as I've always disabled local snapshots. – njboot May 29 '14 at 22:56
  • This was the fix. Once I disabled the local backup, du returned the correct disk value. I'm not too concerned about needing local backups since I already have a work drive as my TM backup running all the time. – Jason May 29 '14 at 23:31
  • 2
    Actually, not. du and "Get Info" use Gigabytes, while df uses Gibibytes. See my answer. – chillin May 30 '14 at 0:17
  • @chillin: Actually, the discrepancies are a combination of GiB vs GB and space used by local snapshots. Compare the space used according to du (118GiB = 126GB) vs according to Finder (66.27GiB = 71.46GB)... so there's about 52GiB = 56GB of space used for local snapshots. – Gordon Davisson May 30 '14 at 2:26
  • @GordonDavisson Good answers require good questions. The question begins with the incorrect interpretation of the information given by df: "According to that, I have 118GB used and 115GB free." While your answer is incredibly perceptive (in that you predicted information not provided), it glosses over the fact that the asker misinterpreted what they were seeing in the first place. – chillin May 30 '14 at 2:30
4

df is using Gi = Gibibytes, and "Get Info" is using GB = Gigabytes.

  • 1
    That would not come close to accounting for a ~63GB difference. – samh May 30 '14 at 0:22
  • well, depends what you mean by 'close,' as it does account for 17ish GB of it – chillin May 30 '14 at 0:30
  • I think accounting for only 27% of the difference is "not coming close." Gordon Davisson was probably the most accurate here. – samh May 30 '14 at 16:42
0

Edit: See Gordon Davisson's answer before going taking these steps.

If that fails:

  • Boot in OS X Recovery. Select your startup volume from Disk Utility > Repair Disk. Observe if any FS errors are found/fixed, and reboot normally. Subsequently, see if the discrepancy is gone.
0

chillin's answer is absolutely correct.

Gi = 1024^3 bytes GB = 1000^3 bytes

If you do the math (converting from 250.14 GB to Gi), it would be

250.14 * (1000^3) / (1024^3) = 232.83

Exactly 233 Gi.

0

Trash. No one has mentioned trash, which is just another directory to "df" and "du" but is often, confusingly, mixed in with how Finder reports free space. Did you clear trash and re-check?

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .