hdd recovery: can I speed up dd?

hdd recovery: can I speed up dd?

I am currently trying to recover a hard drive I accidentally formatted, but am of course, using dd if=/dev/sdb of=/dev/sdc conv=noerror,sync to make a backup to work on first. I have two questions, actually.

  1. dd is sloooooooowwwwww. My partition table and file system are damaged from the accidental format, if I use a larger block size via -bs option, would this somehow affect the drive geometry of the copy?

  2. Since it's bit to bit and I'm only working with the partition table/file system which are at the start of the drive; if I need to re-copy the original drive to the backup, can't I just abort dd after the first few MBs, since the rest of the drive should remain unchanged?

I'm hoping one of these is a yes, otherwise I've got about ten hours to go.

答案1

If you need to backup just the partition table & MBR then use:

dd if=/dev/SOURCE of=/my/path/to/MBR_BACKUP bs=512 count=1

Alternatively use sfdisk:

sfdisk -d /dev/SOURCE > /my/path/to/MBR_BACKUP

Then to restore:

sfdisk /dev/DEST < /my/path/to/MBR_BACKUP

All of the above will be very quick.

To image your entire hard drive, I'd suggest you set the BS to half the size of the drives cache, for example with Seagate 1TB drives w/ 64mb cache I use bs=32M. It'll speeds things up.

答案2

dd is a very small, very efficient program and the slowness is probably from the read/write delay on your hard drives. In short: dd is as fast as your system allows it to be. You could try using a larger bs and this question is answered on the Unix and Linux Stack Exchange site.

The MBR and partition table are just the first 512 bytes, so it shouldn't take long for you to copy that, but I don't see the point of making a backup of a corrupted partition table. Let dd take its time making a backup of your hard drive, but then what you will need to do is try to recover information on the location of your partitions on the hard drive so that you can re-create the partition table. There is software that will do this for you.

Check out these links for more info:

http://www.pixelbeat.org/docs/disk/
http://www.diskinternals.com/partition-recovery/
http://www.dedoimedo.com/computers/linux-data-recovery.html

相关内容