LINUX TIPS AND TRICKS --- July 13, 2001

Published by ITworld.com -- changing the way you view IT
http://www.itworld.com/newsletters
________________________________________________________________

Journaling and Logging
By Danny Kalev

The traditional Linux file systems were based on the legacy 
Unix file systems. Such file systems (e.g. ext2fs) are static, 
which means they do not track changes applied to files and 
directories to guarantee that all updates are performed safely. 
Furthermore, ext2fs works asynchronously. Information about a 
file -- for example its permissions, creation date, and 
ownership -- are written in a delayed fashion and, often, in 
several distinct operations.

This approach results in a noticeable performance gain; 
however, it also incurs data consistency problems. If a power 
failure occurs exactly when the file system has updated the 
contents of a file but before it managed to update its header, 
then the file becomes corrupted. Worse yet, if the disk is 
highly fragmented, then it's likely that other files may have 
been corrupted as a result and the entire directory needs to 
be restored.

Traditionally, a process called fsck (file system check) would 
check the file system during reboot and detect the corrupt 
files. In some cases, it would manage to fix them too, but 
usually you would have to reconstitute the files from a backup 
set. In the Internet age, when servers are required to stay up 
for months, this approach is unacceptable. The demand for a 
more reliable file system and faster recovery time led to the 
development of several journaling and logging file systems.

What is journaling?
The concept, introduced about a decade ago in database systems, 
ensures data consistency and integrity in the event of a failure
during a transaction. A typical database journaling system 
records every operation applied to the database records. If a 
transaction can't be completed due to a hardware fault or a 
network failure, then the database system restores the records 
to their original state. A journaling file system uses a similar
method by constantly monitoring inode changes.

Logging, as opposed to journaling, keeps track of both inode 
changes and file content changes. Each of these approaches has 
advantages and drawbacks. In terms of performance overhead, 
journaling requires less resources but logging enables faster 
recovery time. In either case, recovery time is much faster 
compared to a static file system. Furthermore, it doesn't 
necessitate a reboot.

Next week, I will explore this issue in further detail and 
present some of the available journaling file systems for Linux.

About the author(s)
-------------------
Danny Kalev is a system analyst and software engineer with more 
than 10 years of experience, specializing in C++ and 
object-oriented analysis and design on various platforms 
including VMS, DOS, Windows, Unix, and Linux. His technical 
interests involve code optimization, networking, and 
distributed computing. He is also a member of the ANSI C++ 
standardization committee and the author of ANSI/ISO C++ 
Professional Programmer's Handbook (Que, 1999). Contact him at 
linuxnl@excite.com.
________________________________________________________________

ADDITIONAL RESOURCES

fsck
http://www.tac.eu.org/cgi-bin/man-cgi?fsck+8

Journaling Filesystems and Linux
The Future Of Storage Under Linux 
http://www.linux-mag.com/2000-08/journaling_01.html

Unclean!
The dawning of a new age in Linux journaling filesystems
http://certcities.com/certs/linux_unix/columns/
story.asp?EditorialsID=8
________________________________________________________________

ITWORLD.COM SERVICES

METAgroup.com -- Click Daily With The Top Minds In IT

Visit METAgroup.com for free access to daily IT and 
E-Business news analysis, analyst insights, research reports, 
and much more.
http://itw.itworld.com/GoNow/a14724a38050a76537031a0
________________________________________________________________

CUSTOMER SERVICE

SUBSCRIBE/UNSUBSCRIBE:
- Go to: http://reg.itworld.com/cgi-bin/subcontent12.cgi
- Enter your email address under "Current subscriber" to log in
- Uncheck the box next to the newsletter you want to
  unsubscribe from
- Or check the box next to the newsletter you want to
  subscribe to
- Submit


If you have questions, please send email to customer service at:
mailto:support@itworld.com
________________________________________________________________

CONTACTS

* For editorial comments, write Andrew Santosusso, Associate
  Editor, Newsletters at: andrew_santosusso@itworld.com
* For advertising information, write Dan Chupka, Account
  Executive at: dan_chupka@itworld.com
* For recruitment advertising information, write Jamie Swartz,
  Eastern Regional Sales Manager at: jamie_swartz@itworld.com
  or Paul Duthie, Western Regional Sales Manager at:
  paul_duthie@itworld.com
* For all other inquiries, write Jodie Naze, Product Manager, 
  Newsletters at: jodie_naze@itworld.com
________________________________________________________________

PRIVACY POLICY
http://www.itworld.com/Privacy/

Copyright 2001 ITworld.com, Inc., All Rights Reserved.
http://www.itworld.com
