But when does "cmp -l" stops ?
Once it encounter EOF character ?
What if it will find it in the middle of partition ?

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Yedidyah Bar-David
Sent: Monday, 24 July, 2006 10:48 AM
To: Michael Sternberg
Cc: linux-il@linux.org.il
Subject: Re: Comparing two partitions block by block

On Mon, Jul 24, 2006 at 11:30:52AM +0300, Michael Sternberg wrote:
Hello.

Let's say I want to test my block-level backup program. Let's say I backed up some partition 1 and restored it to partition 2 (size is equal to partition 1). Let's say there were no writes to partition 1 until now.

How can I compare two partitions block by block ?

There is no problem to write an application that does the above, I just
wanted to know if there is some clever usage of dd that will help me.

P.S. Please do not propose file level comparison - I want to check that
all blocks on both partitions are same.

What's wrong with file level comparison, simply ran on the block
devices? It might not be the most efficient way, but will certainly work
- that's, after all, one of the most basic principles of unix. E.g.
cmp -l /dev/hda1 /dev/hdb2


=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to