It would probably be a good idea to use a Linux live CD and use the dd command. It can image your entire hard drive bit-for-bit on another drive, albeit it can take time. You need a blank USB to boot Linux from to proceed.
I'll assume you're using an Ubuntu LiveCD. Once you boot up the LiveCD, select Try Ubuntu. Go to GParted and find which disk is your hard drive. It'll usually be something like /dev/sdX with a number in place of the X. Do not use the number after the X as that denotes a partition rather than a disk. Once you find the letters for your hard drive, then open up a terminal.
The next command actually images your drive. Use it with great care because a mistake can destroy whatever data you have on the drive. Execute the command below: it'll take a super long time.
sudo dd if=/dev/sdX of=/dev/sdY bs=4K status=progress
Replace X with the letter for your dying hard drive and replace Y with the letter for your other blank hard drive that you want to image the dying one to. After this completes, you'll have an imaged hard drive.
Consult dd(1)
for more on how to use dd.
3
Possible duplicate of What utility can move my Windows boot partition over to another hard drive?
– JakeGould – 2019-10-03T00:24:09.657+1 for Acronis. $50 to buy outright but pretty simple to use.
– Anaksunaman – 2019-10-03T00:30:23.7231FWIW, Clonezilla is extremely easy to use, it just has a ton of options. – Michael Frank – 2019-10-03T00:32:39.363