Skip to main content.
3 October 2005

Give an updated Mac that like-new feeling

posted 7:30 PM EDT in Apple

A question posed on today’s edition of Macintouch prompts this post. Sometimes it’s desirable to set up a brand-new Mac with additional software (and system updates), but still display the startup assistant when the machine first boots, for that fresh-out-of-the-box experience. There is a way to do this, but it involves a little Terminal futzing. The steps necessary are included as part of the man page for asr(8), Apple’s utility for system imaging and restoration. Here’s the shortish version:

  1. After building the machine the way you want it, make sure there are no other users on the system except one admin-level user, reboot, and log in as that user.
  2. Bring up a Terminal window. It’s in /Applications/Utilities.
  3. Remove the file used to determine whether the setup assistant should run —
    sudo rm /var/db/.AppleSetupDone
  4. Change to the root directory (this is largely a safety precaution against problems arising from the next step) —
    cd /
  5. Remove the home directory for the admin account —
    sudo rm -r /Users/[username]

    where [username] is the short name of the admin account.

  6. Here’s the big one — remove the entry in the local NetInfo database for the admin account; this removes all trace of the account in the system’s database of users.
    sudo nicl -raw /var/db/netinfo/local.nidb delete /users/[username]

    and again, [username] is the admin account’s short name.

  7. Shut down the machine, and do it soon. Having removed all trace of your account, it’s not a good idea to linger.

I used to do this every so often at NIH when setting up a new machine for someone, but these days I just drop a standard image onto it, which is much easier. Still, it’s a handy way to prep a Mac for resale, or as a gift to someone.

none

2 Comments »

Follow any responses to this entry through the comments RSS 2.0 feed. You can leave a response, or trackback from your own site.

2 Responses to “Give an updated Mac that like-new feeling”

  1. Collin says:

    Nice tip! It might be safer to do all the installations and updates, then reboot and hold Command-S to boot into Single User Mode, and do steps 3 through 5. In that way, you won’t have to risk being logged into a user account that doesn’t exist. When finished doing the commands in Single User Mode, type shutdown now to turn the Mac off. Upon the next boot, it will run the startup assistant like any new Mac.

  2. Command-Tab » Like New says:

    [...] A tip I ran across on niload.com describes how to do just that. Basically, you run setup like normal, log in and do updates and/or install programs, then remove a few things and shut down. Upon reboot, the Mac will run the Setup Assistant as if it just came from the factory. You can read the full hint for the detailed instructions. (Also, note my comment at the bottom of the hint, as it should be a safer way of removing the account.) [...]

Leave a Reply

You must be logged in to post a comment.