Skip to contentSkip to conversation

Bigendian issue with mdadm

DISCUSSION Francois Barre 3 participants 5 messages Feb 20, 2006 – Feb 21, 2006 MD RAID

lore
Share & tools
lore
#0 lore raw

Hi All,

Please, Help !

I've created a raid5 array on a x86 platform, and now wish to use it on a mac mini (g4 based). But the problem is : the first is little-endian, the second big-endian...
And it seams like md superblock disk format is hostendian, so how should I say mdadm to use a endianness ?

Thanks for help,

F.-E.B.

#1 lore raw
Quoted 10 lines · On Monday February 20, [email protected] wrote:

Hi All,

Please, Help !

I've created a raid5 array on a x86 platform, and now wish to use it on a mac mini (g4 based). But the problem is : the first is little-endian, the second big-endian...
And it seams like md superblock disk format is hostendian, so how should I say mdadm to use a endianness ?

Read the man page several times?

Look for "--update=byteorder"

You need mdadm-2.0 or later.

NeilBrown

#2 lore raw
Quoted 12 lines · Neil Brown
Quoted 10 lines · On Monday February 20, [email protected] wrote:

Hi All,

Please, Help !

I've created a raid5 array on a x86 platform, and now wish to use it on a mac mini (g4 based). But the problem is : the first is little-endian, the second big-endian...
And it seams like md superblock disk format is hostendian, so how should I say mdadm to use a endianness ?

Quoted 6 lines

Read the man page several times?

Look for "--update=byteorder"

You need mdadm-2.0 or later.

besides IIRC version 1 super block is always little-endan.

L.

Signature · 6 lines
Luca Berra -- [email protected]
       Communication Media & Services S.r.l.
/"\
\ /     ASCII RIBBON CAMPAIGN
 X        AGAINST HTML MAIL
/ \
#3 lore raw
Quoted 13 lines · On Tuesday February 21, [email protected] wrote:
Quoted 12 lines · Neil Brown
Quoted 10 lines · On Monday February 20, [email protected] wrote:

Hi All,

Please, Help !

I've created a raid5 array on a x86 platform, and now wish to use it on a mac mini (g4 based). But the problem is : the first is little-endian, the second big-endian...
And it seams like md superblock disk format is hostendian, so how should I say mdadm to use a endianness ?

Quoted 8 lines
Quoted 6 lines

Read the man page several times?

Look for "--update=byteorder"

You need mdadm-2.0 or later.

besides IIRC version 1 super block is always little-endan.

True. v1 is little-endian, not host-endian so this issue won't appear if using v1 metadata. However the default is 0.90, and I'm still finding occasional bugs with the v1 code, so I'm not likely to change the default soon any time soon... probably not for 1 year after I'm as confident of v1 code as of v0.90.

NeilBrown

#4 lore raw
In reply to Neil Brown

2006/2/21, Neil Brown <[email protected]>:

Quoted 5 lines · On Monday February 20, [email protected] wrote:
Quoted 4 lines

Hi All,

Please, Help !

[...]

Quoted 4 lines
Quoted 3 lines

And it seams like md superblock disk format is hostendian, so how should I say mdadm to use a endianness ?

Quoted 8 lines

Read the man page several times?

Look for "--update=byteorder"

You need mdadm-2.0 or later.

NeilBrown

Ooops... You know what it is : the more you focus on a problem, the less you can see solutions floating around...
I had mdadm-1.2 installed, and of course did not think about upgrading... I will test this asap.
This will avoid me to code a byte reordering program... Thanks Neil ! BTW : I did not see this feature in the kernel code, and after a quick look at mdadm source, seems to be implemented in super0.c:super0_swap_endian(). Is there any prerequisite regarding the kernel version for this to work ?

Thanks again Neil, I am really impressed by your patience answering dummy questions...

Regards,