On Fri, 9 Apr 2004, Szakacsits Szabolcs wrote:
> On Fri, 9 Apr 2004, Anton Altaparmakov wrote:
> > On Thu, 8 Apr 2004, Szakacsits Szabolcs wrote:
> > > On Thu, 25 Mar 2004, Anton Altaparmakov wrote:
> > > > The difficulty is that there is no single bit saying "journal clean" or
> > > > "journal dirty".
> > >
> > > On NTFS 3.1 in the 'flags' field of the restart area, the bit 1 (starting
> > > from 0) tells apparently if NTFS is supposed to be clean or not. If the
> > > value is set ('flags' field is 2) then NTFS is "clean", or at least it was
> > > shutdown properly.
> > >
> > > Confirmations? Rebuttals?
> >
> > Er who says that?
>
> Apparently NTFS 3.1 says so. You never checked?
What do you mean by NTFS 3.1? Do you mean the NTFS driver that comes with
XP? The one with XPSP1? The one with XPSP2? The one with 2003 or
Longhorn? Note all these drivers are things like version 5.1, etc. NTFS
3.1 is the NTFS specification not the driver. Also the NTFS version is
not tied to the LFS version in any way... They are entirely separate
drivers and NTFS driver registers as a client to the LFS driver. I do not
believe NTFS knows anything at all about LFS versions.
Certainly on my XPSP1 test system, I see differences between crashed NTFS
and cleanly shutdown NTFS in the $LogFile restart pages. And the
differences are as I have described in include/ntfs/logfile.h.
> > It certainly isn't the case for LFS 1.1 (the only one I know about).
> > I believe XP uses LFS 1.1, too (as do NT4 and Win2k).
>
> AFAIK, the only LFS user is NTFS. NTFS 3.0 and earlier isn't able to
> access/mount NTFS 3.1. So NTFS 3.1 LFS version could be anything.
Yes, LFS allows only one client registration per logfile. And yes only
NTFS uses LFS I believe. NTFS 3.1 LFS makes no sense. NTFS and LFS are
quite separate things...
> Moreover this feature is backward compatible. What happens if 3rd party
> softwares can't interpret the flag? They waste time trying to recover a
> consistent NTFS until they find so.
>
> Microsoft invested a lot to improve NTFS for version 3.1 and the boot
> time. Probably it was realised it's more efficient just mark the volume
> clean if it was clean at shutdown and make a quick check for it at boot
> time than parsing several times (redo, undo, etc) 50-100+ MB journal files
> needlessly.
>
> > The easiest way to find out which version of LFS you are looking at is to
> > run ntfsdump_logfile /dev/partition | more or ntfsdump_logfile -f
> > ntfs_image_file | more. You need the more as the log record stuff is a
> > lot of bogus crap at the moment and it outputs tons of rubbish. But I
> > have been doing lots of work on the restart pages parts and what I say
> > there should be correct and the output from ntfsdump_logfile regarding the
> > restart pages should be correct, too.
>
> Yes, people could help out here also:
>
> download/install ntfsprogs
> ./configure
> make install
> cd ntfsprogs
> make ntfsdump_logfile
> cp .libs/ntfsdump_logfile /usr/bin/
>
> repeatedly crash (make an 'ntfsclone' just for your extra safety) and
> shutdown Windows properly then run
>
> ntfsdump_logfile partition | head -40 | grep flags
Also make sure to crash windows at least once while idle and at least once
while it is doing active i/o. (E.g. use explorer to start copying your
Program Files directory to your temp directory or something like that and
when your HD is going like mad, press the reset button.)
> If Windows is XP/W2K3/Longhorn then
>
> flags = 2 apparently means clean shutdown, no recovery needed
> flags = 0 means unknows state, recovery needed
I have never seen the flags be anything other than 0 on XPSP1 and W2K.
> > > However all comments and guesses related to dirty/clean NTFS I've seen in
> > > the NTFS doc and in the sources are bogus (at least on NTFS 3.1).
> >
> > Have you looked at the most recent include/ntfs/logfile.h? That contains
> > a lot of good info about the restart pages and how dirty/clean can be
> > distinguished. And that is I believe correct for LFS 1.1.
>
> Yes, I meant for those with NTFS 3.1 and
>
> http://linux-ntfs.sourceforge.net/ntfs/files/logfile.html
> http://linux-ntfs.sourceforge.net/ntfs/concepts/restart.html
>
> > If you believe they are bogus then please let me know which bits and
> > why...
>
> All comments because they are always the same on NTFS 3.1 independently if
> Windows crashed or not.
Well, they are not the same at all on XPSP1, at least not on mine! They
are only the same if the system was completely idle when it crashed (i.e.
the log file is fully checkpointed and no i/o is outstanding).
Best regards,
Anton
--
Anton Altaparmakov <aia21 at cam.ac.uk> (replace at with @)
Unix Support, Computing Service, University of Cambridge, CB2 3QH, UK
Linux NTFS maintainer / IRC: #ntfs on irc.freenode.net
WWW: http://linux-ntfs.sf.net/ & http://www-stu.christs.cam.ac.uk/~aia21/
|