Cloning a Bad Hard Drive - Page 1
Forum section: electronics / general

author: bostonman
author_rank: Super Contributor
timestamp: October 20, 2020, 11:53:53 pm
content: I have a 120GB 2.5" hard drive in a laptop. The system boots (it's an old XP machine) but the hard drive seems to spin excessively.An IT guy told me that's usually an indication the hard drive is bad, so I decided to clone it onto a SSD. I used Macrium Reflect, but that aborted due to a CRC error. I attempted to disable the verification, however, it still aborts due to CRC error(s). I also ran chkdsk, it ran through, but still caused the cloning to fail.After research, I tried EaseUS ToDo Backup, but that didn't work. I bought a stand alone Sebrent docking station that does cloning without the need of going through a PC. You insert both drives, turn on power, push a button, and it clones. Unfortunately I think the errors on the hard drive is causing the Sebrent to not work because it's been flashing at 25% for over two-days (it has four LEDs. Each one flashes as it's cloning, and remains lit as each 25% finishes).Does anyone have any suggestions on how to get this drive cloned?

author: ve7xen
author_rank: Super Contributor
timestamp: October 21, 2020, 12:01:22 am
content: ddrescue.https://www.technibble.com/guide-using-ddrescue-recover-data/

author: isometrik
author_rank: Regular Contributor
timestamp: October 21, 2020, 12:39:10 am
content: +1 for ddrescue

author: AntiProtonBoy
author_rank: Frequent Contributor
timestamp: October 21, 2020, 03:19:10 am
content: Immediate thought was also ddrescue.

author: Mechatrommer
author_rank: Super Contributor
timestamp: October 21, 2020, 03:42:38 am
content: perhaps one less elegant solution is a solution, but ymmv... can you try copying on file by file level first? say using Windows Explorer to another disk, most important files first. the CRC that causes indefinite halting maybe on the XP system files that are recoverable by reinstalling fresh XP. if you try to recover some important softwares, try to save as much as you can esp Windows registry and probably some files installed in Windows or System32 folders? or maybe try to create "disk image" as intermediary process instead of directly "clone" attempt may work? (skip CRC, bad sectors or any other errors) or else maybe try the "surface to surface match" cloning technique if available. or have you read this?https://www.easeus.com/resource/fix-data-error-cyclic-redundancy-check.htmlsearching the internet may give you some light. btw my current disk recovery/backup tool is AOMEI Backupper, i also keep the other recovery tools install files like EaseUS et al in case AOMEI cant do the job. good luck!

author: station240
author_rank: Unknown
timestamp: October 22, 2020, 01:45:12 pm
content: Quote from: Mechatrommer on October 21, 2020, 03:42:38 amI've had to do this for someone, the drive was accessible, but had random files corrupted. Clearly bad sectors.I used one of the standard DOS directory copy commands, with various flags added to:0. Copy files and directories, plus hidden/system files.1. Not retry files that failed to read.2. Not ask me stupid Y/N questions.3. Log everything to a file on another drive.

author: rdl
author_rank: Super Contributor
timestamp: October 22, 2020, 02:53:19 pm
content: Years ago I had the drive start going bad on an XP system with write failures. Copied the whole 150GB drive right away. Examining after the fact, I realized less than 4 GB of the 100+ that I copied was actually irreplaceable data. OS, software, drivers, etc. can usually be reinstalled easily though it is time consuming. Data, particularly that which you have created yourself, is what to go after first.

author: bostonman
author_rank: Super Contributor
timestamp: October 23, 2020, 12:58:24 pm
content: I'm using ddrescue now and it seems to work quite well - I can see why this was recommended.This is the format I used: ddrescue -d -r3 /dev/sda test.img test.logfile (except I changed -r3 to -r10 in hopes it would eventually get all the data without errors).I began last night, and approximately ten-hours later it's still going. The status looks quite promising because it shows 99.99% and 120.xxGB (the drive is 120GB) has been recovered.The drive has been making lots of noises and crunching, but being able to copy this image to a new drive will be nice. I'm uncertain how long a 'retry' (i.e. the -r value) takes to completed before it moves onto another retry attempt; so far it's on #8.If it doesn't finish soon and I use CTRL C to exit, will the image file remain or will it be corrupt from aborting?

author: bostonman
author_rank: Super Contributor
timestamp: October 23, 2020, 02:57:58 pm
content: Skip my last question. It ran through all ten retries and finished.I'll try writing the image to another drive later, but I'm guessing at 99.99% of successful retrieved data that any lost info will not affect anything.As for the hard drive and bad sectors, I have a few questions. First off, I understand a hard drive can fail in many ways (i.e. the motor not spinning, the electronics, the head, coil, etc...). In this case, and other cases I've experienced, the hard drive is usually accessible but periodically makes odd noises.My understanding is a bad sector is corrupt data, but why does that cause the head (?) to make odd noises? In this case, the hard drive made the same clicking sounds, but it always make the same type of grinding noise.Also, if a sector is bad, why would that not cause every track within that sector to be bad?

author: magic
author_rank: Super Contributor
timestamp: October 23, 2020, 05:51:33 pm
content: My go to method (on Linux) is as simple asCode:losetup -r /dev/loop0 /dev/sdb1mount /dev/loop0 /mnt/sdb1cp -a /mnt/sdb1/whatever /mnt/sdc1 2>&1 |tee errorsThe first line sets up a strictly read-only layer over the original device, protecting it from all writes that could cause further corruption, including filesystem journal replay.Then I just copy any files I care about to another disk.Then I review the error log to see if anything is missing and try more desperate measures.Much better than1. wasting time to copy junk I don't need2. retrying 10 times reads of space which may actually be empty or used by the trash can3. having blocks of zeros written into files where bad blocks were4. not easily knowing which files are affected by 3

author: bostonman
author_rank: Super Contributor
timestamp: October 24, 2020, 01:23:00 pm
content: QuoteUnfortunately I need to clone the drive. I was relatively successful creating an image, but, I used a 120GB SSD to create a new drive from the image, and, as the website with the ddrescue instruction stated, I should have used a larger drive.At the last minute (after about two-hours), ddrescue aborted and stated I didn't have enough drive space.I hate to waste money buying a bigger drive for an old laptop I seldom use. Does a ddrescue command exist that will copy only used sectors thus making the image file smaller than the original 120GB drive?

author: Monkeh
author_rank: Super Contributor
timestamp: October 24, 2020, 01:50:53 pm
content: Quote from: bostonman on October 24, 2020, 01:23:00 pmNo, but if you take the image to another drive first you can shrink the filesystems and alter the partition table so it will fit.

author: magic
author_rank: Super Contributor
timestamp: October 24, 2020, 06:41:18 pm
content: Ah, so you want to transfer a Windows XP installation? That's gonna be harder.Monkeh's suggestion to use a larger temporary disk is the simplest way. If not,maybeit would be possible to surgically build the new installation from pieces of the old - transfer the MBR, fix it to fit the smaller disk, transfer the first few megs of the NTFS partition, run chkdsk, transfer the files. But that sounds like a "fun" project. Or just format an empty NTFS volume, populate with files and carefullyddthe old boot code into appropriate locations (the offsets are well known, I believe). Would that work? Maybe...FYI, I have successfully resized and moved (to a different location on the same HDD) Windows XP partitions in the past, using gparted.BTW, is it NTFS or FAT32?

author: Mechatrommer
author_rank: Super Contributor
timestamp: October 25, 2020, 03:57:30 am
content: Quote from: magic on October 24, 2020, 06:41:18 pmwhy is that hard? yes its hard if you dont have installation CD at hand (no more downloadable installation files in website thats why keeping WinXP install archive and backup is one of my (priority) job). and changing/moving/resizing WinXP boot partition was my playground. i used old Partition Magic but it became highly incompatible today, luckily i got replacement. Windows Disk Manager + AOMEI Backupper can do the job that i usually did in Partition Magic.Quote from: bostonman on October 24, 2020, 01:23:00 pmmaybe you dont have too much files to care about. we know backup is essential so we tend to keep some extra drives to do the backup/recovery work. HDD are cheap today, even SSD is going in the direction. 500GB SSD is reaching $100 now, wonderful time! having some experience in recovery job, we are more willing to waste a little bit money to avoid wasting alot of time and frustration. and if you do enough recovery and playing with recovered data, you'll know what exactly what magic means in reply #9. i saw you wanted to recovery a HDD in your earlier thread so good luck, cheers.

author: ve7xen
author_rank: Super Contributor
timestamp: October 26, 2020, 06:36:58 pm
content: Quote from: magic on October 23, 2020, 05:51:33 pmIf you have a failing disk, this will almost certainly not work well for you, despite not even creating an image as was requested. You'll get stuck in retry loops with long timeouts in the OS, putting stress on the drive and bad sectors, and sometimes this will cause bus resets and other nastiness. You might get lucky and the bad blocks don't affect any files/metadata and it copies cleanly, but if the bad blocks affect the filesystem at all, you will likely have a hard time getting the process to proceed past the read errors. Most tools assume the disk is good and will have this problem, which is why you need ddrescue.As far as 3: in most cases you would rather have 0s written to bad blocks in the file, than for the copy to completely fail, at least some data may be recoverable. Identifying the bad files can be tricky, but there are ways to do it from the block list, at least.If you have a fully working disk you need to image, you can use partimage or ntfsclone to avoid copying empty blocks if you want. In a recovery scenario, getting an (possibly partial) image ASAP is best practice - this is what ddrescue does, skipping bad/slow blocks on the first pass to read as much as possible before getting aggressive. Later you can work with the ddrescue log/mapfile to try to be more aggressive about bad blocks if you want but at least you'll know most of your data were saved. Unless the disk is very empty of actual data, it'll probably be significantly faster than waiting the endless retries the OS will normally do with a file copy, if you don't get frustrated and give up when it completely stops making progress.

author: magic
author_rank: Super Contributor
timestamp: October 26, 2020, 08:15:46 pm
content: Maybe my failing disks weren't failing enough, but it worked for me a few times.When bad blocks affect filesystem metadata, files are not recoverable anyway. If you are truly desperate enough to use something like photorec, maybe then a ddrescue image could help. I'm glad I have never been there.The behavior when running cp may depend on exact filesystem driver, but I haven't experienced excessive retries. As for cp itself, it simply skips files and directories which return errors and moves on.I have not yet encountered a case when re-reading a sector which returned UNC once would return anything but UNC ever again, unless it's overwritten with new data.

author: bostonman
author_rank: Super Contributor
timestamp: October 27, 2020, 12:42:26 am
content: Why do bad blocks or whatever cause the hard drive to make odd noises?Or do the odd noises cause bad blocks?

author: Mechatrommer
author_rank: Super Contributor
timestamp: October 27, 2020, 09:23:11 am
content: Quote from: bostonman on October 27, 2020, 12:42:26 amlost wedges...http://home.npru.ac.th/piya/Document_KMUTNB/Lec06.pdf

author: bostonman
author_rank: Super Contributor
timestamp: October 28, 2020, 12:36:22 am
content: The PDF doesn't work

author: golden_labels
author_rank: Super Contributor
timestamp: October 28, 2020, 03:27:56 am
content: bostonman:A copy at Web Archive

author: Doctorandus_P
author_rank: Super Contributor
timestamp: November 06, 2020, 03:09:19 pm
content: Quote from: bostonman on October 24, 2020, 01:23:00 pmSo even after you have failing hardware you are too cheap to invest USD50 into any sort of backup?You pretty much deserve what you get.

author: bostonman
author_rank: Super Contributor
timestamp: November 06, 2020, 03:44:44 pm
content: QuoteHow can I be too cheap?I'm investing money in a laptop I seldom use and is outdated. My point is: why buy a hard drive three times bigger when I use 1/5th of the current 120GB? Then if something happens and I need to replace this drive, I'll need a 500GB drive because a 320 to a 320 will not work.This site, and the advice of others, along with the progress of knowledge, isn't to insult whether someone should or shouldn't invest (according to you) $50. The quest for knowledge lies in learning why a 120 can't be imaged to a 120.

author: Monkeh
author_rank: Super Contributor
timestamp: November 08, 2020, 06:09:39 pm
content: Quote from: bostonman on November 06, 2020, 03:44:44 pmThere is no problem cloning to a drive of equal size. The issue is that not all drives with the same headline are actually the same size. It is not hard to adjust an image to fit.

author: Doctorandus_P
author_rank: Super Contributor
timestamp: November 11, 2020, 03:55:06 pm
content: I somehow misinterpreted your original post, which made my answer inappropriateQuote from: bostonman on November 06, 2020, 03:44:44 pm.I agree with Monkey, Those gross overall sizes are no real size of HDD's or SSD's."Sectors" have not been real "sectors" for over 20 years, and SSD's do not even have anything resembling a "sector". It's just a naming convention left over from ages past.On top of that. There is not much knowledge to gain (for mortals) in trying to understand each and every detail of a failing drive.Personally I would mount the drive read-only, or make a backup image of it on a (much) bigger drive, and use the opportunity to install a clean OS on the affected laptop, then re-install the programs I would need and only attempt to rescue important data from the failing HDD (or the image made from it).It's one of the joys of using Linux and open source software exclusively.Linux installs in about 15 minutes on a SSD, (just as windoze apparently, (haven't used it in years)), but on top of that. Nearly all programs can be installed from the command line in less time then you need to start a web browser, to to some external site and download an install program. There is also no messin' with installation keys and licenses.And again: My apologies for the presumed insult, that was never my intention.

author: bostonman
author_rank: Super Contributor
timestamp: December 14, 2020, 01:12:47 am
content: QuoteI never got notified a reply was sent, so I didn't know you responded. I appreciate your apology and it was actually more than needed. Apparently we both just misinterpreted the intent of each other.Initially I re-read my post because I wanted to make sure I didn't come off as wording it incorrectly. More often than not, us Engineers (if that's what I am) rather take the hard road in order to gain knowledge. Unfortunately we live in a throw-away world and more people are tossing electronics than trying to preserve them therefore the power of knowledge seems to be a dying field.This site is quite informative and so far just about every question (probably all) have been answered in a timely fashion. It's because of this site, and others, that I see the power of knowledge continuing to advance.