I recently had my hard drive directories completely wiped. I was installing XCode 4 and realized after about an hour it had hung halfway through. I also noticed at that time that I was missing icons for files, places, etc. Tried to force quit and had to eventually hold the power button down for 10 seconds to power down. Couldn't boot back up and, after several attempts, decided to boot with the original Snow Lion disk. That boot hung at the Apple logo. After several attempts, and the inability to eject the disk, I took it to a local repair shop. They booted from another drive but couldn't see (or recover) anything on my hard drive. I sent it to Drive Savers and they recovered some of my files (about 70%) but could not determine the underlying problem. Has anyone else had any problems with XCode installations? Any other thoughts on the issue?
I've done dozens of Xcode installations without a problem. I doubt Xcode had anything to do with your problem. What appears to have happened is your drive died. Plain and simple.
It doesn't appear to be the hard drive itself - no one can find anything wrong with the hardware. And everything was was working fine immediately before the crash. It's very odd.