using "dd" to rescue a system with a failing drive

From john-at-johnmeister.com/linux  Thu Oct 10 09:32:40 2013
Date: Thu, 10 Oct 2013 09:32:33 -0700 (PDT)
Subject: rescue in process...

HOW TO RESCUE A MICROSOFT (or any computer) SYSTEM with a FAILED
or FAILING DRIVE using Linux and the "dd" command:  (see additional notes below)

1) pull dead drive from failed Microsoft system
2) place in freezer  (at least an hour or two)
3) insert into BlacXduet dual sata USB gizmo  (or related SATA connectors so both are attached to a Linux system)
4) attach to Linux system
5) su -    # (become root user)
6) script copy-w-dd-10oct2013.raw    
	(use "script" to document and record steps, when finished type exit ; cat copy-w-dd-10oct2013.raw | col -b > copy-w-dd-10oct2013.txt )
7) fdisk -l
8)dd if=/dev/sda of=/dev/sdb  (NOTE, very, important, get the devices correct!!!)

real world extract fdisk (excluding root drives):
Disk /dev/sdc: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00051c12

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1           16065   102398309    51191122+   f  W95 Ext'd (LBA)
/dev/sdc2   *   102398310  1953520064   925560877+   7  HPFS/NTFS/exFAT
/dev/sdc5           16128   102398309    51191091    7  HPFS/NTFS/exFAT

Disk /dev/sdd: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0004b263

   Device Boot      Start         End      Blocks   Id  System
/dev/sdd1   *        2048  1949333503   974665728   83  Linux
/dev/sdd2      1949335550  1953523711     2094081    5  Extended
/dev/sdd5      1949335552  1953523711     2094080   82  Linux swap / Solaris

------------------------------------------------
root@LOVING-LINUX -root- [/root]
------------------------------------------------
--> echo "dd if=/dev/sdc of=/dev/sdd"
dd if=/dev/sdc of=/dev/sdd
------------------------------------------------
root@LOVING-LINUX -root- [/root]
------------------------------------------------
--> dd if=/dev/sdc of=/dev/sdd
------------------------------------------------
dd: reading `/dev/sdc': Input/output error
43184776+0 records in
43184776+0 records out
22110605312 bytes (22 GB) copied, 4404.01 s, 5.0 MB/s

------------------------------------------------
--> fdisk -l
------------------------------------------------
Disk /dev/sdc: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00051c12

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1           16065   102398309    51191122+   f  W95 Ext'd (LBA)
/dev/sdc2   *   102398310  1953520064   925560877+   7  HPFS/NTFS/exFAT
/dev/sdc5           16128   102398309    51191091    7  HPFS/NTFS/exFAT

Disk /dev/sdd: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00051c12

   Device Boot      Start         End      Blocks   Id  System
/dev/sdd1           16065   102398309    51191122+   f  W95 Ext'd (LBA)
/dev/sdd2   *   102398310  1953520064   925560877+   7  HPFS/NTFS/exFAT
/dev/sdd5           16128   102398309    51191091    7  HPFS/NTFS/exFAT

------------------------------------------------




9) note that I use the "echo" command often, this places the text into a clear field in my "script" file.
10)  this process will run for HOURS, maybe days... dd copies files block by block from one 1TB drive to another...
11)  The frozen drive is WORKING on Linux... but I didn't even attempt to try it on Microsoft... 
it'll only corrupt the File Allocation Table (FAT).
12) Lord willing and the penguins cooperative, I will have a perfect bootable copy of my XP system on 
/dev/sdd when this is done... the lights are blinking... aiming a fan at the dying drive, opening a 
window and heading off to support the next IT crisis... :)

rescuing a Microsoft Windows XP (or any version) machine with a failed hard drive...

the hard drive is failed and unreadable to any Microsoft system... after it's been frozen it may work 
for a few hours afterwards... but it will be unreliable, do NOT waste time... get it copied ASAP... 
copying from one windows system to another will NOT work properly as there are locked files, 
corruption will occur...   this technique may require a fix with the install media, and if this were Win7 
you'll likely need to re-register the cursed operating system because it'll see the difference in the hardware, 
even if you use the same brand hard drive... it likely records the drive serial number... if you can find it 
in the registry you may be able to fix it... but some of this stuff is in the security module and not 
editable... sneaky buggers there in redmond... think they'd expend some of that creativity to maintain 
legacy features that actually work for the power users...

Anyway... my Windows XP system is on the path to recovery... here's the steps involved... even if there is 
a power failure or errant human interaction, the dead drive can possibly be refrozen and this attempted again.  
the Linux dd command does NOT corrupt the "if" or input file, it copies it to the "of" our output file.  
This will even work on encrypted drives.  It's not reading anything, it's copying block by block at the lowest level.

    -----
----------------------------------------------------------------------------
         -o|||||o-            Linux: the choice of a GNU generation
       Snohomish, WA- where Jeeps don't rust, they mold
----------------------------------------------------------------------------








Simply Linux: Basics  Full Size Jeep Buyer's Guide Using BASH on Windows 10
Practical Suggestions for Microsoft Windows
Linux Tackles Microsoft
12 hour Video Course by john:
The Art of Linux System Administration
published by O'Reilly Media
Study Guide for the LPIC-2 Certification Exams
search for:
on the internet, or:
JohnMeister.com-fotos
LinuxMeister-Linux
BibleTech- Bible overview

overview of mankind's history
Biblical history:
"Promises and Prophets"

Wagoneers

FULL SIZE JEEPS

JeepMeister
"Jeep is America's
only real sports car."
-Enzo Ferrari


MeisterTech
Diesels +

One Page Overview of Linux Commands

click for an image of the 5 essential Linux commands

An Intro to Linux
AMSOIL product guide,
or, AMSOIL web, or 1-800-956-5695,
use customer #283461

Amsoil dealer since 1983
purchase AMSOIL
at Midway Auto on SR9 in Snohomish,
or at Northland Diesel in Bellingham, WA


SJ - 1962-1991

XJ - 1984-2001

WJ - 1999-2004

KJ - 2002-2007

WK - 2005-2010

Find the recommended
AMSOIL synthetics
for your Jeep

CJ-10A - 1984-1986

Jeepsters

MJ - 1984-1992

Willys - 1946-1965

Other Jeeps (FC)