0

I've got a crash and the system won't boot correctly. I am getting errors like:

ata3.00: status: { DRDY }
ata3.00: status: { UNC }

What would be the best way to save the main drive to make the system boot again?

I am looking at: Using DD for disk cloning

I read that using DD to clone a live system is bad. But does booting in via KVM mean just as bad?

1 Answers1

3

You don't want to do a block level copy of a drive when any of the filesystems are mounted (which also means that you can't be running the OS installed on the drive). Either boot a live CD/USB (I like RIPLinux) or connect the drive to another machine.

In terms of getting data off a dodgy drive, rather use ddrescue (the GNU version, sometimes called gddrescue). It won't stop as soon as it encounters a bad sector like dd will, and can resume copies. Make sure to specify a log file:

ddrescue /dev/sda /mnt/sdb1/sda.img /mnt/sdb1/sda.log
mgorven
  • 30,036
  • 7
  • 76
  • 121
  • Is using KVM considered being mounted to the filesystems of the main drive? doesn't this CL run DD even if it does get errors? dd if=/dev/sda of=/dev/sdb bs=32M conv=noerror,sync – Thompson Smith Oct 25 '12 at 21:53
  • @ThompsonSmith Depends how you are using KVM. If KVM is booting off an OS stored on the bad drive then that's still a problem. `noerror` will make it continue, but `ddrescue` is still better for this. – mgorven Oct 25 '12 at 21:55
  • So KVM Would need to boot off a disk with a fresh OS Install? Isn't DDRescue a lot slower? I've used it once. I know data centers typically use DD. Does it depend more on the state of the drive? – Thompson Smith Oct 25 '12 at 22:00
  • @ThompsonSmith: ddrescue will go back and retry blocks that fail on the first try, so it's much better than dd for cloning flaky drives. (This also makes it slower, precisely because it doesn't just give up right away on errors.) – Gordon Davisson Oct 26 '12 at 01:31