On 2014-07-04 23:37, David C. Rankin wrote:
All,
I have had a few bad blocks show up on my laptop hard-drive. I have a new drive (larger) and I would like to duplicate/clone my entire drive by attaching the new drive to the laptop through the usb port, booting from the openSuSE install disk and then using dd to clone the old drive to new. Having never attempted a clone-by-usb, I don't even know if that is possible with the software on the install CD. So before spending a couple of hours to find out it won't work, I'll ask the brain-trust:
(1) Does the install CD provide sufficient USB connection capability to attach a second drive by USB and make the device available to receive the contents of the original using dd?
(2) presuming I can get the usb drive up as /dev/sdb (or wherever it end up), can anyone suggest any further optimizations for the dd clone beyond:
dd if=/dev/sda of=/dev/sdb bs=4096 conv=notrunc,noerror,sync
Ok, I have done this before, but to disks of the exact same size. First, don't use the install CD, unless you can not download anything else. Instead, from the openSUSE site, download the XFCE CD, which is not an installation image, but a rescue image. It does not have *office tools, nor installation tools, to save space, and instead has other tools indicated for this kind of work. If installed on a USB stick, since version 13.1, you get a persistent filesytem, so you can even install further packages or save files. It is very nice. Then, as you have bad sectors, 'dd' is a bad idea. Instead, use 'dd_rhelp' or 'ddrescue'. They are very similar tools, but the syntax is different. I think the xfce image contains the first version. Any of those tools will make a proper image, either of single partitions, or of full disks, skipping the bad blocks, where dd may get stuck for long time. The strategy is to copy as soon as possible the good sectors, then try to copy the bad regions. This might be done in hours, or days, till you stop. For instance, after a reasonable time, it say that 99.99% is copied. The rest may take a very long time, depending on the damage. You can then decide to stop it there, and be happy with that 99%. (dd_rescue is used by dd_rhelp; don't use it directly; it is possible, but more cumbersome for this purpose) Another tool is clonezilla, using its own boot CD. It is text mode, and very good for cloning disks and partitions, conserving space, and, I believe, expanding the destination space if wanted. However, I have never tried it on a damaged disk. -- Cheers / Saludos, Carlos E. R. (from 13.1 x86_64 "Bottle" at Telcontar)