Backing it up was the right thing to do.
If it is the hard drive they are not economically fixable.
In other words buy another.
But this behaviour sounds familiar to me and I would check the following especially if the motherboard is in the four or five year old range.
I would take a close look at the capacitors.
If any are domed rather than flat or leaking brown crud around the base then my bet would be that the hard drive is OK but the motherboard is junk.
This is sometimes fixable if you have good soldering skills, suitable equipment, a source for correct replacement capacitors and are willing to waste the time and money knowing it might not work.
Let us know what you find.