Skip to contentSkip to conversation

Writing journal only in Big Endian format

DISCUSSION Nitin Arora 3 participants 4 messages Nov 30, 2009 – Dec 10, 2009

lore
Share & tools
lore
#0 lore raw

Hello,

We are using XFS (Kernel 2.6.18) and facing a problem.
When any XFS partition is plugged out from a little endian machine and plugged in to a big endian machine,
it cannot be mounted and gives the following error.

FAT: utf8 is not a recommended IO charset for FAT filesystems, filesystem will be case sensitive!

FAT: bogus number of FAT structure

VFS: Can't find a valid FAT filesystem on dev sda1.

VFS: Can't find ext3 filesystem on dev sda1.

XFS mounting filesystem sda1

Starting XFS recovery on filesystem: sda1 (logdev: internal)

XFS: dirty log written in incompatible format - can't recover

XFS: log mount/recovery failed: error 5

XFS: log mount failed

Mounting problem goes away after doing *"xfs_repair -L /dev/sdb2"

*The problem is that big endian machine cannot recognize the journal which was written in
little endian format by the little endian machine and once the journal is zerod out it can be mouted.

Now the solution to above problem seems writing journal always in big endian format.

Please suggest me, Is there any design limitation in XFS for this. Is it okay and feasible to implement it if yes then please give some pointers so that it can be implemented, under some suitable compile time switch.

Thanks in advance...

Regards
Nitin Arora

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#1 lore raw
Quoted 16 lines · Nitin Arora

Hello,

We are using XFS (Kernel 2.6.18) and facing a problem.
When any XFS partition is plugged out from a little endian machine and plugged in to a big endian machine, it cannot be mounted and gives the following error.

FAT: utf8 is not a recommended IO charset for FAT filesystems, filesystem will be case sensitive!

FAT: bogus number of FAT structure

VFS: Can't find a valid FAT filesystem on dev sda1.

VFS: Can't find ext3 filesystem on dev sda1.

XFS mounting filesystem sda1

Quoted 9 lines

Starting XFS recovery on filesystem: sda1 (logdev: internal)

XFS: dirty log written in incompatible format - can't recover

XFS: log mount/recovery failed: error 5

XFS: log mount failed

Yep this Is expected for a dirty log, but I think a cleanly unmounted filesystem should migrate without problems; is this not the case?

So really the problem should be limited to migrating -dirty- filesystems, and the complexity of endian-swapping the journal at runtime seems overly expensive for this odd case.

Just unmount before migration....

-Eric

Quoted 8 lines

Mounting problem goes away after doing "xfs_repair -L /dev/sdb2"

The problem is that big endian machine cannot recognize the journal which was written in little endian format by the little endian machine and once the journal is zerod out it can be mouted.

Now the solution to above problem seems writing journal always in big endian format.

Quoted 8 lines

Please suggest me, Is there any design limitation in XFS for this.
Is it okay and feasible to implement it if yes then please give some pointers so that it can be implemented, under some suitable compile time switch.

Thanks in advance...

Regards
Nitin Arora

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#2 lore raw
In reply to Nitin Arora
Quoted 7 lines · Nitin Arora

The problem is that big endian machine cannot recognize the journal which was written in little endian format by the little endian machine and once the journal is zerod out it can be mouted.

Now the solution to above problem seems writing journal always in big endian format.

Or you could just replay the log on the little endian machine and do a clean unmount, then you should be able to move it to the big endian machine without losing anything.

Quoted 1 line

Please suggest me, Is there any design limitation in XFS for this.

No design limitation, just a *lot* of work to change. If you don't have a few months handy to work on this, I'd just use the above method....

Quoted 2 lines

Is it okay and feasible to implement it if yes then please give some pointers so that it can be implemented,

All log headers, tails and sector fills need to be converted, every log item format routine needs a big-endian version, log recovery needs to be able to read both host-format and big-endian logs, all the userspace tools need to learn about different log formats, QA tests need to be written, etc.

Quoted 2 lines

under some suitable
compile time switch.

It could be done with a superblock feature bit, so the same kernel could support both big-endian logs and host format.

Cheers,

Dave.

Signature · 7 lines
Dave Chinner
[email protected]

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
#3 lore raw

Thanks Dave and Eric for your kind support.
We will then see if it is worth putting in effort for these changes or not.

Thanks

Quoted 34 lines · Dave Chinner
Quoted 7 lines · Nitin Arora

The problem is that big endian machine cannot recognize the journal which was written in little endian format by the little endian machine and once the journal is zerod out it can be mouted.

Now the solution to above problem seems writing journal always in big endian format.

Or you could just replay the log on the little endian machine and do a clean unmount, then you should be able to move it to the big endian machine without losing anything.

Quoted 1 line

Please suggest me, Is there any design limitation in XFS for this.

No design limitation, just a *lot* of work to change. If you don't have a few months handy to work on this, I'd just use the above method....

Quoted 2 lines

Is it okay and feasible to implement it if yes then please give some pointers so that it can be implemented,

All log headers, tails and sector fills need to be converted, every log item format routine needs a big-endian version, log recovery needs to be able to read both host-format and big-endian logs, all the userspace tools need to learn about different log formats, QA tests need to be written, etc.

Quoted 2 lines

under some suitable
compile time switch.

It could be done with a superblock feature bit, so the same kernel could support both big-endian logs and host format.

Quoted 7 lines

Cheers,

Dave.
--
Dave Chinner
[email protected]

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs