The General Theory of RIAtivity

Pondering the New Fabric of the Web — Rich Internet Applications (RIAs)

How to Reset Mac OS X Lion to Factory Default State

with 2 comments

Getting ready to sell your Mac and want to do a full factory restore to default settings? Just follow this procedure — it works on Mac OS X Lion only.

1. Launch the Terminal application on you Mac. Then run the following sequence of commands (one at a time):

sudo su
dscl . -delete /Groups/admin GroupMembership yourAccountNameHere
dscl . -delete /Users/yourAccountNameHere

2. Now reboot your Mac into single-user mode by holding Command-S at startup.

3. Once booted into single-user mode, run the following sequence of commands (one at a time):

/sbin/fsck -fy
/sbin/mount -uw /
rm -R /Users/yourAccountNameHere
cd /var/db/
mv .AppleSetupDone .RunLanguageChooserToo
rm -R /Library/Caches/*
rm -R /System/Library/Caches/*
rm -R /var/vm/swapfile*
reboot

Your Mac will reboot to the start of the initial Apple Setup program just like when you first powered it on after purchase. All clean and ready to sell or give to a new user.

Advertisement

2 Responses

Subscribe to comments with RSS.

  1. Brilliant. Worked like a charm.

    Frosty

    29-January-2012 at 22:20

  2. hey, what will happen to the user data that is present in the harddisk

    abhi

    1-February-2012 at 09:10


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 41 other followers