-------------------------------------------- On Fri, 14/2/14, Vyacheslav Dubeyko <slava@xxxxxxxxxxx> wrote: Subject: Re: [PATCH v3 01/15] hfsplus: add necessary declarations for journal replay To: htl10@xxxxxxxxxxxxxxxxxxxxx Cc: "Sergei Antonov" <saproj@xxxxxxxxx>, "Linux FS devel list" <linux-fsdevel@xxxxxxxxxxxxxxx>, "Al Viro" <viro@xxxxxxxxxxxxxxxxxx>, "ChristophHellwig" <hch@xxxxxxxxxxxxx>, "Andrew Morton" <akpm@xxxxxxxxxxxxxxxxxxxx> Date: Friday, 14 February, 2014, 7:22 On Thu, 2014-02-13 at 20:07 +0000, Hin-Tak Leung wrote: > > Hi all, > > I Have mentioned earlier that I have the powerpc version of Darwin 8 (equivalent > to Mac OS X 10.4) running inside pearpc, and have other uses of it and therefore have given it > some use. I can look into this - and probably will, when I try v3 of Vyacheslav's patch set. > So, had you any error messages when you tried patchset v3? If you really have HFS+ volume with big-endian structures in journal then failure with journal replay or volume corruption is inevitable. > Darwin 8 does certainly noticed it was uncleanly shut down and display a message about > journal replay the next time it starts; also it seems to notice the journal had been played > with by somebody else - there is a message about invalid/invalidating journal entries > when I ran fsck.hfsplus manually between unclean shut down and restart. > (That's assuming fsck.hfsplus can cope with disk images written by the powerpc > version of darwin 8 correctly, one way or another - I should hope so, as it is > not unthinkable for a mac user to own both kind of macs). > > So it appears that the journal is not emptied by fsck.hfsplus, but simply marked done > and no longer relevant, and the darwin kernel code notices that. > As far as I can judge, fsck tool doesn't replay journal, usually. It need to take into account presence of journal with transactions. But namely file system driver is responsible for journal replay. And, as I remember correctly, fsck.hfsplus claims about presence of journal and it suggests to use force option for volume checking in such case. Thanks, Vyacheslav Dubeyko. Hi Vyacheslav, I am afraid I have bad news for you - Sergei may be right. This is what shows on an unclean-shutdown image: [179982.068363] hfsplus: invalid journal header [179982.068375] hfsplus: journal replay failed, mounting read-only [179982.068378] hfsplus: filesystem was not cleanly unmounted, mounting read-only [179982.068380] hfsplus: running fsck.hfsplus is recommended This is on the clean shutdown after: [182188.224271] hfsplus: invalid journal header [182188.224287] hfsplus: journal replay failed, mounting read-only Obviously my virtual machine is still working, so the file system must be valid. I have also recorded that the darwin kernel outputs this when replaying the journal: Feb 14 19:15:55 localhost kernel[0]: jnl: replay_journal: from: 3365376 to: 2762752 (joffset 0x1a000) which might be interesting to try to replicate. The good news is I have saved the unclean image, and the clean one after, they compress to just over 600MB each (and expands to 3GB each). Since they are just darwin 8 (plus some open-source software I tried to work on within) and *not* full Mac OS X, I suppose you can have them, if you can find the space for me to upload them to. As I mentioned earlier that the darwin kernel seems to notice that its filesystem had been manipulated by fsck.hfsplus. To be precise, it seems that whenever I had done a fsck.hfsplus between, the darwin kernel outputs this kind of message: Feb 12 07:23:20 localhost kernel[0]: jnl: journal start/end pointers reset! (jnl 0x1838e60; s 0x232a00 e 0x722600) Feb 12 15:22:37 localhost kernel[0]: jnl: journal start/end pointers reset! (jnl 0x17dbe60; s 0x96600 e 0x322600) So it might be also worth looking at the XNU source what that means, and whether fsck.hfsplus is behaving correctly on x86_64 linux on manipulating powerpc HFS+ images. OTOH, I am happy if you have debug patches, etc to try thing out at this end. Hin-Tak -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html