Tuesday, September 27, 2011

Lion Login Troubles

So you got your Mac updated to shiny new Lion and you're enjoying all those new zoomy features.

Then one day, you go to log in, and the screen goes white and kicks you back to the login screen.
Uh oh. That's not good.

In my experience, something corrupted the keychain(s) simply removing the keychains from the /Users/USERNAME/Library/Keychains/ folder allowed the user to log in and work as normal, save the loss of the passwords.

Fear not, your files are not lost. You're just unable to login to the graphical environment.

Here's the how to:
You'll need to get to the command line of the system. This will be easiest if you have another account on the machine, but could be done through Single User Mode as well.

If you're in Single User Mode, you'll need to mount the system Read/Write.
mount -o update /

If you're using Terminal.app from another user, you'll need root privelages. sudo works if you're an admin user, otherwise, you can su USERNAME to the account that is broken.

Enter the following, obviously replacing USERNAME with the short name of the account that is broken.
Note: the short name of an account can be found by looking at the name of the home folder of an account. Unless specifically altered, the default is a concatenation of the first and last name. John Doe would get the short name johndoe unless otherwise altered.
rm /Users/USERNAME/Library/Keychains/*

Once you've done that, you can reboot the system if you're in Single User Mode (shutdown -r now) or log out of the other account you were using.
At this point you should be able to sign into the ailed account.
You will have lost all the passwords that were saved in your keychain, and while annoying, that's a small price to pay vs losing your data.

Please be EXTRA careful when working in read/write while in Single User Mode as well as dealing with any and all Library files.
With power comes responsibility. BE CAREFUL!

Wednesday, June 01, 2011

Install a Target-mode Mac without shutting down the host

Have you ever had a Mac that you need to reinstall, but only have a disk image of the install disc? Or, you don't have a DVD that the soon-to-be-reinstalled machine will accept?

So long as you have a Firewire cable, you can still run the install.

  1. Put the target machine into Target mode (hold the "T" key as soon as you hear the chime on boot)
  2. Connect the target machine and the host machine via FireWire cable
  3. Insert the install DVD or mount the disk image on the host machine.
  4. Open Terminal and enter this line:
    open /Volumes/Mac\ OS\ X\ Install\ DVD/System/Installation/Packages/
  5. This will open a new Finder window displaying the contents of a folder on the install disc.
  6. In that folder, you'll need to run OSinstall.mpkg and select the hard drive of the target machine as the install point. (you may want to format the hard drive of the target machine prior to doing the install)
  7. Select your options (by clicking the "Customize" button) and you're off!


Note: this was written for 10.6.x. In some cases this works flawlessly, in others, it doesn't work at all. Please comment with your experience.