Selling macbook, best/fastest way to delete data?

I don't know if I can necessarily help you out with the "fastest" way, but I think I can help with "best".

Most of your data will indeed be in your account, but there's also the chance that other personal items may be scattered about your hard drive. I would not personally sell a computer after just removing my own account, particularly if my account was not securely deleted, either by overwriting the unused disk space or by discarding the encryption key. (Of course, there's always the chance a computer could be lost or stolen, too, so I use FileVault 2 to encrypt my system's disk in case I'm not given the opportunity to securely erase it.)

You say you don't have a startup disk, but since you have Lion, you should be able to use OS X Recovery:

  1. Hold command-R on startup.

  2. Use Disk Utility to erase the disk securely using Security Options on the Erase tab.

  3. Start the installer to install a fresh copy of Lion. (This may involve downloading the installer from the Internet… note this can be a very large download. If you're feeling nice, you could take this opportunity to grab a copy of the installer for your MacBook's new owner.)


If someone else has an SSD, the secure erase options are currently disabled for SSDs in Disk Utility. According to http://support.apple.com/kb/HT3680 erasing an SSD normally might be secure enough:

Note: With OS X Lion and an SSD drive, Secure Erase and Erasing Free Space are not available in Disk Utility. These options are not needed for an SSD drive because a standard erase makes it difficult to recover data from an SSD. For more security, consider turning on FileVault 2 encryption when you start using the SSD drive.

You can still run something like diskutil secureErase 4 disk0s2 in Terminal on the recovery partition. Simply enabling FileVault before erasing the drive or volume is probably a better option though. See this question.


I'll take a crack at "fastest":

(Note: This should go without saying, but make sure you read through this and understand it before you do anything.)

Assuming your original admin account was "joe" whose home was "/Users/joe"

1. Find User ID Number

ls -nld /Users/joe

drwxr-xr-x+ 65 501 20 2210 May 8 00:19 /Users/joe/

See that 501? That's your user ID number. It may be different, but it probably close to 501.

2. Delete your $HOME

Login as your 2nd admin user, and

sudo find /Users/joe -print -delete 

That will delete all of the files under /Users/joe.

There are other ways to do this, of course

sudo srm --simple --verbose --recursive /Users/joe 

Check man srm to see if you want to use --medium instead of --simple

3. Find Other Files

Then you might want to take a look for other files owned by joe. You can do this by username or user ID. I recommend ID, but that's probably because I'm an overly cautious fuddyduddy.

sudo find / -user 501 -print

replace '501' with whatever the number was above is Step #1


The quickest way to delete everything is to boot to the Recovery HD and terminal to drop a new empty filesystem on top of the existing one:

 diskutil reformat disk0s2

You might check that the device is correct by issuing diskutil list and making sure that Macintosh HD is actually disk0s2, but most people that have an alternate device layout know they do and can compensate. Note, this doesn't erase anything in terms of leaving all the files sitting on the drive. You would then want to consider if you wanted to zero the empty blocks, or do some more lengthy secure erases.

 diskutil secureErase 0 disk0s2 

The above command would zero out the entire volume and you can choose other levels such as:

            Level should be one of the following:
                  +   0 - Single-pass zero-fill erase.
                  +   1 - Single-pass random-fill erase.
                  +   2 - US DoD 7-pass secure erase.
                  +   3 - Gutmann algorithm 35-pass secure erase.
                  +   4 - US DoE algorithm 3-pass secure erase.

As mentioned in this other excellent answer, turning on FileVault is far more secure than any of these erase options for SSD and probably for HDD as well.