Securely erasing free space on Macs

Most if not all of the data on your hard drive is still available, even after erasing your drive. Most computer owners don't realize the danger and risk of their data getting into someone else's hands in any number of situations where the old computer ends up in someone else's hands. Bank account information, social security numbers, private messages, email, documents, business plans; all of this and more can be easily retrieved by a skilled technician with the right tools.  So it's important to take measures to prevent your data from ever getting into the wrong hands.

Recently after I migrated my data from one Mac to another, I noticed that the "Erase free space" option in Disk Utility was grayed out and not an available option to me, regardless of what volume I booted from.

This bummed me out at first.  I read that presumeably Apple had disabled the ability for MacBook Air and other users with SSD drives including flash memory drives from being able to securely erase the free space on their drives, making it next to impossible for someone to retrieve the data from the computer.   Fortunately there's still a very good working solution.

Before you attempt this, a word of warning: Like anything that could have irreversible unintended consequences, don't do or attempt to do what I did unless you're 100% confident you know what you're doing.  I don't believe in upward delegation: I may share ideas, concepts, practices and procedures with customers, but I don't expect customers to attempt them.  I suggest you hire a skilled technical professional regardless, because even the same procedure may have different outcomes for different individuals with different situations.

Enter good 'ol Unix.  The Mac OS X terminal allows you to securely erase free space on a volume, as long as you can identify the disk ID (use diskutil list in terminal to identify the volume you want to go after).  Once you do this, be prepared to take about 10 hours on a 256GB flash drive (on a fast i7 processor).  Here's a screen shot of my terminal command, as a reference only (DO NOT USE THIS COMMAND unless you know what you are doing):

The end result is a computer that is reasonably safe to transfer into someone else's hands, with little risk of data misappropriation and identity theft.  This procedure can also be set up to happen on a regular, recurring basis.  This is especially cool for road warriors whose computers are at a higher risk of loss or theft.