Twoy said:
Hmmm, might not matter now anyway, plugging the old hard drive back in appears to have brought back the old problem of random shutdowns, even when the drive was not being used.
It does sound like this drive has developed some sort of hardware fault, but it might still be usable once it’s repartioned / reformatted, since file systems can handle disks with bad regions on them.
OTOH, drives are so cheap these days that it’s probably not worth the risk or the hassle.
I suspect that Windows is getting a bit confused because the drive still says that it’s a primary system drive. Also, it’s possible that the drive has a sick boot sector / MBR and that it’ll behave nicely once the MBR is repaired.
You could probably use a repartitioning tool to quarantine the files you want to keep, but it’d be much simpler (and faster) to simply copy them to a known good drive – moving large amounts of files around on a drive is a rather time-consuming process, especially if the drive has lots of faulty sectors.
If you want to risk continued use of the old drive you will need to format it, and it’s probably a good idea to repartition it, to force a new MBR to be created. You could do that with Windows-based stuff, but doing it under Linux will eliminate the system confusion problem I mentioned earlier. For that matter, simply booting the system with Linux (either a Linux live CD / DVD or Linux-based repair CD) and seeing if it randomly shuts down would help to diagnose if it is a software-based problem. If the system appears to be stable, rescue the data and then repartition / reformat the drive.
Under Linux, it’s very easy to clone partitions and whole drives, either to a new drive, or in the form of a disk image file. Linux-based disk repair & recovery software can operate on such disk images files, which can be very handy when you’re trying to recover stuff off disks with severe hardware faults.
Similarly, it’s quite easy to save the boot sector of a disk or partition to a file, and to restore the boot sector from the file in case something horrible happens.