Secure Erasing on OS X

OS X comes with the powerful tool “Disk Utility” for any formatting or partition task. But as you may know, formatting a drive does not mean that all the data on it is really erased. What happens is that the information of the file structure is erased. Without this, the drive appears to be empty. In reality though, all the 0s and 1s representing the actual content of your files are still there. After saving new data on it, all the 0s and 1s on the drive get overwritten bit by bit.

To erase everything securely, you have to overwrite the complete disk with new 0s or 1s. Here is how it is done:

diskutil list
diskutil secureErase 0 /dev/disk[N] 

Instead N, use the number of the drive you want to be erased securely. These commands overwrite the selected drive with 0s. After that, the drive can ne formatted and partitioned normally.