Erase Free Space Failed & Missing Free Space Now

Discussion in 'OS X El Capitan (10.11)' started by syan48306, Aug 3, 2016.

  1. syan48306 macrumors 6502a

    syan48306

    Joined:
    Apr 15, 2010
    #1
    So I ran a erase freespace command: sudo diskutil secureErase freespace 1 /Volumes/Macintosh\ HD
    in El Capitan and the first time I ran it, I forgot the "Sudo" part and it failed half way. It created the temp file but never deleted it. I ran it a second time with sudo and it worked. I'm still missing about 100GB of space from that first failed attempt, and I can't seem to find where El Capitan stores the temp file. Any ideas where I can find it to delete it?
     
  2. KALLT macrumors 601

    Joined:
    Sep 23, 2008
    #2
    The easiest way to get an overview of space usage is with this command:
    Code:
    sudo du -hxd 1 /

    This command will print the size of a directory and its subdirectories in KB/MB/GB, but only show you the size of the directories that are one level underneath the specified top level (in this case every directory at /). You can work your way down the tree to see where it ended up. Rebooting or a safe-boot may also work, the latter will clear temporary files, but you should use this as a last resort (as it will remove system caches).

    If I may ask, why are you using the command line for this?
     
  3. syan48306 thread starter macrumors 6502a

    syan48306

    Joined:
    Apr 15, 2010
    #3
    El Capitan removed the remove free space feature in the disk utility.

    I'm still struggling to find where that temp data file was created for erasure.
     
  4. KALLT macrumors 601

    Joined:
    Sep 23, 2008
    #4
    I gave you three possible solutions, have you tried them?

    By the way – I just saw that you have a MacBook Pro with an SSD – if you do this on an SSD, then you are wasting your time. Erasing free space or even secure erasing in Disk Utility does not technically work on SSDs, which is why Apple removed the option. It causes unnecessary write operations of which an SSD has a finite number.
     
  5. ScoobyMcDoo macrumors 65816

    Joined:
    Nov 26, 2007
    Location:
    Austin, TX
    #5
    I just spent a few seconds on this site and found this. Hope it is helpful.
     
  6. syan48306 thread starter macrumors 6502a

    syan48306

    Joined:
    Apr 15, 2010
    #6
    Secure erase does work on SSD's while it's true it does shorten the lifespan of the SSD, it's not the end of the world. The reason why they removed it was because of the potential of not actually being able to be 100% positive that the secure erase cleaned out everything. There's a possibility that some fragments of data may be left in the controller. That said, I'm not all that worried about both points.

    sudo du -hxd 1 / did get me close but it was a slog to get through all of the directories. Tried a safemode boot and got some space back. Not exactly all of the space but it's better than nothing. Not sure if that's it or if there's still more out there to be reclaimed.

    Cute but not really useful. Thats a post from 2007 and it doesn't appear to do anything.
     
  7. ScoobyMcDoo macrumors 65816

    Joined:
    Nov 26, 2007
    Location:
    Austin, TX
    #7
    There were two possible file paths mentioned in that article stating where the temp file is. Are you saying neither one of them were what you were looking for?
     
  8. syan48306 thread starter macrumors 6502a

    syan48306

    Joined:
    Apr 15, 2010
    #8
    Correct. I'm thinking something's changed since El Capitan and the manual invocation of the command is different from how it used to work.
     
  9. ScoobyMcDoo macrumors 65816

    Joined:
    Nov 26, 2007
    Location:
    Austin, TX
    #9
    So, common to both he paths given in that article is the folder name "TemporaryItems". Maybe checking for stuff in all directories named as such might help you find the culprit. So, open up Terminal and type this command to become root:

    sudo -i

    That will ask you for you password - you have to do this from and admin account. Now type the command:

    find / -name TemporaryItems

    This will run for a long time and will print out any file or directory with the name "TemporaryItems". Next you will have to go to these directories and investigate.
     
  10. KALLT macrumors 601

    Joined:
    Sep 23, 2008
    #10
    @ScoobyMcDoo: You don’t need to become root for this, you can just prepend the find command with sudo. You also might want to add the -x option to it, so that it does not needlessly traverse mounted drives.
    Code:
    sudo find -x / -name TemporaryItems
     
  11. ScoobyMcDoo macrumors 65816

    Joined:
    Nov 26, 2007
    Location:
    Austin, TX
    #11
    @KALLT: Good call on the -x. Yes, I know that you can just prepend sudo, however in cases like this, where the next thing you do is cd to a directory that probably only root has privileges to, I usually just start with the sudo -i, so I can be lazy and not type sudo for every other command.
     
  12. KALLT macrumors 601

    Joined:
    Sep 23, 2008
    #12
    By the way, the temporary file is called ‘.com.apple.diskmanagement.EFTFile2.ddfile’, in the root path. You might want to look for that:
    Code:
    sudo find -x / -iname .com.apple.diskmanagement*
     

Share This Page