On Tue, Feb 28, 2017 at 4:31 PM, Stevens <fred-n-sandy@myrhinomail.com> wrote:
On 02/28/2017 03:20 PM, Wols Lists wrote:
On 28/02/17 20:59, Stevens wrote:
On 02/28/2017 02:37 PM, Felix Miata wrote:
Greg Freemyer composed on 2017-02-28 15:24 (UTC-0500):
Yes, that will work as long as you run it as root, but if it's that old, you might have a bad sector or two.
At a minimum use this:
dd if=/dev/sdb of=[whatever] bs=512 conv=noerror,sync
bs=512 will slow things down, but make sure that if you have an error, only the truly bad sectors will be lost. A sector is 512 bytes and they are either good or bad.
noerror says not to stop just because you hit a failed sector
sync says that if you have a bad sector, fill that part of your backup with zeros.
Any reason not to use dd_rescue instead of dd in the first place?
My being totally unfamiliar with dd_rescue probably enters into it.
As far as I am aware, basic ddrescue syntax is identical to dd.
HOWEVER. If you have problems with dd it will leave you up a gum tree. Especially if copying something like a disk drive.
The classic problem with dd aiui, is that if it fails to read, lets say, sector 10 on your old drive, it simply skips that when writing to the new drive, so the old sector 11 becomes the new sector 10. Cue everything after your failed read being scrambled. That's why the default is to abort after a failed read!
Just use ddrescue as if it were dd, and (a) your chances of a successful copy are a lot higher - it has loads of tricks for dealing with dodgy reads, and (b) the copy you end up with will be as perfect as possible - holes where there were failed reads etc.
It will also give you a log of any failed reads if you ask it, so you can (if your fu is good enough) work out what files have been damaged. Hopefully, on the raid list we will soon have a script that will take that log and force soft read failures on the new drive where there was a hard failure on the old one. That will cause any attempt to read a corrupt file to bomb.
Cheers, Wol
Wol - Greg said that the sync option puts zeros where there was a bad sector. Is that not the same as what you are saying about dd_rescue's action? I mean, it would seem to maintain the sector count. I do not know, I have not used either.
Fred, With the command I gave, the fundamental difference is dd always starts at the beginning (or whatever offset you provide) and linearly works to get to the end. It definitely only makes one linear pass at all the data(sectors) you've requested. dd_rescue and ddrescue are both designed to work with dieing disks. I forget which is which, but one of them at least when it hits a bad block will jump ahead and leave a gap, Then when it finishes the first pass (including gaps), it comes back and tries to get all the missing pieces. It can make 5 or 10 passes (or more) trying to get a complete copy. The log is used to keep track of what it still needs to get, so you keep passing the same log file to it every time you call it for the same disk. One of them comes with a batch script to automate the process. I don't use that one; I prefer to control what it is doing myself. If you give either the right arguments, they will even fill in the missing pieces by reading the sectors backwards. They really are great tools, but at least in my mind they both have a lot of complex feature set. As I said, I reserve them both for seriously problematic drives such as one having had a head crash, not ones with just a few bad sectors. Think about a drive with several large contiguous sections of bad sectors. dd will not handle that well. I've been working seriously with client disks for 10 years and I doubt if I've had to invoke either ddrescue or dd_rescue more than a dozen times combined. One big reason for that is that if a disk is in that bad of shape, I send it out to a professional recovery lab most of the time. Having ddrescue beat a disk to death can just make the situation worse. If the head is banging into the platter, it is much better to have a real lab swap out the bad components and do the recovery the right way. But real labs charge real money to do that (~$1.5K to attempt a recovery of drive with serious physical problems, sometimes more). Note: I started my own company 4 years ago. Since then I "imaged" (via dd or similar) hundreds of drives, maybe a thousand. I have not had to send a single drive out for recovery and I doubt I've had to use ddrescue/dd_rescue more than once or twice. Note 2: I don't actually use dd most of the time. I use dc3dd or ewfacquire, but both of them only do a linear sector read like dd does. The advantage is they record extra metadata that helps with confirming the image (copy) hasn't become corrupt over time. Greg -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org