[clue] Oops, I did it again...

marcus hall marcus at tuells.org
Mon Jul 25 16:24:08 MDT 2011


On Mon, Jul 25, 2011 at 03:34:47PM -0600, David L. Willson wrote:
> sda and sdb will get dd'd into files on the great big new drive, as soon as I have time. For now, they've been pulled out of the system and are waiting patiently.
> 
> What I need is a script that goes something like:
> 
> Read a block from sda, read a block from sdb.
> If they're the same, overwrite the block from sdb with zeroes.
> If they're different, quit.
> Read the next block from sda and sdb. Repeat.
> 
> Since nobody's produced such a thing, I suppose I'll have to write it...

Would it suffice to just run "cmp" to find where the first difference
was?  Then divide by 512 to get disk blocks.  Of course, you probably don't
want to zero the partition table at the beginning of sdb, you may need to
recreate that (unless it's the same as sda's, then you could just leave
it alone).

marcus hall
marcus at tuells.org


More information about the clue mailing list