Re: endianness of Linux kernel RAID

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Neil Brown <neilb@xxxxxxxxxxxxxxx> writes:
> On Thursday August 4, neilb@xxxxxxxxxxxxxxx wrote:
>> 
>> Oopps....
>> I meant to send the following in reply to a recent message from
>> Gregory Seidman, but inadvertently send it in reply to an earlier
>> message from Aaron Botsis (which I must have missed..)
>> 
>> Still, the offer is open to either, or anyone else.
>
> I decided to try it anyway...
>
> The following patch, when applied to mdadm-2.0-devel-3 (Recently
> released) should allow:
>
>   mdadm --examine --metadata=0.swap /dev/sda1
>
> which will show the superblock with bytes swapped.  If that looks right for
> all devices, then
>
>   mdadm --assemble /dev/mdX --update=byteorder /dev/sda1 /dev/sdb1 ...
>
> will assemble the array after swapping the byte order on all devices.
> Once it has been assembled this way, the superblocks will have the
> correct byte order, and in future the array can be assembled in the
> normal way.
>
> Feedback would be very welcome.

If I read your notes correctly, it should be possible to determine that
this is (or isn't) a byte-swapped v0 superblock by checking for the
byte-swapped magic number, right?

In that case, I think it would be good to have --update=byteorder refuse
to work if that magic number check either wasn't the byte-swapped
variant.

Adding a 'force' or something to bypass the check if you *really* want
to seems reasonable-ish.

That would make it just that little bit harder to accidentally byte-swap
a superblock when you shouldn't have done so.

  Daniel


-
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux