How do I know if I need a new hard drive? I just received a  MacBook Pro from somebody else because it was running too slow. Booting up takes about 4 minutes. 

I have tried formatting the drive and reinstalling the operating system from scratch. The reinstall takes about 8 hours and in the end it doesn't work, or boot up is just as slow as it was before. The computer especially seems to run slow while doing system/hard drive things with it. 

I want to know if getting a new hard drive will fix my problems. Is there a way to test my hard drive to know for certain that it is the problem? I don't want to waste my money on a SSD if it's not even going to make a difference. 

I've live booted Linux on which runs beautifully on it which is why I'm thinking it is probably the hard drive's fault.

Here are some more details about the MacBook Pro:


OS X El Capitan
Version 10.11.3
MacBook Pro (13-inch, Mid 2012)
Processor 2.5 GHz Intel Core i5
Memory 4 GB 1600 MHz DDR3
Startup Disk Macintosh HD
Graphics Intel HD Graphics 4000 1536 MB
I have the same model of Macbook which was showing the same issues. After replacing the Harddrive with an SSD I still had the same issue. 

It ended up being the SATA cable connecting the hard drive to the logic board. Over some time the insulation had started to wear off and the cable was occasionally shorting against the base of the case causing IO errors. Once I replaced the cable these errors stopped happening.

A good way of checking this would be to use an external USB to SATA cable and try and boot the laptop from it externally. If the drive functions well when doing this then it is likely the SATA cable that is at fault.