• 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...

  • How to Use Mac OS X Sparse Bundle Disk Images
  • macOS Sierra Includes a New Apple File System, APFS
  • How To Turn On Bluetooth In Mac OS X Using Only The Keyboard
  • How To Remove Raw Images From Apple Photos and iCloud
  • Infinidat’s Solution For the I/O Blender: Math

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

Technology is the name we give to things that don’t work yet

Danny Hillis

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

Add a Mirror to an Existing ZFS Drive

December 11, 2017

How To Remove Raw Images From Apple Photos and iCloud

How To Remove Raw Images From Apple Photos and iCloud

July 24, 2017

Recalling An HP MediaSmart Server To Active Duty

Recalling An HP MediaSmart Server To Active Duty

July 21, 2017

Go Get a ProtonMail Account and Protect Your Online Life!

Go Get a ProtonMail Account and Protect Your Online Life!

July 19, 2017

ZFS Is the Best Filesystem (For Now…)

ZFS Is the Best Filesystem (For Now…)

July 10, 2017

Co-Processors, GPGPU, and Heterogeneous Computing

Co-Processors, GPGPU, and Heterogeneous Computing

June 26, 2017

What is OCuLink?

What is OCuLink?

June 22, 2017

Storage is Getting Cloudier!

Storage is Getting Cloudier!

June 21, 2017

Where Have All The GPU’s Gone? Cryptocurrency Mining!

Where Have All The GPU’s Gone? Cryptocurrency Mining!

June 11, 2017

Turn Off Error Recovery in RAID Drives: TLER, ERC, and CCTL

Turn Off Error Recovery in RAID Drives: TLER, ERC, and CCTL

May 30, 2017

Symbolic Links

  • Keeping Yourself on Track and Avoiding Burnout as a Programmer

  • IRL Analogies Explaining Digital Concepts are Terrible

  • Hass.io 2018

  • Describing Network Automation: Automate the Coffee

  • Cisco’s Latest AP is Mind-Blowing (and a quick history lesson)

Featured Posts

Microsoft’s Big Chance to Change

August 23, 2013

My Advice For New Business Travelers: Get The Credit Cards!

March 20, 2014

How To Keep Your Family Activities In Sync With A Shared Google Calendar

April 18, 2010

Making a Case For (and Against) Software-Defined Storage

January 9, 2014

A Watch Guy’s Review of the Apple Watch

April 27, 2015

Sony NEX-5 Camera Review

September 15, 2010

Replacing Google Reader With Feedbin and Reeder

May 5, 2013

What’s the Difference Between a Jailbroken and an Unlocked Phone?

May 5, 2012

The iPhone Revolution 10 Years Later

January 9, 2017

From Kipling’s Dirigibles to the Jet Age

May 13, 2012

Copyright © 2018 · Log in