1 |
rane 05/10/01 17:16:24 |
2 |
|
3 |
Added: xml/htdocs/doc/en/articles l-afig-p8.xml |
4 |
Log: |
5 |
new article from #103294 |
6 |
|
7 |
Revision Changes Path |
8 |
1.1 xml/htdocs/doc/en/articles/l-afig-p8.xml |
9 |
|
10 |
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 |
11 |
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 |
12 |
|
13 |
Index: l-afig-p8.xml |
14 |
=================================================================== |
15 |
<?xml version='1.0' encoding='UTF-8'?> |
16 |
<!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> |
17 |
<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/articles/l-afig-p8.xml,v 1.1 2005/10/01 17:16:24 rane Exp $ --> |
18 |
|
19 |
<guide link="/doc/en/articles/l-afig-p8.xml"> |
20 |
|
21 |
<title>Advanced filesystem implementor's guide, Part 8</title> |
22 |
|
23 |
<author title="Author"> |
24 |
<mail link="drobbins@g.o">Daniel Robbins</mail> |
25 |
</author> |
26 |
<!-- xmlified by David H. Askew (dhaskew@×××××××××.net)--> |
27 |
|
28 |
<!-- The original version of this article was first published on IBM |
29 |
developerWorks, and is property of Westtech Information Services. This |
30 |
document is an updated version of the original article, and contains |
31 |
various improvements made by the Gentoo Linux Documentation team --> |
32 |
|
33 |
<abstract> |
34 |
With the 2.4 release of Linux come many new filesystem possibilities, |
35 |
including Reiserfs, XFS, GFS, and others. These filesystems sound cool, but |
36 |
what exactly can they do, what are they good at, and exactly how do you go |
37 |
about safely using them in a production Linux environment? Daniel Robbins |
38 |
answers these questions by showing you how to set up these new advanced |
39 |
filesystems under Linux 2.4. In this installment, Daniel continues his look |
40 |
at ext3, a new improved version of ext2 with journaling capabilities. He |
41 |
reveals all the inside information on ext3, and demonstrates some shockingly |
42 |
good ext3 data=journal interactive performance numbers. |
43 |
</abstract> |
44 |
|
45 |
<version>1.0</version> |
46 |
<date>2005-09-30</date> |
47 |
|
48 |
<chapter> |
49 |
<title>Introduction</title> |
50 |
<section> |
51 |
<body> |
52 |
|
53 |
<note> |
54 |
The original version of this article was first published on IBM developerWorks, |
55 |
and is property of Westtech Information Services. This document is an updated |
56 |
version of the original article, and contains various improvements made by the |
57 |
Gentoo Linux Documentation team. |
58 |
</note> |
59 |
|
60 |
<p> |
61 |
I'm going to be honest. For this article, I was planning to show you how to get |
62 |
ext3 up and running on your system. Although that's what I said I'd do, I'm not |
63 |
going to do it. Andrew Morton's excellent "Using the ext3 filesystem in 2.4 |
64 |
kernels" page (see <uri link="#resources">Resources</uri> later in this |
65 |
article) already does a great job of explaining how to ext3-enable your system, |
66 |
so there's no need for me to repeat all the basics here. Instead, I'm going to |
67 |
delve into some meatier ext3 topics, ones that I think you'll find very useful. |
68 |
After you read this article, when you're ready to get ext3 up and running, head |
69 |
over to Andrew's page. |
70 |
</p> |
71 |
|
72 |
</body> |
73 |
</section> |
74 |
</chapter> |
75 |
|
76 |
<chapter> |
77 |
<title>2.4 kernel update</title> |
78 |
<section> |
79 |
<body> |
80 |
|
81 |
<p> |
82 |
First, let's start with a 2.4 kernel update. I last discussed 2.4 kernel |
83 |
stability when I was covering ReiserFS. Way back then, finding a stable 2.4 |
84 |
kernel was a challenge, and I recommended sticking with the known and at that |
85 |
time bleeding-edge 2.4.4-ac9 kernel -- especially for anyone planning to use |
86 |
the ReiserFS filesystem in a production environment. As you might guess, a lot |
87 |
has happened since 2.4.4-ac9, and it's definitely time to start looking at |
88 |
newer kernels. |
89 |
</p> |
90 |
|
91 |
<p> |
92 |
With kernel 2.4.10, the 2.4 series reached a new level of performance and |
93 |
scalability (something that we've been anticipating for a long time). So, what |
94 |
happened to allow Linux 2.4 to finally grow up? In an acronym, VM. Linus, |
95 |
recognizing that the 2.4 series wasn't performing spectacularly, ripped out |
96 |
Linux's problematic VM code and replaced it with a lean and mean VM |
97 |
implementation from Andrea Archangeli. Andrea's new VM implementation (which |
98 |
first appeared in 2.4.10) was really great; it really sped up the kernel and |
99 |
made the entire system more responsive. 2.4.10 was definitely a major turning |
100 |
point in 2.4 Linux kernel development; up until then, things weren't looking |
101 |
very good, and many of us were wondering why we weren't FreeBSD developers. We |
102 |
all should thank Linus for his heroism in making such a major (but sorely |
103 |
needed) change in the 2.4 stable kernel series. |
104 |
</p> |
105 |
|
106 |
<p> |
107 |
Since Andrea's new VM code needed a bit of time to be integrated seamlessly |
108 |
with the rest of the kernel, use 2.4.13+. Even better, use 2.4.16+, since the |
109 |
rock-solid ext3 filesystem code was finally integrated into the official Linus |
110 |
kernel starting with the 2.4.15-pre2 release. There's no reason to avoid using |
111 |
2.4.16+ kernel, and it'll make your job of getting ext3 up and running that |
112 |
much easier. If you do use a 2.4.16+ kernel, just remember that it's no longer |
113 |
necessary to apply the ext3 patch as described on Andrew's page (see <uri |
114 |
link="#resources">Resources</uri>). Linus already added it for you. :) |
115 |
</p> |
116 |
|
117 |
<p> |
118 |
You'll notice that I recommend using 2.4.16+ rather than 2.4.15+, and with good |
119 |
reason. With the release of kernel 2.4.15-pre9, a really ugly filesystem |
120 |
corruption bug was introduced to the kernel. It took until 2.4.16-pre1 for the |
121 |
problem to be identified and fixed, resulting in a span of kernels (including |
122 |
2.4.15) that should be avoided at all costs. Choosing a 2.4.16+ kernel allows |
123 |
you to avoid this bad batch entirely. |
124 |
</p> |
125 |
|
126 |
</body> |
127 |
</section> |
128 |
</chapter> |
129 |
|
130 |
<chapter> |
131 |
<title>Laptops...beware?</title> |
132 |
<section> |
133 |
<body> |
134 |
|
135 |
<p> |
136 |
Ext3 has a stellar reputation for being a rock-solid filesystem, so I was |
137 |
surprised to learn that quite a few laptop users were having filesystem |
138 |
corruption problems when they switched to ext3. In general, it's tempting to |
139 |
react to these kinds of reports by avoiding ext3 entirely; however, after |
140 |
asking around, I discovered that the disk corruption problems that people were |
141 |
experiencing had nothing to do with ext3 itself, but were being caused by |
142 |
certain laptop hard drives. |
143 |
</p> |
144 |
|
145 |
</body> |
146 |
</section> |
147 |
<section> |
148 |
<title>The write cache</title> |
149 |
<body> |
150 |
|
151 |
<p> |
152 |
You may not know this, but most modern hard drives have something called a |
153 |
"write cache", used by the hard drive to collect pending write operations. By |
154 |
putting pending writes into a cache, the hard drive firmware can then reorder |
155 |
and group them so that they're written to disk in the fastest possible way. |
156 |
The write cache is generally considered to be a very good thing (read Linus' |
157 |
explanation and opinion of write caching in <uri |
158 |
link="#resources">Resources</uri>). |
159 |
</p> |
160 |
|
161 |
<p> |
162 |
Unfortunately, certain laptop hard drives now on the market have the dubious |
163 |
feature of ignoring any official ATA request to flush their write cache to |
164 |
disk. This isn't a wonderful design feature, although it has been allowed by |
165 |
the ATA spec up until recently. With these types of drives, there's no way for |
166 |
the kernel to guarantee that a particular block has actually been recorded to |
167 |
the disk platters. Although this sounds like a thorny problem, this particular |
168 |
issue by itself is probably not the cause of the data corruption problems that |
169 |
people have been experiencing. |
170 |
</p> |
171 |
|
172 |
<p> |
173 |
However, it gets worse. Some modern laptop hard drives have an even nastier |
174 |
habit of throwing away their write cache whenever the system is rebooted or |
175 |
suspended. Obviously, if a hard drive has both of these problems, it's going to |
176 |
regularly corrupt data, and there's nothing that Linux can do to prevent it |
177 |
from doing so. |
178 |
</p> |
179 |
|
180 |
<p> |
181 |
So, what's the solution? If you have a laptop, tread carefully. Back up all |
182 |
your important files before making any major change to your filesystems. If you |
183 |
experience data corruption problems that seem to fit the pattern of what I |
184 |
described above, particularly with ext3, then remember that it may be your |
185 |
laptop hard drive that's at fault. In that case, you may want to contact your |
186 |
laptop manufacturer and inquire about getting a replacement drive. Hopefully, |
187 |
in a few months time, these flaky hard drives will be pulled from the market |
188 |
and we'll never need to worry about this issue again. |
189 |
</p> |
190 |
|
191 |
<p> |
192 |
Now that I've scared you out of your minds, let's take a look at ext3's various |
193 |
data journaling options. |
194 |
</p> |
195 |
|
196 |
</body> |
197 |
</section> |
198 |
</chapter> |
199 |
|
200 |
<chapter> |
201 |
<title>Journaling options and write latency</title> |
202 |
<section> |
203 |
<body> |
204 |
|
205 |
<p> |
206 |
Ext3 allows you to choose from one of three data journaling modes at filesystem |
207 |
mount time: data=writeback, data=ordered, and data=journal. |
208 |
</p> |
209 |
|
210 |
<p> |
211 |
To specify a journal mode, you can add the appropriate string (data=journal, |
212 |
for example) to the options section of your /etc/fstab, or specify the -o |
213 |
data=journal command-line option when calling mount directly. If you'd like to |
214 |
|
215 |
|
216 |
|
217 |
-- |
218 |
gentoo-doc-cvs@g.o mailing list |