Switch to full style
Data recovery and disk repair questions and discussions related to old-fashioned SATA, SAS, SCSI, IDE, MFM hard drives - any type of storage device that has moving parts
Post a reply

Procedures for cloning SATA and PATA hard drives

October 8th, 2007, 22:52

The present article describes procedures for cloning hard drives (low-level copying of hard drives).

The software-hardware realization of a hard drive cloning suite must comply with the following requirements: the suite shall be capable of effecting the low-level copying in all modes (PIO, DMA - Direct Memory Access) at the fastest data transfer rate (UDMA4) while directly accessing the hard drive (without using the BIOS functions) and allow controlling the hard drive’s power supply throughout the cloning process.

The requirement to use the UDMA4 mode (2-3 Gb/min) is based on the following:
- when cloning hard drives it is always good to be able to control the process in real time so you could determine the nature of the hard drive’s surface defects and choose the most efficient copying mode;
- modern hard drives have ever increasing volumes, and thus cloning times have to be reduced to save time for analyzing the logical structure of the hard drive’s data or for performing other tasks;
- using a combination of PIO and DMA modes allows for complex reading of sectors at various access rates;
- copying at high speeds allows to clone hard drives with temporary (intermittent) anomalies, such as fast warm-up and failure (switch and magnetic-head assembly malfunction), fast warm-up and failure (spindle gets wedged).

The requirement to operate in the direct hard drive access mode is called for by the fact that this mode allows to employ additional methods for extracting data from hard drives using the ATA13 calls.

Switching the hard drive’s power supply on and off during the copying process makes it possible to counteract its hanging on defects when software reset calls are ineffective.

Let’s consider in more details the hard drive cloning procedures:

1.Cloning trouble-free hard drives (drives with no defects in the user data or system data areas).
· Choosing a hard drive to receive the cloned hard drive’s data.
The copying speed depends on the speed of reading the data from the source drive and on the write speed of the destination drive. Thus, it is advisable to use PATA drives capable of the UDMA133 (Maxtor) or SATA drives for saving the cloned data. SATA and SATA2 interfaces have rated speeds of 150 Mb/sec and 3 Gb/sec correspondingly, but the actual data transfer rate is determined by the speed of reading the data from the hard drive’s surface and therefore is close to 150 Mb/sec. The maximum achievable data transfer rate in the UDMA133 mode may be calculated by taking the read speed of 133 Mb/sec, and, since the IDE interface is serial, dividing it by two to get the read-write speed of 66 Mb/sec or 3960 Mb/min = 3.9 Gb/min.

· Choosing the motherboard and cables
Different chipsets use different memory organization schemes and have different temporal data transfer parameters, therefore cloning speeds will differ even under the same cloning settings.

The following cloning speeds were achieved when using the Dublicator
(Maxtor DiamondMax Plus 8 as the source hard drive and Maxtor DiamondMax Plus 8 40Gb ATA/133 as the destination hard drive):
for the SiS655 chipset 900-1200 Mb/min
for the i865PE chipset 1900-2300 Mb/min
for the NVIDIA nForce2 Ultra 400 chipset 2200-2300 Mb/min

(Seagate Barracuda 7200.7 as the source hard drive and Seagate Barracuda 7200.7 120Gb SATA as the destination hard drive):
for the SiS655 chipset 1200-1400 Mb/min
for the i865PE chipset 2100-2300 Mb/min
for the NVIDIA nForce2 Ultra 400 chipset 2300-2400 Mb/min

The top transfer rate when using a cable with 40 conductors is Ultra DMA 33, i.e. 33 Mb/sec. With an 80-conductors cable the Ultra DMA 66, Ultra DMA 100 and Ultra DMA 133 data transfer rates are also supported. SATA cables of equal length have essentially identical DTR characteristics.

2.Cloning hard drives with defects in the user data area
In most cases when data is recovered from hard drives in the process of their cloning, one encounters defects in the user data area. The ATA13 standard describes such defects as UNC, AMNF, IDNF, and ABRT.

Every such defect is characterized by a different hard drive behavior.
UNC – checksum calculated based on the data read from the hard drive is inconsistent with the checksum recorded in the hard drive’s sector during the write operation. Such defect are quite simple, usually they do not cause hanging of the source hard drive when encountered.
AMNF – this error usually means a partially destroyed physical format and often results in the hard drive being hung.
IDNF – this error is reported when the physical format is absent or destroyed, and it may be accompanied by the source hard drive’s hanging.
ABRT – destruction of the system tag, may result in the source hard drive being hung.

Let’s consider various cloning methods.
a) Cloning with skips – choosing the skip distance, forward copying, reverse copying, copying while ignoring UNC defects.
The actual speed of hard drive cloning is determined by the amount of defects it contains, the hard drive’s volume, and the speed of its reading. Assuming the sectors with defects do not contain any information significant for recovery (and further we shall discuss extracting data from sectors with UNC-type defects) the main task when cloning is to determine the type of defect, locate groups of defects, and read sectors without defects. In the most simple case this is achieved through effecting copying in the DMA mode until the first defect is encountered, then switching to the PIO mode and rereading the disk. If the defect is encountered again, a predetermined number of sectors is skipped and reading is resumed. If successful, sectors are then read in the DMA mode in reverse, from the current sector towards the last encountered defect. Upon encountering a defect reading is resumed from the first sector after the skipped ones. If, following a skip, a sector can not be read, the skip is repeated. This method for locating groups of defects is called skip and return. It permits to clone variously affected hard drives with just the skip distance parameter to adjust.

This method even allows to clone some hard drives with one or a few heads malfunctioning.

Image

The drawback of this method is that when effecting long skips to locate defects it is possible to land in a group of sector defects without read errors.

This problem is resolved by rereading the sectors with defects after setting the skip distance to a value close to the size of 1 sector. There are also other, more efficient methods, that automatically determine the skip distance.

Correct data can be extracted from sectors with UNC-type defects on hard drives that support the ATA13 system of calls. This is realized through the use of the Read-Long command and statistical accumulation of the read results.

Reverse copying. The most heavily used area of a hard drive is the user data area at the disk’s beginning, and thus it is the most likely area to have defects. In case a hard drive is heavily damaged copying it in reverse starting from the last sectors allows to locate the area of sectors with defects more efficiently.

b) Power switch-assisted cloning .
The method described above is suitable for 99% of the hard drives, and the remaining 1% are hard drives that go out of the ready state while in the process of being copied. Readiness may be lost upon encountering sectors with defects, due to an abnormal operation of a hard drive while being copied (overheating, rattling, wedging of the spindle, and consequent loss of the required rotation speed of the hard drive’s disk, etc.).

Generally using soft-reset of the hard drive in such cases doesn’t help. Toggling the hard drive’s power on and off is realized when a time limit set for responding to commands given to the hard drive is exceeded (the hard drive is not ready to receive the next command).

c) Cloning SATA hard drives.
A particular feature of hard drives of this type is the motherboard’s controller hanging upon encountering certain defects (especially well-known to be prone to this problem are the Seagate hard drives, e.g. ST3120026AS Barracuda 7200.7). Soft reset and toggling the hard drive’s power do not help in this case, only rebooting the computer will do. This problem is resolved through using a SATA-PATA adapter.

Pilotech Systems PS421 controller (PS421) developed for connecting parallel ATA hard drives (ATA100, ATA133) to a serial ATA interface, and vice versa, SATA hard drives to a PATA (parallel) interface, is well-acclaimed for this purpose.


Features of the Pilotech Systems PS421 adapter:
- compatible with the Serial ATA 1.0 specifications
- Supports Serial ATA devices with volume exceeding 137 Gb
- Supports Serial ATA devices with transfer rates of up to 1.5 Gb/sec.

3.Cloning hard drives with defects in both the system and the user data areas.
One of the prerequisites for cloning a hard drive without using any vendor commands is being able to read its descriptor in accordance with the ATA13 standard and absence of problems with reading modules in the system area of the hard drive.

But cloning is also possible for hard drives that have defects in the system area, or even when the descriptor can not be read.

Let us consider possible options for creating a sector-by-sector copy of a hard drive, starting with the most simple cases and progressing towards the more complicated ones.

a) Defects of Smart modules and of other hard drive initialization modules, setting up the UDMA channel of the motherboard.

Reading Smart modules containing information on previous instances the hard drive was switched on and on its current state is a particular feature of modern motherboards. In the process of operating the hard drive’s controller these modules are read from and written to most actively. Due to hardware malfunctions, external action and intensive use of the magnetic surface at the position of these modules they often get damaged. In such cases motherboard’s initialization of a hard drive results in long delays or complete hanging of the computer. Making the cloning application directly access the hard drive’s ports should allow copying such a hard drive even without it being recognized by the motherboard’s BIOS (the hard drive needs to be connected after the OS is loaded, but before the cloning application is launched), but with modern motherboards this way of connecting hard drives does not allow to copy anything at all or the copying is realized at a drastically reduced speed.

Why does it happen? It turns out that the motherboard in the absence of a hard drive may stop using the IDE channel completely or reset it to a lower default read-write speed that is considerably below capabilities of the hard drive being copied.

To bypass this problem one needs to plug into the system another hard drive with similar read-write rates for the time the motherboard and hard drive are initialized, then swapping it for the hard drive that needs to be cloned.

b) Defects of other system modules; using the Hot Swap method.
Destruction of the system area structure or data results in the hard drive stopping to return its descriptor upon receiving the ECh command (ATA13). In such a case to create a sector-by-sector copy of a hard drive it is necessary to recover the system area or use the hot swap method.

The hot swap method amounts to the following:
- Prior to creating a clone of the damaged hard drive (with damaged system area) connect a properly functioning identical hard drive (model, firmware, etc. have to match) in its place.
- If at all possible, the substitute hard drive’s system modules have to be replaced with those read from the source hard drive.
- Further, the hard drive is initialized through software and then its motor is stopped. At this time all system modules that get loaded from the hard drive are stored in the memory of the hard drive’s controller.
- After this unplug the controller, without powering it off, from the substitute hard drive, and plug it into the hard drive to be cloned. A command is given to start the hard drive’s motor and the source hard drive gets initialized.
- Proceed to clone the hard drive.

This method has a number of limitations, the most important of these being that the logical data structure may be destroyed in case the substitute hard drive’s translators do not match with those of the source hard drive.

However, in such a case it is possible to recover individual files based on their signatures (e.g.: jpg, doc, xls, etc.)

4.Cloning hard drives with particular problems.
a) Spindle wedging, loss of one phase (cooling, externally stimulated spinning)
Such problems as the spindle being wedged or spindle shimming are quite common for hard drives. The malfunction results in the spinning speed bouncing or the drive being unable to reach it nominal spinning rate (this is a characteristic feature of the 2.5” hard drives).

The cloning method to be used in this case is as follows:
- If the hard drive becomes ready, reports its descriptor, but hangs a certain period after the copying process starts, it is useful to try to perform the cloning with an external cooling applied to the hard drive (e.g.: putting the hard drive between two rubber hot-water bags full of ice). This results in the gaps in the bearing between the parts that rub against each other becoming wider and the shimming effect disappears.
- If the hard drive does not reach the ready state and continues to attempt to achieve its rated speed it is necessary to apply external spinning force.

The principle of this operation resembles how a car’s clutch gear functions, and even an electric drill with a rubber cylinder in place of its bit may be used to transfer the external spinning force to the hard drive’s spindle.

Upon reaching the rated spinning speed and its being stabilized by the hard drive’s controller, the external spinning is disengaged by lifting the rubber cylinder off the hard drive’s spindle.

b) Rattling of the spindle (cooling, externally applied vibration or jiggling)
In some cases the hard drive’s malfunctioning results in and uneven copying speed, its dependence on the special orientation of the hard drive (placing the hard drive on its side, at an angle to the force of gravity). Such malfunctioning results from the spindle’s excessive rattling due to its bearing being damaged or in case the disks are off-centered due to an external stress resulting in an increased time for positioning the hard drive’s heads.

To resolve this problem it is necessary to apply external cooling or a light vibrating action.

This can be done with a simple mechanism consisting of a power supply fan or a processor fan with a blade broken off that is fixed to the hard drive’s casing.

c) Applying heat.
In some cases it is necessary to recover information from hard drives that were overheated prior to their failure. Copying data from such hard drives often is successful only after they are preheated.
Post a reply