my @SB; my $Temp; sysopen(DEV, $Device, O_RDWR | O_SYNC) || die("Error: $!\n"); sysseek(DEV,0,0) || die("$!\n"); sysread(DEV,$SB[0],512) || die("1 $!\n"); sysseek(DEV,0,0) || die("$!\n"); sysread(DEV,$SB[1],512) || die("2 $!\n"); sysseek(DEV,-1024,2) || die("$!\n"); sysread(DEV,$SB[2],512) || die("3 $!\n"); sysseek(DEV,-512,2) || die("$!\n"); sysread(DEV,$SB[3],512) || die("4 $!\n"); if (!($SB[0] eq $SB[1])) { my @Pair; warn("Error, First 2 superblocks do not match! Checking third. +.."); foreach my $I (0 .. 1) { @Pair = ($I,2) if ($SB[$I] eq $SB[2]); } if (!((@Pair[0]) && (@Pair[1]))) { warn("Error, First 3 superblocks do not match! Checking fo +urth and final..."); foreach my $I (0 .. 2) { @Pair = ($I,3) if ($SB[$I] eq $SB[3]); } if (!((@Pair[0]) && (@Pair[1]))) { die("All 4 superblock copies are different! This is ma +jior corruption.\n"); } } $SB[0] = $Pair[1]; }
I know that they are not equal though, here are the first 1024 bytes:
Abydos OEFS # hexdump -C -n 1024 /dev/sdf1 00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |......... +.......| * 00000200 4f 45 46 53 2d 30 30 30 30 2e 30 30 30 30 30 30 |OEFS-0000 +.000000| 00000210 f0 26 3f f0 9d 1f dc 11 93 c2 d9 64 65 f2 e8 c0 |.&?...... +..de...| 00000220 53 74 72 75 01 00 00 00 00 00 00 00 00 00 00 00 |Stru..... +.......| 00000230 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |......... +.......| * 00000400

In reply to Re^2: Test binary equality? by exodist
in thread Test binary equality? by exodist

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.