iMac 2009 frozen on boot screen This morning I needed to reset an administrator's account password on my Mac, because I had forgotten the password.

I used the steps listed on this article to accomplish this, but after restarting the Mac, I found that it was taking a while to boot. I shrugged this off, let it sit for while, then came back around half an hour later and it was still booting. I tried to restart it again, but to no avail.

References:


the computer is an iMac 2009
running OS X 10.7.5 Lion
no Recovery partition or capabilities


Other notes:


When I run the fsck -fy command in single-user mode, the computer returns:


/dev/rdisk0s2

Root file system

Executing fsck_hfs (version diskdev_cmds-540.1~34).

Checking Journaled HFS Plus volume.

Invalid B-tree node size

(3, 0)

The volume   could not be verified completely.

/dev/rdisk0s2 (hfs) EXITED WITH SIGNAL 8
This is not a direct answer, however, when the computer 'chimes' after activation, press and hold the key combination: command V to enter 'verbose mode'.
This should illustrate to the screen exactly what is happening during the boot process. If the process hangs on a particular step, then this is likely the issue, the remedy for which may be varied.

Alternatively, using the key combination command S immediately after the computer chimes, will grant you command-line access to the machine. OS X Lion is vulnerable to what I can only assume is a security error on Apples part, where an additional Administrator account can be created by fooling the computer into launching as it would during its first-ever launch. 

The procedure for which is simple:


Boot using command-S to gain basic terminal access.
Mount the primary drive using the command: mount -uw
Remove the 'applesetupdone' file using the command: rm /var/db/.applesetupdone
Exit and proceed using the command: exit


I should state that this is not in any way damaging to the computer, you will maintain all your files, preferences and data, it simply allows you to create an additional admin account. 

Using the instructions on-screen, create an additional account, from this position, you at-least have admin access to the device, however im afraid that this may not help you recover your password, only all of your data.

For additional password-recovery options, I would suggest consulting the below link, however it involves a lengthy and inefficient brute force attack.

http://www.hackmac.org/tutorials/crack-lion-password-hashes/

This may not be a direct answer, but I hope that it helps.