rane        05/10/01 17:16:24

  Added:       xml/htdocs/doc/en/articles l-afig-p8.xml
  Log:
  new article from #103294

Revision  Changes    Path
1.1                  xml/htdocs/doc/en/articles/l-afig-p8.xml

file : 
http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/articles/l-afig-p8.xml?rev=1.1&content-type=text/x-cvsweb-markup&cvsroot=gentoo
plain: 
http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/articles/l-afig-p8.xml?rev=1.1&content-type=text/plain&cvsroot=gentoo

Index: l-afig-p8.xml
===================================================================
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/articles/l-afig-p8.xml,v 
1.1 2005/10/01 17:16:24 rane Exp $ -->

<guide link="/doc/en/articles/l-afig-p8.xml">

<title>Advanced filesystem implementor's guide, Part 8</title>

<author title="Author">
  <mail link="[EMAIL PROTECTED]">Daniel Robbins</mail>
</author>
<!-- xmlified by David H. Askew ([EMAIL PROTECTED])-->

<!-- The original version of this article was first published on IBM 
developerWorks, and is property of Westtech Information Services. This 
document is an updated version of the original article, and contains
various improvements made by the Gentoo Linux Documentation team -->

<abstract>
With the 2.4 release of Linux come many new filesystem possibilities, 
including Reiserfs, XFS, GFS, and others. These filesystems sound cool, but
what exactly can they do, what are they good at, and exactly how do you go
about safely using them in a production Linux environment? Daniel Robbins 
answers these questions by showing you how to set up these new advanced 
filesystems under Linux 2.4. In this installment, Daniel continues his look
at ext3, a new improved version of ext2 with journaling capabilities. He 
reveals all the inside information on ext3, and demonstrates some shockingly 
good ext3 data=journal interactive performance numbers.
</abstract>

<version>1.0</version>
<date>2005-09-30</date>

<chapter>
<title>Introduction</title>
<section>
<body>

<note>
The original version of this article was first published on IBM developerWorks,
and is property of Westtech Information Services. This document is an updated
version of the original article, and contains various improvements made by the
Gentoo Linux Documentation team.
</note>

<p>
I'm going to be honest. For this article, I was planning to show you how to get
ext3 up and running on your system. Although that's what I said I'd do, I'm not
going to do it. Andrew Morton's excellent "Using the ext3 filesystem in 2.4
kernels" page (see <uri link="#resources">Resources</uri> later in this
article) already does a great job of explaining how to ext3-enable your system,
so there's no need for me to repeat all the basics here. Instead, I'm going to
delve into some meatier ext3 topics, ones that I think you'll find very useful.
After you read this article, when you're ready to get ext3 up and running, head
over to Andrew's page.
</p>

</body>
</section>
</chapter>

<chapter>
<title>2.4 kernel update</title>
<section>
<body>

<p>
First, let's start with a 2.4 kernel update. I last discussed 2.4 kernel
stability when I was covering ReiserFS. Way back then, finding a stable 2.4
kernel was a challenge, and I recommended sticking with the known and at that
time bleeding-edge 2.4.4-ac9 kernel -- especially for anyone planning to use
the ReiserFS filesystem in a production environment. As you might guess, a lot
has happened since 2.4.4-ac9, and it's definitely time to start looking at
newer kernels.
</p>

<p>
With kernel 2.4.10, the 2.4 series reached a new level of performance and
scalability (something that we've been anticipating for a long time). So, what
happened to allow Linux 2.4 to finally grow up? In an acronym, VM.  Linus,
recognizing that the 2.4 series wasn't performing spectacularly, ripped out
Linux's problematic VM code and replaced it with a lean and mean VM
implementation from Andrea Archangeli. Andrea's new VM implementation (which
first appeared in 2.4.10) was really great; it really sped up the kernel and
made the entire system more responsive. 2.4.10 was definitely a major turning
point in 2.4 Linux kernel development; up until then, things weren't looking
very good, and many of us were wondering why we weren't FreeBSD developers.  We
all should thank Linus for his heroism in making such a major (but sorely
needed) change in the 2.4 stable kernel series.
</p>

<p>
Since Andrea's new VM code needed a bit of time to be integrated seamlessly
with the rest of the kernel, use 2.4.13+. Even better, use 2.4.16+, since the
rock-solid ext3 filesystem code was finally integrated into the official Linus
kernel starting with the 2.4.15-pre2 release. There's no reason to avoid using
2.4.16+ kernel, and it'll make your job of getting ext3 up and running that
much easier. If you do use a 2.4.16+ kernel, just remember that it's no longer
necessary to apply the ext3 patch as described on Andrew's page (see <uri
link="#resources">Resources</uri>).  Linus already added it for you. :)
</p>

<p>
You'll notice that I recommend using 2.4.16+ rather than 2.4.15+, and with good
reason. With the release of kernel 2.4.15-pre9, a really ugly filesystem
corruption bug was introduced to the kernel. It took until 2.4.16-pre1 for the
problem to be identified and fixed, resulting in a span of kernels (including
2.4.15) that should be avoided at all costs. Choosing a 2.4.16+ kernel allows
you to avoid this bad batch entirely.
</p>

</body>
</section>
</chapter>

<chapter>
<title>Laptops...beware?</title>
<section>
<body>

<p>
Ext3 has a stellar reputation for being a rock-solid filesystem, so I was
surprised to learn that quite a few laptop users were having filesystem
corruption problems when they switched to ext3. In general, it's tempting to
react to these kinds of reports by avoiding ext3 entirely; however, after
asking around, I discovered that the disk corruption problems that people were
experiencing had nothing to do with ext3 itself, but were being caused by
certain laptop hard drives.
</p>

</body>
</section>
<section>
<title>The write cache</title>
<body>

<p>
You may not know this, but most modern hard drives have something called a
"write cache", used by the hard drive to collect pending write operations. By
putting pending writes into a cache, the hard drive firmware can then reorder
and group them so that they're written to disk in the fastest possible way.
The write cache is generally considered to be a very good thing (read Linus'
explanation and opinion of write caching in <uri
link="#resources">Resources</uri>).
</p>

<p>
Unfortunately, certain laptop hard drives now on the market have the dubious
feature of ignoring any official ATA request to flush their write cache to
disk. This isn't a wonderful design feature, although it has been allowed by
the ATA spec up until recently. With these types of drives, there's no way for
the kernel to guarantee that a particular block has actually been recorded to
the disk platters. Although this sounds like a thorny problem, this particular
issue by itself is probably not the cause of the data corruption problems that
people have been experiencing.
</p>

<p>
However, it gets worse. Some modern laptop hard drives have an even nastier
habit of throwing away their write cache whenever the system is rebooted or
suspended. Obviously, if a hard drive has both of these problems, it's going to
regularly corrupt data, and there's nothing that Linux can do to prevent it
from doing so.
</p>

<p>
So, what's the solution? If you have a laptop, tread carefully. Back up all
your important files before making any major change to your filesystems. If you
experience data corruption problems that seem to fit the pattern of what I
described above, particularly with ext3, then remember that it may be your
laptop hard drive that's at fault. In that case, you may want to contact your
laptop manufacturer and inquire about getting a replacement drive. Hopefully,
in a few months time, these flaky hard drives will be pulled from the market
and we'll never need to worry about this issue again.
</p>

<p>
Now that I've scared you out of your minds, let's take a look at ext3's various
data journaling options.
</p>

</body>
</section>
</chapter>

<chapter>
<title>Journaling options and write latency</title>
<section>
<body>

<p>
Ext3 allows you to choose from one of three data journaling modes at filesystem
mount time: data=writeback, data=ordered, and data=journal.
</p>

<p>
To specify a journal mode, you can add the appropriate string (data=journal,
for example) to the options section of your /etc/fstab, or specify the -o
data=journal command-line option when calling mount directly. If you'd like to



-- 
[email protected] mailing list

Reply via email to