• Skip to main content
  • Skip to primary sidebar
  • Skip to footer
  • 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 Install ZeroTier on TrueNAS 12
  • Liberate Wi-Fi Smart Bulbs and Switches with Tasmota!
  • How To Connect Everything From Everywhere with ZeroTier
  • Electric Car Over the Internet: My Experience Buying From…
  • Scam Alert: Fake DMCA Takedown for Link Insertion

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 wish to make an apple pie from scratch, you must first invent the universe

Carl Sagan

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

How To Install ZeroTier on TrueNAS 12

February 3, 2022

Scam Alert: Fake DMCA Takedown for Link Insertion

January 24, 2022

How To Connect Everything From Everywhere with ZeroTier

January 14, 2022

Electric Car Over the Internet: My Experience Buying From Vroom

November 28, 2020

Powering Rabbits: The Mean Well LRS-350-12 Power Supply

October 18, 2020

Tortoise or Hare? Nvidia Jetson TK1

September 22, 2020

Running Rabbits: More About My Cloud NUCs

September 21, 2020

Introducing Rabbit: I Bought a Cloud!

September 10, 2020

Remove ROM To Use LSI SAS Cards in HPE Servers

August 23, 2020

Test Your Wi-Fi with iPerf for iOS

July 9, 2020

Symbolic Links

    Featured Posts

    The I/O Blender Part 1: Ye Olde Storage I/O Path

    May 23, 2012

    Rocking Out With the Topping VX1 Desktop/Bookshelf Amplifier

    October 6, 2015

    Why You Should Never Again Utter The Word, “CIFS”

    February 16, 2012

    vSphere 6: NFS 4.1 Finally Has a Use?

    February 3, 2015

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

    September 3, 2014

    Infographic: Real-World Port Throughput Relative To Thunderbolt (Formerly Light Peak)

    February 21, 2011

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

    July 6, 2011

    Marketers: Fudging the Meaning of Buzzwords Matters (To You!)

    December 2, 2015

    How Smart Is the Mondaine Helvetica Smart Watch?

    December 30, 2015

    Frequent Flier Kung Fu for Novices

    March 12, 2012

    Footer

    Legalese

    Copyright © 2022 · Log in