I have a problem with my MacBook Pro, which runs Mac OS X Lion.

I have reset it back to the Setup Assistant.

After I executed the following commands, I need to select the region when I boot; this works fine, but when I choose the keyboard, the whole Mac gets stuck, and I see the loading icon on the screen. Even if I wait one hour, nothing happens.

$ mount -uw /
$ rm -R /Library/Preferences/
$ rm -R /Users/username/
$ rm /var/db/dslocal/nodes/Default/users/username.plist
$ rm /var/db/.AppleSetupDone

How can I solve this? I have no Mac OS X disc to reinstall Lion.

Can I create a user via the command line, or skip the setup assistant?

  • Was this the only user account on the system? – stuffe Mar 26 '12 at 12:10
  • yes it was the only one – khfewfff Mar 26 '12 at 12:22
  • Finger in the air tip: Boot from your recovery drive and perform a permissions fix. Then try again. – stuffe Mar 26 '12 at 12:25
  • i dont have a rec. drive – khfewfff Mar 26 '12 at 12:27
  • Even with Lion? Did you remove it? apple.com/macosx/recovery – stuffe Mar 26 '12 at 12:29

Sounds like a bad install. I suggest booting the computer into the hidden Recovery partition by holding ⌘ Cmd-R at startup and doing an internet recovery system restore. It'll be the second option in the OS X Utilities window that comes up. As long as the iMac is connected to the internet it'll re-download the installer and restore a fresh system to the drive.

If you're trying to bring the MacBook back to the way it was when you purchased it I'd suggest opening the Disk Utility in recovery first and erasing the drive completely. (But only if there's no important data on it!)


How can I solve this? I have no Mac OS X disc to reinstall Lion.

You don’t need one. Here’s how you can buy or create a Lion installer USB stick or DVD.


It may help to remove the file at /Library/Preferences/.GlobalPreferences.plist (this file contains information related to the current time zone). Alternately, you may be able to remove /Library/Preferences/com.apple.HIToolbox.plist (which contains keyboard layout settings) to get the setup assistant to complete normally.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .