You can also use TestDisk to help analyze the sectors copied from a hard drive with physical problems onto a good drive. If there are bad sector on your hard disk, you need another disk to copy the data ont it. The new disk can be bigger, it's usually not a problem because the number of heads per cylinder and sectors per head will be the same if both disk use LBA mode.
Under Linux,
Primary master IDE disk device is /dev/hda
Primary slave IDE device is /dev/hdb
Secondary master IDE device is /dev/hdc and so on.
SATA HD device filename begin usually at /dev/hde
SCSI device filename begin at /dev/sda
To list the partition of a disk, log in as root and run fdisk -l device
Once you have verify what is the old disk and the old one,
in a command shell or terminal, run
dd if=/dev/old_disk of=/dev/new_disk conv=noerror,sync or
dd if=/dev/old_disk of=disk_image conv=noerror to copy the data. To speedup
the copy, you can append bs=8k, it will read the disk 16 by 16 sectors.
If possible, use dd_rescue instead of dd.
If needed, download the
Knoppix, a Linux bootable CD.
Warning: If you use TestDisk to recover lost partitions on a target hard drive by connecting the drive to a computer other than the one it was originally partitioned and formatted on, you risk the chance of having incorrect data about the drive passed along to TestDisk from the BIOS of this other computer. BIOS chips have at least two different ways of translating disk geometry, and using the wrong data may make it impossible for TestDisk to correctly recover a drive's lost partitions; or worse, you may write the wrong data to the drive's MBR, boot up the disk and then incorrectly write data to the disk leading to further corruption and loss of data. ( This may not apply to all file systems.) TestDisk try to detect this problem.
TestDisk can work on disk image. The disk image must be avaible under hdimage name in the working directory or given in parameter. Files are limited in size by OS and filesystem: 2Gb (FAT16), 4Gb (FAT32), 16GB (EXT2/3 with 1kb block), 256GB (EXT2/3 with 2kb block), 2048GB (EXT2/EXT3 with 4kb block)
When TestDisk is executed, you may see the phrase "Please wait..." on your screen until it has gathered enough data from the BIOS or OS to list the disk drives on the system.
If the reported size don't match the harddisk size, ie. a 120Gb harddisk is recognized as a 32Gb harddisk, check your BIOS harddisk settings and jumpers on your harddisk. On most big harddisk, there are jumpers to limit the size to 32 or 8 Gb.
Note: TestDisk appends new information to testdisk.log; it does not overwrite an existing file.
Return to TestDisk main page