Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

SuprUsrStan

macrumors 6502a
Original poster
Apr 15, 2010
715
1,015
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?
 

KALLT

macrumors 603
Sep 23, 2008
5,380
3,415
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?
 

SuprUsrStan

macrumors 6502a
Original poster
Apr 15, 2010
715
1,015
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.
 

KALLT

macrumors 603
Sep 23, 2008
5,380
3,415
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.
 

SuprUsrStan

macrumors 6502a
Original poster
Apr 15, 2010
715
1,015
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.

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.

I just spent a few seconds on this site and found this. Hope it is helpful.

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

SuprUsrStan

macrumors 6502a
Original poster
Apr 15, 2010
715
1,015
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.
 

ScoobyMcDoo

macrumors 65816
Nov 26, 2007
1,188
37
Austin, TX
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.
 

KALLT

macrumors 603
Sep 23, 2008
5,380
3,415
@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
 

ScoobyMcDoo

macrumors 65816
Nov 26, 2007
1,188
37
Austin, TX
@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.
 

KALLT

macrumors 603
Sep 23, 2008
5,380
3,415
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*
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.