Hardware Wars, round 2

Lennart Sorensen lsorense-1wCw9BSqJbv44Nm34jS7GywD8/FfD2ys at public.gmane.org
Mon Aug 23 19:10:48 UTC 2010


On Sun, Aug 22, 2010 at 01:37:39AM -0400, D. Hugh Redelmeier wrote:
> | From: Peter King <peter.king.1-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org>
> 
> |  Or maybe this is a
> | sign that I should get a new boot drive. Probably not a bad idea. If
> | only it weren't so much trouble to clone boot drives...
> 
> What's hard about cloning boot drives?  I've done it a number of times
> via brute force.
> 
> If 
> a) your boot drive is large enough that geometry doesn't matter (8.5G
>   or more, I imagine), and
> 
> b) the target drive has at least as many tracks as your boot drive,
>   and
> 
> c) you can install the target drive,
> 
> then the following simple procedure should work:
> 
> - install target drive
> 
> - boot a live Linux CD
> 
> - do a dd from the boot drive to the target drive.
>   Don't screw this up.  For example, getting it
>   backwards is fatal to the system.
> 
> 	time dd if=/dev/sda of=/dev/sdb bs=100M

Given the largest transfer request of ATA disks is usually 128KB, using
bs=128k tends to be optimal.  Having to read 100M from one disk, before
writing 100M to the other looses parallel disk access benefits too.

>   This assumes that /dev/sda is the boot disk
>   and /dev/sdb is the target drive.  Check carefully!
> 
>   This copies the whole disk: all partitions.
> 
>   Flaw 1: If you get a disk error, dd will stop (I think).
>   You are on your own at that point.

adding 'conv=noerror' will simply skip the bad bit.

>   The "time" is just because it is sometimes interesting
>   to know how long this takes
> 
> At this point, your target disk is a clone of your boot disk.
> 
> If the target disk is larger than the boot disk, you will have some
> space that is not in any partition.  You can fix that with gparted or
> fdisk or whatever.
> 
> Flaw 2: if your target disk was formerly used by some RAID systems, it
> might have crud at the end of the disk saying so.  The dd did not
> erase this if the target is larger than the boot disk.  See
> <https://bugs.launchpad.net/ubuntu/+source/dmraid/+bug/543008>

-- 
Len Sorensen
--
The Toronto Linux Users Group.      Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists





More information about the Legacy mailing list