Gentoo Archives: gentoo-doc-cvs

From: Xavier Neys <neysx@×××××××××××.org>
To: gentoo-doc-cvs@l.g.o
Subject: [gentoo-doc-cvs] cvs commit: lvm-p1.xml
Date: Wed, 21 Sep 2005 10:22:56
Message-Id: 200509211016.j8LAGk1d003612@robin.gentoo.org
1 neysx 05/09/21 10:22:33
2
3 Modified: xml/htdocs/doc/en/articles lvm-p1.xml lvm-p2.xml
4 Log:
5 Improved coding style *No Content Change*
6
7 Revision Changes Path
8 1.2 +195 -218 xml/htdocs/doc/en/articles/lvm-p1.xml
9
10 file : http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/articles/lvm-p1.xml?rev=1.2&content-type=text/x-cvsweb-markup&cvsroot=gentoo
11 plain: http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/articles/lvm-p1.xml?rev=1.2&content-type=text/plain&cvsroot=gentoo
12 diff : http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/articles/lvm-p1.xml.diff?r1=1.1&r2=1.2&cvsroot=gentoo
13
14 Index: lvm-p1.xml
15 ===================================================================
16 RCS file: /var/cvsroot/gentoo/xml/htdocs/doc/en/articles/lvm-p1.xml,v
17 retrieving revision 1.1
18 retrieving revision 1.2
19 diff -u -r1.1 -r1.2
20 --- lvm-p1.xml 20 Sep 2005 18:48:24 -0000 1.1
21 +++ lvm-p1.xml 21 Sep 2005 10:22:33 -0000 1.2
22 @@ -1,6 +1,6 @@
23 <?xml version="1.0" encoding="UTF-8"?>
24 <!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
25 -<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/articles/lvm-p1.xml,v 1.1 2005/09/20 18:48:24 rane Exp $ -->
26 +<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/articles/lvm-p1.xml,v 1.2 2005/09/21 10:22:33 neysx Exp $ -->
27
28 <guide link="/doc/en/articles/lvm-p1.xml">
29 <title>Learning Linux LVM, Part 1</title>
30 @@ -11,18 +11,17 @@
31 <!-- xmlified by: Joshua Saddler (jackdark@×××××.com) -->
32
33 <abstract>
34 -In this article, Daniel introduces you to the concepts behind Linux
35 -LVM (Logical Volume Management) and shows you how to get the latest
36 -kernel patches and tools installed on your system. LVM allows you to
37 -create logical volumes out of the physical storage resources on your
38 -machine. However, unlike physical volumes, the logical volumes can
39 -be expanded and shrunk while the system is still running, providing
40 -Linux system administrators with the storage flexibility that they've
41 -until now only dreamed of.
42 +In this article, Daniel introduces you to the concepts behind Linux LVM
43 +(Logical Volume Management) and shows you how to get the latest kernel patches
44 +and tools installed on your system. LVM allows you to create logical volumes
45 +out of the physical storage resources on your machine. However, unlike physical
46 +volumes, the logical volumes can be expanded and shrunk while the system is
47 +still running, providing Linux system administrators with the storage
48 +flexibility that they've until now only dreamed of.
49 </abstract>
50
51 -<!-- The original version of this article was first published on IBM
52 -developerWorks, and is property of Westtech Information Services. This
53 +<!-- The original version of this article was first published on IBM
54 +developerWorks, and is property of Westtech Information Services. This
55 document is an updated version of the original article, and contains
56 various improvements made by the Gentoo Linux Documentation team -->
57
58 @@ -36,67 +35,63 @@
59 <body>
60
61 <note>
62 -The original version of this article was first published on IBM
63 -developerWorks, and is property of Westtech Information Services. This
64 -document is an updated version of the original article, and contains
65 -various improvements made by the Gentoo Linux Documentation team.
66 +The original version of this article was first published on IBM developerWorks,
67 +and is property of Westtech Information Services. This document is an updated
68 +version of the original article, and contains various improvements made by the
69 +Gentoo Linux Documentation team.
70 </note>
71
72 <p>
73 -In this series, I'm going to show you how to install and use the new
74 -Logical Volume Management support built-in to the Linux 2.4 kernel. If
75 -you've never used a form of LVM before, you're in for a treat; it's a
76 -wonderful technology. Before we actually get LVM up and running, I'm
77 -going to explain exactly what it is and how it works. Then, we'll be
78 -ready to test out LVM and get the most out of it.
79 +In this series, I'm going to show you how to install and use the new Logical
80 +Volume Management support built-in to the Linux 2.4 kernel. If you've never
81 +used a form of LVM before, you're in for a treat; it's a wonderful technology.
82 +Before we actually get LVM up and running, I'm going to explain exactly what it
83 +is and how it works. Then, we'll be ready to test out LVM and get the most out
84 +of it.
85 </p>
86
87 <p>
88 -If you're like me, then your experience with UNIX and Linux began on
89 -a PC platform, rather than on large, commercial UNIX servers and
90 -workstations. On the basic PC, we've always had to deal with
91 -partitioning our hard drives. PC people are generally well-acquainted
92 -with tools such as <c>fdisk</c>, which are used to create and delete
93 -primary and extended partitions on hard disks. Hard disk partitioning
94 -is an annoying but accepted part of the process of getting an
95 +If you're like me, then your experience with UNIX and Linux began on a PC
96 +platform, rather than on large, commercial UNIX servers and workstations. On
97 +the basic PC, we've always had to deal with partitioning our hard drives. PC
98 +people are generally well-acquainted with tools such as <c>fdisk</c>, which are
99 +used to create and delete primary and extended partitions on hard disks. Hard
100 +disk partitioning is an annoying but accepted part of the process of getting an
101 operating system up and running.
102 </p>
103
104 <p>
105 -Hard drive partitioning can be annoying because to do a good job you
106 -really need to accurately estimate how much space you'll need for
107 -each partition. If you make a poor estimation, your Linux system
108 -could possibly be crippled -- to fix the problem, it's possible that
109 -you might even need to perform a full system backup, wipe your hard
110 -drives clean, and then restore all your data to a new (and presumably
111 -better) partition layout. Ick! These are exactly the kinds of
112 -situations that sysadmins try their best to avoid in the first place.
113 +Hard drive partitioning can be annoying because to do a good job you really
114 +need to accurately estimate how much space you'll need for each partition. If
115 +you make a poor estimation, your Linux system could possibly be crippled -- to
116 +fix the problem, it's possible that you might even need to perform a full
117 +system backup, wipe your hard drives clean, and then restore all your data to a
118 +new (and presumably better) partition layout. Ick! These are exactly the kinds
119 +of situations that sysadmins try their best to avoid in the first place.
120 </p>
121
122 <p>
123 -While partitions were once static storage regions, thankfully, we now
124 -have a proliferation of PC repartitioning tools (PowerQuest's
125 -Partition Magic product is one of the most popular). These tools allow
126 -you to boot your system with a special disk and dynamically resize
127 -your partitions and filesystems. Once you reboot, you have newly
128 -resized partitions, hopefully getting you out of your storage crunch.
129 -These partition resizing tools are great and solve the problem storage
130 -management for some. But are they perfect? Not exactly.
131 +While partitions were once static storage regions, thankfully, we now have a
132 +proliferation of PC repartitioning tools (PowerQuest's Partition Magic product
133 +is one of the most popular). These tools allow you to boot your system with a
134 +special disk and dynamically resize your partitions and filesystems. Once you
135 +reboot, you have newly resized partitions, hopefully getting you out of your
136 +storage crunch. These partition resizing tools are great and solve the problem
137 +storage management for some. But are they perfect? Not exactly.
138 </p>
139
140 <p>
141 -Tools like Partition Magic are great for workstations, but aren't
142 -really adequate for servers. First of all, they require you to reboot
143 -your system. This is something most sysadmins desperately try to avoid
144 -doing. What if you simply can't reboot your machine every time your
145 -storage needs change, such as if your storage needs change dramatically
146 -on a weekly basis? What happens if you need to expand a filesystem so
147 -that it spans more than one hard drive, or what do you do if you need
148 -to dynamically expand or shrink a volume's storage capacity while
149 -allowing Apache to continue to serve Web pages? In a highly available,
150 -dynamic environment, a basic partition resizer just won't work. For
151 -these and other situations, Logical Volume Management is an excellent
152 -(if not perfect) solution.
153 +Tools like Partition Magic are great for workstations, but aren't really
154 +adequate for servers. First of all, they require you to reboot your system.
155 +This is something most sysadmins desperately try to avoid doing. What if you
156 +simply can't reboot your machine every time your storage needs change, such as
157 +if your storage needs change dramatically on a weekly basis? What happens if
158 +you need to expand a filesystem so that it spans more than one hard drive, or
159 +what do you do if you need to dynamically expand or shrink a volume's storage
160 +capacity while allowing Apache to continue to serve Web pages? In a highly
161 +available, dynamic environment, a basic partition resizer just won't work. For
162 +these and other situations, Logical Volume Management is an excellent (if not
163 +perfect) solution.
164 </p>
165
166 </body>
167 @@ -106,45 +101,42 @@
168 <body>
169
170 <p>
171 -Now, let's take a look at how LVM solves these problems. To create an
172 -LVM logical volume, we follow a three-step process. First, we need to
173 -select the physical storage resources that are going to be used for
174 -LVM. Typically, these are standard partitions but can also be Linux
175 -software RAID volumes that we've created. In LVM terminology, these
176 -storage resources are called "physical volumes". Our first step in
177 -setting up LVM involves properly initializing these partitions so
178 -that they can be recognized by the LVM system. This involves setting
179 -the correct partition type if we're adding a physical partition, and
180 +Now, let's take a look at how LVM solves these problems. To create an LVM
181 +logical volume, we follow a three-step process. First, we need to select the
182 +physical storage resources that are going to be used for LVM. Typically, these
183 +are standard partitions but can also be Linux software RAID volumes that we've
184 +created. In LVM terminology, these storage resources are called "physical
185 +volumes". Our first step in setting up LVM involves properly initializing these
186 +partitions so that they can be recognized by the LVM system. This involves
187 +setting the correct partition type if we're adding a physical partition, and
188 running the pvcreate command.
189 </p>
190
191 <p>
192 -Once we have one or more physical volumes initialized for use by LVM,
193 -we can move on to step two -- creating a volume group. You can think
194 -of a volume group as a pool of storage that consists of one or more
195 -physical volumes. While LVM is running, we can add physical volumes
196 -to the volume group or even remove them. However, we can't mount or
197 -create filesystems on a volume group directly. Instead, we can tell
198 -LVM to create one or more "logical volumes" using our volume group
199 -storage pool:
200 +Once we have one or more physical volumes initialized for use by LVM, we can
201 +move on to step two -- creating a volume group. You can think of a volume group
202 +as a pool of storage that consists of one or more physical volumes. While LVM
203 +is running, we can add physical volumes to the volume group or even remove
204 +them. However, we can't mount or create filesystems on a volume group directly.
205 +Instead, we can tell LVM to create one or more "logical volumes" using our
206 +volume group storage pool:
207 </p>
208
209 -<figure link="/images/docs/l-lvm-1.gif" caption="A volume group is
210 +<figure link="/images/docs/l-lvm-1.gif" caption="A volume group is
211 created out of physical volumes"/>
212
213
214
215
216 1.2 +173 -189 xml/htdocs/doc/en/articles/lvm-p2.xml
217
218 file : http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/articles/lvm-p2.xml?rev=1.2&content-type=text/x-cvsweb-markup&cvsroot=gentoo
219 plain: http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/articles/lvm-p2.xml?rev=1.2&content-type=text/plain&cvsroot=gentoo
220 diff : http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/articles/lvm-p2.xml.diff?r1=1.1&r2=1.2&cvsroot=gentoo
221
222 Index: lvm-p2.xml
223 ===================================================================
224 RCS file: /var/cvsroot/gentoo/xml/htdocs/doc/en/articles/lvm-p2.xml,v
225 retrieving revision 1.1
226 retrieving revision 1.2
227 diff -u -r1.1 -r1.2
228 --- lvm-p2.xml 20 Sep 2005 18:48:24 -0000 1.1
229 +++ lvm-p2.xml 21 Sep 2005 10:22:33 -0000 1.2
230 @@ -1,6 +1,6 @@
231 <?xml version="1.0" encoding="UTF-8"?>
232 <!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
233 -<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/articles/lvm-p2.xml,v 1.1 2005/09/20 18:48:24 rane Exp $ -->
234 +<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/articles/lvm-p2.xml,v 1.2 2005/09/21 10:22:33 neysx Exp $ -->
235
236 <guide link="/doc/en/articles/lvm-p2.xml">
237 <title>Learning Linux LVM, Part 2</title>
238 @@ -11,18 +11,17 @@
239 <!-- xmlified by: Joshua Saddler (jackdark@×××××.com) -->
240
241 <abstract>
242 -In this article, Daniel shares his experiences converting
243 -cvs.gentoo.org's /home filesystem to an LVM logical volume. After
244 -the transition, we get to see the benefits of LVM when
245 -cvs.gentoo.org's /home partition is dynamically resized in real-time,
246 -without rebooting, unmounting /home, or even dropping to runlevel 1.
247 -All processes continue to work without any interruption. Daniel's
248 -step-by-step details of the conversion will help anyone interested
249 -in peforming a similiar transition on their own machine.
250 +In this article, Daniel shares his experiences converting cvs.gentoo.org's
251 +/home filesystem to an LVM logical volume. After the transition, we get to see
252 +the benefits of LVM when cvs.gentoo.org's /home partition is dynamically
253 +resized in real-time, without rebooting, unmounting /home, or even dropping to
254 +runlevel 1. All processes continue to work without any interruption. Daniel's
255 +step-by-step details of the conversion will help anyone interested in peforming
256 +a similar transition on their own machine.
257 </abstract>
258
259 -<!-- The original version of this article was first published on IBM
260 -developerWorks, and is property of Westtech Information Services. This
261 +<!-- The original version of this article was first published on IBM
262 +developerWorks, and is property of Westtech Information Services. This
263 document is an updated version of the original article, and contains
264 various improvements made by the Gentoo Linux Documentation team -->
265
266 @@ -36,39 +35,38 @@
267 <body>
268
269 <note>
270 -The original version of this article was first published on IBM
271 -developerWorks, and is property of Westtech Information Services. This
272 -document is an updated version of the original article, and contains
273 -various improvements made by the Gentoo Linux Documentation team.
274 +The original version of this article was first published on IBM developerWorks,
275 +and is property of Westtech Information Services. This document is an updated
276 +version of the original article, and contains various improvements made by the
277 +Gentoo Linux Documentation team.
278 </note>
279
280 <p>
281 -In <uri link="/doc/en/articles/lvm-p1.xml">my first LVM article</uri>,
282 -I explained the concepts behind LVM. Now it's time to put LVM into
283 -action. In this article, I'm going to set up LVM on the official Gentoo
284 -Linux cvs server, cvs.gentoo.org. Although cvs.gentoo.org has only one
285 -hard drive, LVM's flexibility still provides an incredible improvement
286 -over the standard static partitioning approach. I'll show you all the
287 -steps of the LVM conversion process, so that if you're interested you
288 -can perform a similar conversion on one of your machines.
289 +In <uri link="/doc/en/articles/lvm-p1.xml">my first LVM article</uri>, I
290 +explained the concepts behind LVM. Now it's time to put LVM into action. In
291 +this article, I'm going to set up LVM on the official Gentoo Linux cvs server,
292 +cvs.gentoo.org. Although cvs.gentoo.org has only one hard drive, LVM's
293 +flexibility still provides an incredible improvement over the standard static
294 +partitioning approach. I'll show you all the steps of the LVM conversion
295 +process, so that if you're interested you can perform a similar conversion on
296 +one of your machines.
297 </p>
298
299 <warn>
300 -Because implementing LVM is a major change to the system (involving the
301 -creation of new partitions and other potentially hazardous actions)
302 -it's a really good idea to perform a full system backup before
303 -beginning this process. If you're not going to perform a backup, I
304 -hope you're using a test box with no important data on it. I should
305 -mention that I didn't experience any problems while converting to LVM,
306 -but it's best to be prepared in case something goes wrong.
307 +Because implementing LVM is a major change to the system (involving the
308 +creation of new partitions and other potentially hazardous actions) it's a
309 +really good idea to perform a full system backup before beginning this process.
310 +If you're not going to perform a backup, I hope you're using a test box with no
311 +important data on it. I should mention that I didn't experience any problems
312 +while converting to LVM, but it's best to be prepared in case something goes
313 +wrong.
314 </warn>
315
316 <p>
317 -That said, let's continue. Before starting the conversion process, I
318 -upgraded cvs.gentoo.org so that it was using the following packages. At
319 -the time I performed the LVM transition, these were the latest versions
320 -available (see <uri link="#resources">Resources</uri> later in this
321 -article):
322 +That said, let's continue. Before starting the conversion process, I upgraded
323 +cvs.gentoo.org so that it was using the following packages. At the time I
324 +performed the LVM transition, these were the latest versions available (see
325 +<uri link="#resources">Resources</uri> later in this article):
326 </p>
327
328 <ul>
329 @@ -78,13 +76,12 @@
330 </ul>
331
332 <p>
333 -Now, for the hard drive. cvs.gentoo.org had a nice new IBM 45 GB hard
334 -drive sitting in it; however, when I installed Gentoo Linux on cvs, I
335 -only partitioned about 10 gigabytes of the drive, keeping the remaining
336 -35 GB for future partitions. Such are the little tricks you need to
337 -employ when not using LVM -- leaving part of the drive unpartitioned is
338 -a primitive but effective way to allow for future expansion. However,
339 -with LVM there is a better approach.
340 +Now, for the hard drive. cvs.gentoo.org had a nice new IBM 45 GB hard drive
341 +sitting in it; however, when I installed Gentoo Linux on cvs, I only
342 +partitioned about 10 gigabytes of the drive, keeping the remaining 35 GB for
343 +future partitions. Such are the little tricks you need to employ when not using
344 +LVM -- leaving part of the drive unpartitioned is a primitive but effective way
345 +to allow for future expansion. However, with LVM there is a better approach.
346 </p>
347
348 </body>
349 @@ -94,9 +91,8 @@
350 <body>
351
352 <p>
353 -In the past few weeks, I had been noticing that my root ReiserFS
354 -partition had been slowly filling up, as you can see from this
355 -<c>df</c> output:
356 +In the past few weeks, I had been noticing that my root ReiserFS partition had
357 +been slowly filling up, as you can see from this <c>df</c> output:
358 </p>
359
360 <pre caption="Shrinking free space">
361 @@ -106,29 +102,28 @@
362 </pre>
363
364 <p>
365 -Now, a 72% full root partition isn't exactly a crisis, but it isn't a
366 -wonderful situation either. ReiserFS, like many other filesystems,
367 -starts slowing down as it gets more and more full, and it was just a
368 -matter of time before my root filesystem would fill up completely and
369 -filesystem performance would take a hit.
370 +Now, a 72% full root partition isn't exactly a crisis, but it isn't a wonderful
371 +situation either. ReiserFS, like many other filesystems, starts slowing down as
372 +it gets more and more full, and it was just a matter of time before my root
373 +filesystem would fill up completely and filesystem performance would take a
374 +hit.
375 </p>
376
377 <p>
378 -I decided to fix this problem by using LVM to create a new logical
379 -volume out of the 35 GB of currently unpartitioned space at the end
380 -of my hard drive. Then, I'd create a filesystem on this volume and
381 -move a good chunk of the contents of <path>/dev/hda3</path> to it.
382 +I decided to fix this problem by using LVM to create a new logical volume out
383 +of the 35 GB of currently unpartitioned space at the end of my hard drive.
384 +Then, I'd create a filesystem on this volume and move a good chunk of the
385 +contents of <path>/dev/hda3</path> to it.
386 </p>
387
388 <p>
389 -If you're thinking of making a similar transition on one of your
390 -machines, the first thing you need to do is find a suitable piece of
391 -your root filesystem to move to a logical volume. For me, the choice
392 -was easy -- my <path>/home</path> tree was taking up around 5.7 GB. By
393 -moving <path>/home</path> to its own LVM logical volume, my root
394 -filesystem would then be at about 20% capacity. Since most new data is
395 -being added to <path>/home</path>, my root filesystem would likely stay
396 -at around 20% capacity as well -- a very healthy situation.
397 +If you're thinking of making a similar transition on one of your machines, the
398 +first thing you need to do is find a suitable piece of your root filesystem to
399 +move to a logical volume. For me, the choice was easy -- my <path>/home</path>
400 +tree was taking up around 5.7 GB. By moving <path>/home</path> to its own LVM
401 +logical volume, my root filesystem would then be at about 20% capacity. Since
402 +most new data is being added to <path>/home</path>, my root filesystem would
403 +likely stay at around 20% capacity as well -- a very healthy situation.
404 </p>
405
406 </body>
407 @@ -138,12 +133,12 @@
408 <body>
409
410 <p>
411 -To begin the conversion, I first had to partition the unused space at
412 -the end of my hard drive. Using <c>cfdisk</c>, I created a 35 GB
413 -partition (<path>/dev/hda5</path>) and set the partition type of the
414 -partition to <c>8E</c> (the official LVM partition type). After this
415 -change, I rebooted to force a reread of my partition table. After the
416 -reboot, my partition table looked like this:
417 +To begin the conversion, I first had to partition the unused space at the end
418 +of my hard drive. Using <c>cfdisk</c>, I created a 35 GB partition
419 +(<path>/dev/hda5</path>) and set the partition type of the partition to
420 +<c>8E</c> (the official LVM partition type). After this change, I rebooted to
421
422
423
424 --
425 gentoo-doc-cvs@g.o mailing list