This is a hardware problem. If it cannot be formatted on both operating systems, then it has a problem that is not software related. I recommend on connecting the drive to another computer with a new set of cables and perform the same operations again. Don't install Ubuntu, just run it in a Live session from a USB stick. If the result is the same then you might need to change the drive with a new one.