I had a similar issue on my iMac. The drive was getting power because the lights were on and I could hear the drive but my Mac couldnt see it. Long story short - It turned out to be the power supply. When I swapped out the power supply the drive worked fine. I would have never thought that was the issue because the drive was definitely getting power. This may have nothing to do with your situation but wanted to mention my experience.