On Fri, 18 May 2007, Manu wrote:
>   
> Well, about 15 years ago, I was asked to make a presentation
> of NT as compared to Unix.
> 
> Among the features I stressed the advantages of NTFS, designed
> like a database manager. Based on my readings, I explained that
> all structural data were dealt with transactionnally : before
> any modifications to the structure, before images were saved
> and the modifications could only begin after the before images
> were confirmed to disk. The before images were restored after
> a crash, so that the file system could not become inconsistent,
> though unended modifications and recent user data would be lost.

Yes, NTFS metadata journaling (and many other features) preceded open 
source Unix journaling file systems by almost a decade. XFS had journaling 
a bit later but it wasn't ported and usable on Linux till 2000+.

> I remember having pointed out that an "fsck" (I don't recall
> the exact command to check the fs integrity) was provided
> anyway, which tended to mean that Microsoft was not quite
> confident in the transactionnal capacity of NTFS.

fsck is needed because the rapidly changing softwares and hardwares keep 
corrupting file systems. This is not really visible from a particular user 
point of view but it's a totally different issue with (some hundred) 
millions of users. 

The Microsoft NTFS driver and chkdsk also have problems and bugs we have 
to be compatible with or workaround them.
 
> Now, seeing what you are telling regularly about an ntfs-3g
> file system becoming inconsistent after a crash or bad unmount,
> should I think that the transactionnal features have not been
> implemented in ntfs-3g, or am I missing something 

The Microsoft NTFS driver was about an order larger in 2000 than ext3 
(ext2 + journaling) today (250,000 vs 25,000 source lines). One of the 
smartest Linux kernel developers, Dr Stephen Tweedie, added journaling 
to ext2 (7,000 source lines) in two years, working on it as a Red Hat 
employee. What do you think, how long it would take to add journaling 
to the much more complex NTFS, as a free time, hobby project? 

So no, journaling is not implemented at the moment. Only check is done for 
cleanness and the journal is reset if it's enforced by the user.

I'm also thinking about that it would be better to add logging instead of 
journaling since the former is flash device friendly which will replace 
ordinary disks in the future. It could be called ntfs-lg, fully compatible 
with Microsoft's NTFS driver. 

> Note : I have been using ntfs-3g for more than 6 months and
> endured several power failures, but so far (knocking on wood)
> my ntfs partitions have remained consistent.

ntfs-3g tries hard to order writes in a way that the volume would stay 
consistent in case of a crash. However this is not always guaranteed, 
moreover it lets the kernel do the i/o scheduling for performance reasons. 
The only time when ntfs-3g forces data to the disk is unmount. So even if 
writes are usually ordered for consistency, the kernel can rearrange and/or 
delay some of them thus a power outage or an OS freeze can result 
inconsistency.

        Szaka

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
ntfs-3g-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ntfs-3g-devel

Reply via email to