In my experience once the pending sector count starts going up, the drive is on its last legs and will fail soon.
Doing a full clone might push it over the edge, so back up the most important data first.
WinXP doesn't play nicely with an SSD, I'd suggest replacing the drive with another HDD.
Embedded systems have been running off CF card "SSDs" with MS-DOS and Win9x for over 2 decades now. XP is absolutely fine on an SSD.
The data is not in serious danger as I have backups of everything that I might want. My main interest is in restoring the OS. When it failed last time, in 2016, I did a clean reinstall of Win XP and was quite surprised that I could still download and install all the updates and patches. That is no longer the case though so I want to try to save the OS by imaging to another disk. I am not in a hurry and I will go as slow as necessary.
- Use a brand new Crucial BX500 480GB which I have available. This is probably the easiest but I do not know anything about this TRIM business. It sounds like I can install some software that would do it?
And the main question is what is the best, most reliable software to do the imaging?
I had a look at ddrescue (and ddpt) and it is way too complicated for a one time use. It would take me many hours to study it in detail even though probably I do not need 99% of the options. I need something simpler. I need a simple solution that will run on Linux. I do not mind using the command line; I just don't want to use something so complicated. I just want to try to clone a partition. That's all.
https://www.gnu.org/software/ddrescue/manual/ddrescue_manual.html
ddrescue source destination mapfile
ddrescue source destination mapfile
That's it. It really is that simple.
ddrescue /media/user/source /media/user/destination /home/user/desktop/mapfile
I have spent several, many, hours fiddling and got nowhere.
After many tries with Clonezilla I thought I had cloned a clone but it didn't work and I did another clone but it still does not work. This is extremely frustrating and a waste of time.
I plug in the disk with the clone copy but get the error "no such partition, entering rescue mode, grub rescue"
I am guessing I am doing something that makes the new disk have grub which it shouldn't. Linux has no place there.
Maybe the partition itself is OK but the boot record needs to be changed. How can I get rid of grub and make it bootable?
Very frustrating.
TestDisk 7.1, Data Recovery Utility, July 2019
Christophe GRENIER <grenier@cgsecurity.org>
https://www.cgsecurity.org
Disk /dev/sdj - 480 GB / 447 GiB - CHS 58369 255 63
Current partition structure:
Partition Start End Size in sectors
Warning: number of heads/cylinder mismatches 54 (NTFS) != 255 (HD)
Warning: number of sectors per track mismatches 28 (NTFS) != 63 (HD)
1 P HPFS - NTFS 0 32 33 58369 53 52 937699328
Bad relative sector.
No partition is bootable
Try booting off a Windows XP install disk and see if it gives you the option of "repair" or "startup repair". This might be able to fix the bootloader in the MBR.
cp --sparse=always /dev/sourcedevice image.img
…or compressed:cat /dev/sourcedevice | bzip2 >image.img
bzip2 is my preference here, because it eats zeros better than Solar Roadways eats public money. The operation must of course be done on unencrypted source, since encrypted data doesn’t compress, even if plaintext were zeros. Doing this on a failing disk is also not advisable: zeroing unused space means writing, and both trivial commands rely on reading being always successful.While restoring a device-level clone, mind sector size. Many newer storage devices use 4096 byte sectors, instead of 512 bytes.
2- I just realized I am using the disk with an external USB adapter and I do not know if that might make a difference. Maybe I need to plug it in direct to the mobo for clonezilla to be able to write the correct MBR. Maybe grub was there from before. This is something I should have considered earlier.
I have spent several, many, hours fiddling and got nowhere.