• 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
  • Using NFS to Share Data Between UNIX and Mac OS X
  • macOS Sierra Includes a New Apple File System, APFS
  • How To Turn On Bluetooth In Mac OS X Using Only The Keyboard
  • 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

  • Geoff Arnold

    I checked my three Macs. One (running 10.10.5) had an empty /lost+found. The other two, running 10.10.4 and 10.11 Beta, didn’t even have a /lost+found. It may just be you…

  • Scott

    Check out disk inventory X (it kindof outdated but works perfectly well for visualizing and cleaning OSX disk)

    http://www.derlien.com/downloads/index.html

  • Kim Slawson

    I had this under 10.10 and it mounted as OS X Install ESD. Didn’t look too closely to see whether it was Mavericks, or Yosemite, but I’m deleting it!

  • Jared Morgan

    I don’t have a /lost+found directory at /Users/username on El Capitan

  • Scott Riggins

    If the ‘file’ command reports the iNodeXXXXXX file is a xar archive, then you can avoid having to mount it in Disk Utility to examine the contents. Simply run the following command to examine the content list without unarchiving it…

    xar -t -f /lost+found/iNodeXXXXXX

    If near the top of the content list you see “InstallMacOSX.pkg” several times, followed by a bunch of lines starting with “Resources”, then this is almost certainly the Mac OS X installer or updater. Mine was 4.3GB.

  • c4bl3fl4m3

    What if it’s NOT an archive file? I have 3 of them, between 5 & 6 gigs each, and they’re all showing up as text files. (It would be REALLY great to have this space back.)

  • Patrick Hansen

    I just used, Space Gremlin, which is another drive data storage visualization tool and it revealed a Lost +Found directory that had two iNode files with two different numbers appending the iNode file name. One was 5.6GB and another was 5.3GB.

    I’m currently on OS X El Capitan 10.11.6

    I remember after upgrading to Mavericks, I started losing a lot of storage rather quickly and thought it had something to do with temp files and DropBox or Google Drive, but it turns out these iNode files were a major factor in that issue as it matches the “approx. 10GB” that all of a sudden was eaten up.

    Space Gremlin (probably other disk storage tools as well, and/or probably some terminal commands) will also reveal Restricted Files, which I just learned are temporary local backup files OS X creates if you use Time Machine to backup and haven’t backed up to an external drive in quite some time. It starts generating these backups automatically and these can also consume a large amount of disk storage but will not really show up in your normal finder windows.

  • Sanjay Varma

    Great article. I found 3 iNode files of large size and verified they contain installer files. When I tried to delete using the /bin/rm -f /lost+found/iNodeNNNNNNNN command, I get a “Permission denied” error.

    Any idea why? and how to get around it? I am logged in as the Administrator on my personal macbook.

Don’t start an argument with somebody who has a microphone when you don’t. They’ll make you look like chopped liver.

Harlan Ellison

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)

Recent Posts

Dell, Wall Street, Magic Beans, and the End of EMC

Dell, Wall Street, Magic Beans, and the End of EMC

September 7, 2016

FreeNAS First Impressions

FreeNAS First Impressions

August 25, 2016

Migrating Data With ZFS Send and Receive

Migrating Data With ZFS Send and Receive

August 18, 2016

It’s Fine To Mount Hard Drives On Their Side Or Even Upside-Down

It’s Fine To Mount Hard Drives On Their Side Or Even Upside-Down

August 13, 2016

14 Drives For 14 Ports: A Case For FreeNAS

14 Drives For 14 Ports: A Case For FreeNAS

August 10, 2016

My FreeNAS Build: Supermicro X10SL7, Intel Haswell Xeon, ECC RAM

My FreeNAS Build: Supermicro X10SL7, Intel Haswell Xeon, ECC RAM

August 4, 2016

Hello FreeNAS! Goodbye Drobo and Iomega…

Hello FreeNAS! Goodbye Drobo and Iomega…

August 3, 2016

macOS Sierra Includes a New Apple File System, APFS

macOS Sierra Includes a New Apple File System, APFS

June 13, 2016

Here’s Something Your Raspberry Pi Can’t Do: Gigabit Ethernet and SATA in the Olimex A20-OLinuXIno-LIME2

Here’s Something Your Raspberry Pi Can’t Do: Gigabit Ethernet and SATA in the Olimex A20-OLinuXIno-LIME2

May 25, 2016

Free as in Coffee – Thoughts on the State of OpenStack

Free as in Coffee – Thoughts on the State of OpenStack

May 2, 2016

Symbolic Links

  • Is Media & Entertainment the golden goose of Object Storage vendors?

  • Traffic Optimization with Teridion

  • I've installed Docker on Windows! Now what?

  • 10Gbps Home Lab – How I got there

  • Thoughts on Theft

Featured Posts

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

April 18, 2010

Ten Terrible Apple Products

June 14, 2012

EMC Redefine Possible (TL;DR Edition)

July 9, 2014

The End of Unlimited Data – Part 1: The Buffet

June 2, 2010

Sony NEX-5 Camera Review

September 15, 2010

Dragon Dictate for Mac: Utterly Frustrating

May 27, 2011

What is VMware VASA? Not Much (Yet)

November 11, 2011

Nimble Storage Rolls Out an All-Flash Array

February 24, 2016

Sony QX100 Lens Camera: Ruined by a Flaky iOS App

October 7, 2013

Review: American Standard’s Champion 4 Toilet Flushes Almost Anything

July 31, 2012

Copyright © 2016 · Magazine Pro Theme on Genesis Framework · WordPress · Log in