We often hear that file systems like NTFS and ext3 for example, have this featured called a journal. We know that this file system journal thing in theory keeps our data from being corrupt if there is a crash or unclean shutdown. And with journaling we should in theory never have to do a checkdisk or fsck on a file system.
Does it really work like that? What does file system journaling really accomplish for us?
In Part 1 I examined Ext3 journaling options and what they actual do for data integrity on your server. In this part 2 I will look at Windows Servers and NTFS and ReiserFS on Linux .
NTFS Data Integrity
… A file system journal is used to guarantee the integrity of the file system—but not individual files’ content. Systems using NTFS are known to have improved reliability compared to FAT file systems.
That’s very clear. With NTFS you have no way to save your data in a crash unless the application you are running performs special journal of its own that is coordinated with periodic disk flushes or syncs. Windows API for this is FlushFileBuffers()
For example SQL Server has its own journal for integrity and periodically forces data through to disk.
For Windows NTFS is the only real option. FAT32 does not have any journaling. If you have a server crash and use FAT32 you might as well give up your systems admin job and move to Vegas and be a loosing craps shooter instead. And if you know anyone still using Veritas VxFS on a Windows server e-mail me I may be able to sell their server to a museum.
Linux Reiser File System Journal
In Linux the wonderful modular complicated beast that it is we have a wonderfully rich set of file systems to choose from. The next most popular Linux file system after ext2/3 is perhaps Reiserfs 3 which was for some time the default file system on Suse Linux. In part one we learned that the commonly used journal modes for Ext3 do not actually journal file contents and do nothing to protect the integrity of file contents in the event of crash or power failure. Is Reiserfs any better with data integrity than Ext3?
But the current journaling implementation in ReiserFS is now on par with that of ext3’s “ordered” journaling level.
So with Reiserfs it only journals meta-data meaning there is no journaling of file contents. So it behaves similarly to Ext3 “ordered” journal mode which states:
* ordered - that the data is consistent with the file system; recently-written files will never show up with garbage contents after a crash at the cost of some speed.
In the next post I will look at what applications must do to protect file data from failures, and how most applications don’t.