• Skip to content
  • Skip to primary sidebar
  • Home
  • About
    • Stephen Foskett
      • My Publications
        • Urban Forms in Suburbia: The Rise of the Edge City
      • Storage Magazine Columns
      • Whitepapers
      • Multimedia
      • Speaking Engagements
    • Services
    • Disclosures
  • Categories
    • Apple
    • Ask a Pack Rat
    • Computer History
    • Deals
    • Enterprise storage
    • Events
    • Personal
    • Photography
    • Terabyte home
    • Virtual Storage
  • Guides
    • The iPhone Exchange ActiveSync Guide
      • The iPhone Exchange ActiveSync Troubleshooting Guide
    • The iPad Exchange ActiveSync Guide
      • iPad Exchange ActiveSync Troubleshooting Guide
    • Toolbox
      • Power Over Ethernet Calculator
      • EMC Symmetrix WWN Calculator
      • EMC Symmetrix TimeFinder DOS Batch File
    • Linux Logical Volume Manager Walkthrough
  • Calendar

Stephen Foskett, Pack Rat

Understanding the accumulation of data

You are here: Home / Everything / Apple / Check Your Mac’s Drive and Reclaim 5 GB of Wasted Space!

Check Your Mac’s Drive and Reclaim 5 GB of Wasted Space!

July 24, 2015 By Stephen 8 Comments

Since most MacBooks are SSD-only, one would think Apple would be careful about leaving junk around on the drive. But many people are finding 5 GB wasted for a years-old leftover Mac OS X install image! Here’s how to reclaim that space if you’re missing it…

Screen Shot 2015-07-11 at 6.43.33 PM

Lost+Found

In a brief DuckDuckGo search, I discovered that it’s fairly common for a Mac OS X upgrade to leave behind a large (4-6 GB), useless image file. Although you may not have this issue, it’s not unusual! Leave a comment and let me know if you find something like this.

Most UNIX file systems, including HFS+ in Mac OS X, have a special directory called “lost+found” for disassociated data found during file system checks. And Mac OS X upgrades apparently often leave a copy of the install image in just this state. Here’s how to find out if you have such a leftover image, verify that it’s not needed, and remove it:

  1. Open Terminal
  2. Type the following to see what’s in the lost+found directory:
    ls -lrSk /lost+found
  3. There could be all sorts of stuff in there, most of which is junk. But you’re looking for something big. That combination of flags on the ls command will sort by file size, from smallest to largest, so the install image should be at the end of the list.
  4. If you found a large file (more than 9 digits in the size field means gigabytes in size) from a while ago, it might be a leftover install image. Use the “file” command to find out what kind of file it looks like:
    file /lost+found/iNodeNNNNNNNN
  5. If it reports that the file is an “xar archive” there’s a very, very strong chance that it’s a leftover Mac OS X install image. You can be absolutely sure by mounting it in Disk Utility and seeing what it says. But if it’s an xar archive in lost+found you can probably safely delete it without checking:
    /bin/rm -f /lost+found/iNodeNNNNNNNN
  6. You just reclaimed 4-6 GB of precious SSD space!

There could be lots of other orphaned files in lost+found, and you could probably delete them. Or you could check and see if they’re that novel or precious family photo you thought you lost. It’s really up to you!

Screen Shot 2015-07-11 at 6.45.15 PM
Here’s what my Mac OS X Mountain Lion install image looked like!

A Bit of Background

Now that you’ve gone through that, here’s a bit of background on what this is all about.

First, let’s talk about “lost+found”. Modern file systems use a system of pointers to connect directory information to file contents. It’s a bit like a phone book: The directory links the file name and location information to the underlying data. There are three essential items: The logical name and location, the unique number, and the contents.

If you have an unlisted phone number, it still exists but can’t be found in the directory. The same is true of a file system: Remove the directory listing and the number and file contents can still exist, but they’re no longer usable.

A standard file system check (which Mac OS X will perform on its own sometimes on boot) will sometimes fine a “lost” inode and file with no directory information. So an entry in “lost+found” will be created in case someone comes looking for it.

There’s another interesting thing that can happen with files: They can have more than one directory link! See the number next to the permissions (“-rw-r–r– 1”) in my listing above? That’s how many directory listings link to this inode! Just as a phone can be listed multiple times in the phone book, so too can a file have multiple directory listings. This is how Time Machine works, and explains why sometimes when you “delete a file” (really remove the directory entry) you don’t get any space back. Only when an inode has no more directory entries is it truly deleted.

If you’re wondering what exactly an “xar archive” is, it’s an open source disk image format used by Mac OS X since 10.5. I talked a bit about disk images in my post about sparse bundles if you’re interested in learning more about that.

Stephen’s Stance

It’s kind of surprising that Apple would leave around such a huge lost inode after a Mac OS X upgrade. A MacBook Air with a 128 GB SSD would see 4% of the total storage space taken up by this useless blob! Delete it and get on with life!

You might also want to read these other posts...

  • macOS Sierra Includes a New Apple File System, APFS
  • How To Remove Raw Images From Apple Photos and iCloud
  • Migrating Data With ZFS Send and Receive
  • Download My Free E-Book, “Essential Enterprise…
  • ZFS Is the Best Filesystem (For Now…)

Filed Under: Apple Tagged With: Apple, disk image, Disk Utility, file system, HFS, inode, lost+found, Mac OS X, MacBook, xar archive

Primary Sidebar

If you can keep your head when all about you are losing theirs…
If you can wait and not be tired by waiting…
If you can think – and not make thoughts your aim…
If you can trust yourself when all men doubt you…
Yours is the Earth and everything that’s in it.

Rudyard Kipling

Subscribe via Email

Subscribe via email and you will receive my latest blog posts in your inbox. No ads or spam, just the same great content you find on my site!
 New posts (daily)
 Where's Stephen? (weekly)

Download My Book


Download my free e-book:
Essential Enterprise Storage Concepts!

Recent Posts

Ranting and Raving About the 2018 iPad Pro

November 11, 2018

The 2018 iPad Pro is a Beast!

November 9, 2018

Add a Mirror to an Existing ZFS Drive

December 11, 2017

How To Remove Raw Images From Apple Photos and iCloud

July 24, 2017

Recalling An HP MediaSmart Server To Active Duty

July 21, 2017

Go Get a ProtonMail Account and Protect Your Online Life!

July 19, 2017

ZFS Is the Best Filesystem (For Now…)

July 10, 2017

Co-Processors, GPGPU, and Heterogeneous Computing

June 26, 2017

What is OCuLink?

June 22, 2017

Storage is Getting Cloudier!

June 21, 2017

Symbolic Links

  • Contemplating APIs and the WLAN State of Things

  • 18 TB HDDs: Toshiba Collaborates with Showa Denko for MAMR HDDs

  • You Can’t Fix What You Don't Measure

  • The More You Know The More You Realize You Don’t Know

    Steve Smith

  • Is it possible to contain the security risks of Huawei equipment? The UK NCSC thinks so, but should you?

    Kurt Marko

Featured Posts

The Rack Endgame: A New Storage Architecture For the Data Center

September 3, 2014

Free as in Coffee – Thoughts on the State of OpenStack

May 2, 2016

SMB 3 is Going to be Huge, in both Scope and Impact

May 6, 2012

Download My Free E-Book, “Essential Enterprise Storage Concepts”!

April 4, 2017

Rocking Out With the Topping VX1 Desktop/Bookshelf Amplifier

October 6, 2015

The End of Unlimited Data – Part 1: The Buffet

June 2, 2010

Virtual Machine Mobility: Of What, and to Where and in What State?

January 16, 2012

How To Sync Your iPad With Your Exchange Server

April 3, 2010

Defining Failure: What Is MTTR, MTTF, and MTBF?

July 6, 2011

Donate Your Swag to School Kids In Need

July 28, 2010

Copyright © 2019 · Log in