Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

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
share|improve this answer
    
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 1:31
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.