neysx 05/09/21 10:22:33 Modified: xml/htdocs/doc/en/articles lvm-p1.xml lvm-p2.xml Log: Improved coding style *No Content Change*
Revision Changes Path 1.2 +195 -218 xml/htdocs/doc/en/articles/lvm-p1.xml 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 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 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 Index: lvm-p1.xml =================================================================== RCS file: /var/cvsroot/gentoo/xml/htdocs/doc/en/articles/lvm-p1.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- lvm-p1.xml 20 Sep 2005 18:48:24 -0000 1.1 +++ lvm-p1.xml 21 Sep 2005 10:22:33 -0000 1.2 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> -<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/articles/lvm-p1.xml,v 1.1 2005/09/20 18:48:24 rane Exp $ --> +<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/articles/lvm-p1.xml,v 1.2 2005/09/21 10:22:33 neysx Exp $ --> <guide link="/doc/en/articles/lvm-p1.xml"> <title>Learning Linux LVM, Part 1</title> @@ -11,18 +11,17 @@ <!-- xmlified by: Joshua Saddler ([EMAIL PROTECTED]) --> <abstract> -In this article, Daniel introduces you to the concepts behind Linux -LVM (Logical Volume Management) and shows you how to get the latest -kernel patches and tools installed on your system. LVM allows you to -create logical volumes out of the physical storage resources on your -machine. However, unlike physical volumes, the logical volumes can -be expanded and shrunk while the system is still running, providing -Linux system administrators with the storage flexibility that they've -until now only dreamed of. +In this article, Daniel introduces you to the concepts behind Linux LVM +(Logical Volume Management) and shows you how to get the latest kernel patches +and tools installed on your system. LVM allows you to create logical volumes +out of the physical storage resources on your machine. However, unlike physical +volumes, the logical volumes can be expanded and shrunk while the system is +still running, providing Linux system administrators with the storage +flexibility that they've until now only dreamed of. </abstract> -<!-- The original version of this article was first published on IBM -developerWorks, and is property of Westtech Information Services. This +<!-- 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 --> @@ -36,67 +35,63 @@ <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. +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> -In this series, I'm going to show you how to install and use the new -Logical Volume Management support built-in to the Linux 2.4 kernel. If -you've never used a form of LVM before, you're in for a treat; it's a -wonderful technology. Before we actually get LVM up and running, I'm -going to explain exactly what it is and how it works. Then, we'll be -ready to test out LVM and get the most out of it. +In this series, I'm going to show you how to install and use the new Logical +Volume Management support built-in to the Linux 2.4 kernel. If you've never +used a form of LVM before, you're in for a treat; it's a wonderful technology. +Before we actually get LVM up and running, I'm going to explain exactly what it +is and how it works. Then, we'll be ready to test out LVM and get the most out +of it. </p> <p> -If you're like me, then your experience with UNIX and Linux began on -a PC platform, rather than on large, commercial UNIX servers and -workstations. On the basic PC, we've always had to deal with -partitioning our hard drives. PC people are generally well-acquainted -with tools such as <c>fdisk</c>, which are used to create and delete -primary and extended partitions on hard disks. Hard disk partitioning -is an annoying but accepted part of the process of getting an +If you're like me, then your experience with UNIX and Linux began on a PC +platform, rather than on large, commercial UNIX servers and workstations. On +the basic PC, we've always had to deal with partitioning our hard drives. PC +people are generally well-acquainted with tools such as <c>fdisk</c>, which are +used to create and delete primary and extended partitions on hard disks. Hard +disk partitioning is an annoying but accepted part of the process of getting an operating system up and running. </p> <p> -Hard drive partitioning can be annoying because to do a good job you -really need to accurately estimate how much space you'll need for -each partition. If you make a poor estimation, your Linux system -could possibly be crippled -- to fix the problem, it's possible that -you might even need to perform a full system backup, wipe your hard -drives clean, and then restore all your data to a new (and presumably -better) partition layout. Ick! These are exactly the kinds of -situations that sysadmins try their best to avoid in the first place. +Hard drive partitioning can be annoying because to do a good job you really +need to accurately estimate how much space you'll need for each partition. If +you make a poor estimation, your Linux system could possibly be crippled -- to +fix the problem, it's possible that you might even need to perform a full +system backup, wipe your hard drives clean, and then restore all your data to a +new (and presumably better) partition layout. Ick! These are exactly the kinds +of situations that sysadmins try their best to avoid in the first place. </p> <p> -While partitions were once static storage regions, thankfully, we now -have a proliferation of PC repartitioning tools (PowerQuest's -Partition Magic product is one of the most popular). These tools allow -you to boot your system with a special disk and dynamically resize -your partitions and filesystems. Once you reboot, you have newly -resized partitions, hopefully getting you out of your storage crunch. -These partition resizing tools are great and solve the problem storage -management for some. But are they perfect? Not exactly. +While partitions were once static storage regions, thankfully, we now have a +proliferation of PC repartitioning tools (PowerQuest's Partition Magic product +is one of the most popular). These tools allow you to boot your system with a +special disk and dynamically resize your partitions and filesystems. Once you +reboot, you have newly resized partitions, hopefully getting you out of your +storage crunch. These partition resizing tools are great and solve the problem +storage management for some. But are they perfect? Not exactly. </p> <p> -Tools like Partition Magic are great for workstations, but aren't -really adequate for servers. First of all, they require you to reboot -your system. This is something most sysadmins desperately try to avoid -doing. What if you simply can't reboot your machine every time your -storage needs change, such as if your storage needs change dramatically -on a weekly basis? What happens if you need to expand a filesystem so -that it spans more than one hard drive, or what do you do if you need -to dynamically expand or shrink a volume's storage capacity while -allowing Apache to continue to serve Web pages? In a highly available, -dynamic environment, a basic partition resizer just won't work. For -these and other situations, Logical Volume Management is an excellent -(if not perfect) solution. +Tools like Partition Magic are great for workstations, but aren't really +adequate for servers. First of all, they require you to reboot your system. +This is something most sysadmins desperately try to avoid doing. What if you +simply can't reboot your machine every time your storage needs change, such as +if your storage needs change dramatically on a weekly basis? What happens if +you need to expand a filesystem so that it spans more than one hard drive, or +what do you do if you need to dynamically expand or shrink a volume's storage +capacity while allowing Apache to continue to serve Web pages? In a highly +available, dynamic environment, a basic partition resizer just won't work. For +these and other situations, Logical Volume Management is an excellent (if not +perfect) solution. </p> </body> @@ -106,45 +101,42 @@ <body> <p> -Now, let's take a look at how LVM solves these problems. To create an -LVM logical volume, we follow a three-step process. First, we need to -select the physical storage resources that are going to be used for -LVM. Typically, these are standard partitions but can also be Linux -software RAID volumes that we've created. In LVM terminology, these -storage resources are called "physical volumes". Our first step in -setting up LVM involves properly initializing these partitions so -that they can be recognized by the LVM system. This involves setting -the correct partition type if we're adding a physical partition, and +Now, let's take a look at how LVM solves these problems. To create an LVM +logical volume, we follow a three-step process. First, we need to select the +physical storage resources that are going to be used for LVM. Typically, these +are standard partitions but can also be Linux software RAID volumes that we've +created. In LVM terminology, these storage resources are called "physical +volumes". Our first step in setting up LVM involves properly initializing these +partitions so that they can be recognized by the LVM system. This involves +setting the correct partition type if we're adding a physical partition, and running the pvcreate command. </p> <p> -Once we have one or more physical volumes initialized for use by LVM, -we can move on to step two -- creating a volume group. You can think -of a volume group as a pool of storage that consists of one or more -physical volumes. While LVM is running, we can add physical volumes -to the volume group or even remove them. However, we can't mount or -create filesystems on a volume group directly. Instead, we can tell -LVM to create one or more "logical volumes" using our volume group -storage pool: +Once we have one or more physical volumes initialized for use by LVM, we can +move on to step two -- creating a volume group. You can think of a volume group +as a pool of storage that consists of one or more physical volumes. While LVM +is running, we can add physical volumes to the volume group or even remove +them. However, we can't mount or create filesystems on a volume group directly. +Instead, we can tell LVM to create one or more "logical volumes" using our +volume group storage pool: </p> -<figure link="/images/docs/l-lvm-1.gif" caption="A volume group is +<figure link="/images/docs/l-lvm-1.gif" caption="A volume group is created out of physical volumes"/> 1.2 +173 -189 xml/htdocs/doc/en/articles/lvm-p2.xml 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 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 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 Index: lvm-p2.xml =================================================================== RCS file: /var/cvsroot/gentoo/xml/htdocs/doc/en/articles/lvm-p2.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- lvm-p2.xml 20 Sep 2005 18:48:24 -0000 1.1 +++ lvm-p2.xml 21 Sep 2005 10:22:33 -0000 1.2 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> -<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/articles/lvm-p2.xml,v 1.1 2005/09/20 18:48:24 rane Exp $ --> +<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/articles/lvm-p2.xml,v 1.2 2005/09/21 10:22:33 neysx Exp $ --> <guide link="/doc/en/articles/lvm-p2.xml"> <title>Learning Linux LVM, Part 2</title> @@ -11,18 +11,17 @@ <!-- xmlified by: Joshua Saddler ([EMAIL PROTECTED]) --> <abstract> -In this article, Daniel shares his experiences converting -cvs.gentoo.org's /home filesystem to an LVM logical volume. After -the transition, we get to see the benefits of LVM when -cvs.gentoo.org's /home partition is dynamically resized in real-time, -without rebooting, unmounting /home, or even dropping to runlevel 1. -All processes continue to work without any interruption. Daniel's -step-by-step details of the conversion will help anyone interested -in peforming a similiar transition on their own machine. +In this article, Daniel shares his experiences converting cvs.gentoo.org's +/home filesystem to an LVM logical volume. After the transition, we get to see +the benefits of LVM when cvs.gentoo.org's /home partition is dynamically +resized in real-time, without rebooting, unmounting /home, or even dropping to +runlevel 1. All processes continue to work without any interruption. Daniel's +step-by-step details of the conversion will help anyone interested in peforming +a similar transition on their own machine. </abstract> -<!-- The original version of this article was first published on IBM -developerWorks, and is property of Westtech Information Services. This +<!-- 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 --> @@ -36,39 +35,38 @@ <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. +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> -In <uri link="/doc/en/articles/lvm-p1.xml">my first LVM article</uri>, -I explained the concepts behind LVM. Now it's time to put LVM into -action. In this article, I'm going to set up LVM on the official Gentoo -Linux cvs server, cvs.gentoo.org. Although cvs.gentoo.org has only one -hard drive, LVM's flexibility still provides an incredible improvement -over the standard static partitioning approach. I'll show you all the -steps of the LVM conversion process, so that if you're interested you -can perform a similar conversion on one of your machines. +In <uri link="/doc/en/articles/lvm-p1.xml">my first LVM article</uri>, I +explained the concepts behind LVM. Now it's time to put LVM into action. In +this article, I'm going to set up LVM on the official Gentoo Linux cvs server, +cvs.gentoo.org. Although cvs.gentoo.org has only one hard drive, LVM's +flexibility still provides an incredible improvement over the standard static +partitioning approach. I'll show you all the steps of the LVM conversion +process, so that if you're interested you can perform a similar conversion on +one of your machines. </p> <warn> -Because implementing LVM is a major change to the system (involving the -creation of new partitions and other potentially hazardous actions) -it's a really good idea to perform a full system backup before -beginning this process. If you're not going to perform a backup, I -hope you're using a test box with no important data on it. I should -mention that I didn't experience any problems while converting to LVM, -but it's best to be prepared in case something goes wrong. +Because implementing LVM is a major change to the system (involving the +creation of new partitions and other potentially hazardous actions) it's a +really good idea to perform a full system backup before beginning this process. +If you're not going to perform a backup, I hope you're using a test box with no +important data on it. I should mention that I didn't experience any problems +while converting to LVM, but it's best to be prepared in case something goes +wrong. </warn> <p> -That said, let's continue. Before starting the conversion process, I -upgraded cvs.gentoo.org so that it was using the following packages. At -the time I performed the LVM transition, these were the latest versions -available (see <uri link="#resources">Resources</uri> later in this -article): +That said, let's continue. Before starting the conversion process, I upgraded +cvs.gentoo.org so that it was using the following packages. At the time I +performed the LVM transition, these were the latest versions available (see +<uri link="#resources">Resources</uri> later in this article): </p> <ul> @@ -78,13 +76,12 @@ </ul> <p> -Now, for the hard drive. cvs.gentoo.org had a nice new IBM 45 GB hard -drive sitting in it; however, when I installed Gentoo Linux on cvs, I -only partitioned about 10 gigabytes of the drive, keeping the remaining -35 GB for future partitions. Such are the little tricks you need to -employ when not using LVM -- leaving part of the drive unpartitioned is -a primitive but effective way to allow for future expansion. However, -with LVM there is a better approach. +Now, for the hard drive. cvs.gentoo.org had a nice new IBM 45 GB hard drive +sitting in it; however, when I installed Gentoo Linux on cvs, I only +partitioned about 10 gigabytes of the drive, keeping the remaining 35 GB for +future partitions. Such are the little tricks you need to employ when not using +LVM -- leaving part of the drive unpartitioned is a primitive but effective way +to allow for future expansion. However, with LVM there is a better approach. </p> </body> @@ -94,9 +91,8 @@ <body> <p> -In the past few weeks, I had been noticing that my root ReiserFS -partition had been slowly filling up, as you can see from this -<c>df</c> output: +In the past few weeks, I had been noticing that my root ReiserFS partition had +been slowly filling up, as you can see from this <c>df</c> output: </p> <pre caption="Shrinking free space"> @@ -106,29 +102,28 @@ </pre> <p> -Now, a 72% full root partition isn't exactly a crisis, but it isn't a -wonderful situation either. ReiserFS, like many other filesystems, -starts slowing down as it gets more and more full, and it was just a -matter of time before my root filesystem would fill up completely and -filesystem performance would take a hit. +Now, a 72% full root partition isn't exactly a crisis, but it isn't a wonderful +situation either. ReiserFS, like many other filesystems, starts slowing down as +it gets more and more full, and it was just a matter of time before my root +filesystem would fill up completely and filesystem performance would take a +hit. </p> <p> -I decided to fix this problem by using LVM to create a new logical -volume out of the 35 GB of currently unpartitioned space at the end -of my hard drive. Then, I'd create a filesystem on this volume and -move a good chunk of the contents of <path>/dev/hda3</path> to it. +I decided to fix this problem by using LVM to create a new logical volume out +of the 35 GB of currently unpartitioned space at the end of my hard drive. +Then, I'd create a filesystem on this volume and move a good chunk of the +contents of <path>/dev/hda3</path> to it. </p> <p> -If you're thinking of making a similar transition on one of your -machines, the first thing you need to do is find a suitable piece of -your root filesystem to move to a logical volume. For me, the choice -was easy -- my <path>/home</path> tree was taking up around 5.7 GB. By -moving <path>/home</path> to its own LVM logical volume, my root -filesystem would then be at about 20% capacity. Since most new data is -being added to <path>/home</path>, my root filesystem would likely stay -at around 20% capacity as well -- a very healthy situation. +If you're thinking of making a similar transition on one of your machines, the +first thing you need to do is find a suitable piece of your root filesystem to +move to a logical volume. For me, the choice was easy -- my <path>/home</path> +tree was taking up around 5.7 GB. By moving <path>/home</path> to its own LVM +logical volume, my root filesystem would then be at about 20% capacity. Since +most new data is being added to <path>/home</path>, my root filesystem would +likely stay at around 20% capacity as well -- a very healthy situation. </p> </body> @@ -138,12 +133,12 @@ <body> <p> -To begin the conversion, I first had to partition the unused space at -the end of my hard drive. Using <c>cfdisk</c>, I created a 35 GB -partition (<path>/dev/hda5</path>) and set the partition type of the -partition to <c>8E</c> (the official LVM partition type). After this -change, I rebooted to force a reread of my partition table. After the -reboot, my partition table looked like this: +To begin the conversion, I first had to partition the unused space at the end +of my hard drive. Using <c>cfdisk</c>, I created a 35 GB partition +(<path>/dev/hda5</path>) and set the partition type of the partition to +<c>8E</c> (the official LVM partition type). After this change, I rebooted to -- [email protected] mailing list
