Mac Secure Erase Free Space
- How To Clear Free Space On Mac
- Mac Secure Erase Free Space Failed With The Error Couldn T Create Temporary File
After reading that title, you must be asking yourself: How will I delete hard drive space that is already ‘free’?
Well, you might not know this, but once you delete any file from your Mac the usual way, the file actually remains there, only that it is no longer usable by your Mac. Then, when you add more files to your Mac, they ‘overwrite’ the space taken by those unusable files that you deleted previously.
In short, deleting data on the Mac hard drive doesn’t securely erase it. It just creates free space that can be used for recovering the deleted data using a data recovery tool. So, you need to erase free space on Mac hard drive. The Disk Utility app of Mac OS X can be used for the erasure of these free spaces. Here's the video tutorial that explains how to securely wipe the free space on your Mac using Disk Drill.Download for free: https://www.cleverfiles.com/disk. Mac users having already deleted files and needing to ensure those deleted files are unrecoverable can take the extra step of securely erasing free disk space. To securely erase free disk space.
What this means is that an advanced user who might come into possession of your Mac can actually recover files that you have deleted previously. Unless, of course, you delete them securely first.
For this, using the Terminal utility is perhaps the best way out, since it allows you much more control over what you are doing.
Important Note: Always remember to use Terminal ONLY when you are confident in what you are doing, since a simple mistake when using this utility can cause some serious damage to your Mac.
So let’s learn how to securely erase all that free space on your Mac’s hard drive with Terminal.
First, here is the Terminal command we will be using. Just keep it there for now, since you will need to slightly change it before proceeding.
diskutil secureErase freespace 1 /dev/disk0s2
This is because this command uses slightly different values for each Mac, so before using it on Terminal, you will have to find the exact values for your Mac first.
– The first value to change is the number ‘1’. You can actually choose between ‘1’, ‘2’ and ‘3’ here. Using number ‘1’ erases your disk’s free space using a random single pass (one ‘pass’ means that the system overwrites the deleted files once). Number ‘2’ uses a 7-pass secure erase and number ‘3’ uses a special algorithm to perform a huge 35-pass secure erase.


Obviously, the higher the number you choose, the longer the process will take. Usually, using numbers ‘1’ or ‘2’ should be more than enough to perform a safe erase.
– Now, the second value you need to know is the Identifier number of the disk where you want to perform the process. For this, open Terminal and copy and paste this command:
diskutil list
This will display a list of all your Mac’s hard drives. What you need to copy is the Identifier number beside your selected disk. In my case, I want to securely erase the free space on the disk with 120.5 GB, so its Identifier number would be ‘disk0s2’.
With this information, you can now use the first command from above:
diskutil secureErase freespace 1 /dev/disk0s2
Just make sure to keep the number on ‘1’ or to change it to either ‘2’ or ‘3’ depending on how secure you want the erase process to be. Also, change ‘disk0s2’ to your hard drive’s own Identifier number. Once ready, press Enter/Return.
After you do, just sit back and watch Terminal do its magic securely erasing all your hard drive’s free space.
The above article may contain affiliate links which help support Guiding Tech. However, it does not affect our editorial integrity. The content remains unbiased and authentic.
How To Clear Free Space On Mac
Read Next
How to Use the New Disk Utility in OS X El Capitan
One of the many changes to the
If you’re selling an old Mac, a spare hard drive, or you’re just quite paranoid about your deleted data, you’re either familiar with—or should be familiar with—the Erase Free Space button on the Erase tab in Disk Utility (found in your Applications -> Utilities folder).
When you click this button, you’re presented with three options for securely erasing the free space on your hard drive: write over the free space with zeros (fast and relatively safe), write over the free space three times (more secure, very slow), or write over the free space seven times (extremely slow).
I use this feature whenever I sell an old machine. First I format the drive and install a fresh copy of macOS, then I use Disk Utility to erase the free space (typically the one-time write-with-zeros option). This gives me a good sense of security, as it would take a team of dedicated professionals, and possibly special hardware, to have some chance of recovering any of my deleted data—though I really only care about a few financial files, and those are kept on an encrypted disk image, so they’re probably safe anyway.
Use Terminal to securely erase a drive
What if you want to do this from Terminal instead? In Terminal, a program named diskutil
provides most of the features of macOS’s Disk Utility.
(Please note that, as with many Terminal commands, there’s a chance of Really Bad Things happening if you make a mistake with the following instructions. Proceed with caution, and make sure your backups are current before you try any of the following.)
To find out about diskutil
in detail, type man diskutil
at the Terminal prompt. Within the man
pages, you’ll find the explanation for how to securely erase a disk’s free space using diskutil
:
But how do you figure out what to list for device
, which is the disk (or partition) that has the free space you’re trying to securely erase? diskutil
can provide that information, too. Just use diskutil list
to see a list of all drives and partitions. On the far right, you’ll see an IDENTIFIER
column; that column contains the identifier that diskutil
needs. Here’s an example of the list
output on my machine:
IDG
There’s just one last bit of information you need to know to erase the free space on a drive from the command line. In Unix, all devices appear as part of the file system tree, and in macOS, they’re all listed in the /dev
directory. So if I want to use diskutil
to erase the free space on my Apple_HFS Untitled
volume on my external drive, using the single-pass method, the final command would look like this:
diskutil secureErase freespace 1 /dev/disk2s1
Warning! It’s critically important that you include the freespace
portion of that command. If you don’t, diskutil
will happily start securely erasing the entire disk, instead of just the free space! Yes, that’s a Really Bad Thing, especially because it will be securely erased, meaning there’s no chance you’ll be able to recover the data.
Stay connected with us on social media platform for instant update click here to join our Twitter, & Facebook
We are now on Telegram. Click here to join our channel (@TechiUpdate) and stay updated with the latest Technology headlines.
For all the latest Technology News Click Here
For the latest news and updates, follow us on Google News.