Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I want to delete a user account before selling my machine, so I chose the secure delete account option in System Preferences > Users & Groups. I think I saw a progress bar at first as it was deleting the account.

I've come back to the machine after a few hours. There is no progress bar. System Preferences is open and if I try to quit, it says "Users & groups is removing a user account and home directory". In grey writing, it says "Deleting Account..." under the user name. In Activity Monitor I can see that 'writeconfig' is using 10+% of the CPU, followed by 'opendirectoryd' and 'mds'.

Is it doing anything? How long is it supposed to take? It's been 6 hours already.

share|improve this question
    
did you ever figure it out?? i'm in the same situation, it's been hours so far, what was the outcome of your experience? –  dm03514 Feb 8 '12 at 18:07
9  
Secure delete can take a very, very long time. It writes the data 35 times over - so if you have a 10 GB music library, on most macs, that secure erase process can easily last 35 hours. Without knowing the actual write speed of your drive and CPU in practice, it's probably still overwriting. –  bmike Feb 8 '12 at 18:26

5 Answers 5

up vote 11 down vote accepted
+25

To add on to the existing answers and offer a different solution, you can securely erase the drive instead of just one user account.

If you want to sell your machine but also include installed software, there is a better way to set this up that will ensure none of your personal data is on the machine, as well as provide a better box opening experience for your buyer.

  • I would suggest doing a secure erase of your hard disk first.
  • Then, reinstall your OS.
  • Configure a dummy user account named "test" or "admin" or something generic
  • Install the software you want to include
  • Restart your machine in Single User mode
  • Very carefully, do the following:

mount -uw / (This mounts the root volume so you can make changes to it.

rm /var/db/.AppleSetupDone (This removes the flag that tells Setup Assistant that it's done)

rm /var/db/dslocal/nodes/Default/users/"shortname".plist (Replace "shortname" with the user account name you set up before. This removes the user plist)

rm -rf /Users/shortname (Replace "shortname" with the user account name you set up before. This removes the User directory)

rm -rf /Library/Preferences (This resets preferences)

shutdown -r now (This restarts the computer)

Verify that your machine starts up to the Setup Assistant and you're done. That way, your buyer can start up the machine to the Setup Assistant and still retain the software you want to provide them with.

Good luck.

share|improve this answer
1  
Yes, yes! This is the "clean up" that you might need to perform as a worst case. Most of this can be accomplished in the Finder and with Disk Utility. Also, the single user mode command /sbin/fsck -fy can repair any filesystem damage should your mac land harshly when you interrupt it. A safe boot holding the shift key does the same of course. –  bmike Feb 8 '12 at 20:01
    
@MattLove Indeed. Sorry, I read too quickly. I will delete my misleading (and misled ;) ) comment. –  MattiSG Feb 9 '12 at 18:17
    
@MattiSG No worries! –  Matt Love Feb 9 '12 at 18:51
    
This is great information, my only concern would be: "Who owns (in Unix terms) the files which were installed by the 'test' user once they are gone?" My guess is that they are simply reverted to being owned by an UID number (501, most likely), but if the new account created by the new owner of the machine is 502, I wonder if they will run into permissions weirdness when it comes time to upgrade software. Probably not a major issue, just something to be aware of. –  TJ Luoma Feb 11 '12 at 0:04
    
@TJLuoma I'm pretty sure that any of the files that are installed go into either /Applications or /Library and will be owned by the system. Any files in ~/Library should only matter once the application is opened for the first time. Once the new user account sets up their account, it should recreate those files. Is that right? –  Matt Love Feb 11 '12 at 11:47

The secure delete option can indeed take a long time. But if you really want all traces of your data to be removed from the media, you need to wait for it to complete.

If you want to quickly get all traces of your data off a machine, the quickest way is to physically remove the disk drives (believe it or not). This is what I generally recommend to friends who want to pass along a used machine.

If you really just want to preclude casual perusal of your old data, the secure delete option isn't necessary. You can just have System Preferences do a normal deletion.

A common misconception is that reformatting the drive and re-installing the OS will remove all traces of your data. This is not true! It's not much more secure than doing a normal deletion. (What makes it slightly more secure is that portions of the old data might be overwritten once when you re-install the OS.)

share|improve this answer

Yet another approach that might speed up the deletion process would be to delete a user account without chosing the secure delete account option in System Preferences > Users & Groups.

Afterwards, on a still existing user account, overwrite the free disk space just once from Terminal.app (see Secure deletion: a single overwrite will do it).

ls -ld /Volumes/*
man diskutil | less -p secureErase
diskutil secureErase freespace 0 '/Volumes/Macintosh HD'
share|improve this answer

I think you would be better served by wiping and reformatting the entire hard drive and re-installing the version of Mac OS X that came with the machine from the original installation disks. Not only would it be faster, it would be more secure and you would ensure that you are not passing any data that you own along to the new purchaser.

share|improve this answer
3  
Actually, no, this would not be more secure. The secure delete option does what it does for very good reasons. By rewriting over the media several times it insures that all readable traces of your data are thoroughly unrecoverable. A "reformatted" drive can actually be recovered in many cases, because there is still readable data on the media. –  Kaelin Colclasure Feb 8 '12 at 19:10
    
You are missing the point. It appears that the person asking the question seeks to keep the Mac OS X installation intact but only to securely delete one user account. I'm saying he should wipe the entire hard drive using the high-security settings in Disk Utility, which rewrites over the media several times as well. –  Wheat Williams Feb 8 '12 at 23:23
1  
@WheatWilliams then if you're talking about securely erasing the whole drive, it would not be faster. Simple maths: writing 35*120GB is longer than writing 35*80GB. However, I do agree it would be much better to wipe the whole drive. It is simply wrong to say it would be faster. –  MattiSG Feb 9 '12 at 8:34

The best option in my opinion is to interrupt the process any time you wish. You are correct that only securely deleting the user account is faster than securely deleting all unused space (except for the edge case where the drive it 100% totally full except for this user's data - unlikely in practice and at risk of failing due to no swap space being available). You will have added time to re-do the erase, so unless you are certain it's frozen, letting it run might be the best course until you need to interrupt the process.


Any time you have to halt the mac, there could be some damage to the files being written, but at this point, the mac is simply wiping the user files that are about to be deleted.

If you have a recent backup or bootable restore media, you are really in great shape. Once the mac reboots, you will of course have to deal with the complete deletion of the /Users/whatever folder and potentially need to re-do the user deletion if it's still partially left around. You can still choose the secure delete command but this time have a user logged in to inspect the progress. You can also insecurely delete and either skip that security or have the mac run a secure overwrite of all free space when you can afford the time to write over all the free space to ensure security if someone were to try to search for files among the unallocated space.

I would let the mac delete as long as you can, and then ask back a new question linking to this if you should run into any questions or errors on cleanup.

share|improve this answer
    
No, this does not seem like a good option to me. Indeed, we don't know for sure in which order the user's data and existence (in a separate directory) are deleted. So, you could corrupt the files enough for them not be available anymore for deletion, but be recoverable through data recovery software. You would therefore need to securely erase free space, taking longer than the original procedure (the data already securely erased would have to be once again securely erased). –  MattiSG Feb 9 '12 at 8:38
    
Sounds good - do know that when you securely delete a user - the OS only deletes the home folder - no files stored outside the home folder are deleted. You will need to search for them later by UID and securely delete them. –  bmike Feb 9 '12 at 16:03

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.