Author: bdubbs Date: 2012-02-16 22:39:57 -0700 (Thu, 16 Feb 2012) New Revision: 9448
Added: trunk/BOOK/postlfs/filesystems/aboutlvm.xml Modified: trunk/BOOK/general.ent trunk/BOOK/introduction/welcome/changelog.xml trunk/BOOK/postlfs/filesystems/filesystems.xml trunk/BOOK/postlfs/filesystems/lvm2.xml trunk/bootscripts/Makefile trunk/bootscripts/blfs/init.d/ntpd trunk/bootscripts/blfs/services/bridge Log: Add section 'About LVM' Update kernel requirements in lvm2 Remove -x from ntpd bootscript Modified: trunk/BOOK/general.ent =================================================================== --- trunk/BOOK/general.ent 2012-02-17 01:32:24 UTC (rev 9447) +++ trunk/BOOK/general.ent 2012-02-17 05:39:57 UTC (rev 9448) @@ -59,7 +59,7 @@ <!ENTITY lfs-vim-version "7.3"> <!-- End LFS versions --> -<!ENTITY blfs-bootscripts-version "20120206"> +<!ENTITY blfs-bootscripts-version "20120216"> <!ENTITY blfs-bootscripts-download "&downloads-root;/blfs-bootscripts-&blfs-bootscripts-version;.tar.bz2"> <!ENTITY blfs-wiki "http://wiki.&lfs-domainname;/blfs/wiki"> Modified: trunk/BOOK/introduction/welcome/changelog.xml =================================================================== --- trunk/BOOK/introduction/welcome/changelog.xml 2012-02-17 01:32:24 UTC (rev 9447) +++ trunk/BOOK/introduction/welcome/changelog.xml 2012-02-17 05:39:57 UTC (rev 9448) @@ -45,6 +45,13 @@ <para>February 17th, 2012</para> <itemizedlist> <listitem> + <para>[bdubbs] - Add section 'About LVM'. Update kernel + requirements in lvm2.</para> + </listitem> + <listitem> + <para>[bdubbs] - Remove -x from nptd bootscript.</para> + </listitem> + <listitem> <para>[ken] - merge mousetweaks-3.2.1 from Wayne.</para> </listitem> <listitem> Copied: trunk/BOOK/postlfs/filesystems/aboutlvm.xml (from rev 9416, trunk/BOOK/postlfs/filesystems/aboutraid.xml) =================================================================== --- trunk/BOOK/postlfs/filesystems/aboutlvm.xml (rev 0) +++ trunk/BOOK/postlfs/filesystems/aboutlvm.xml 2012-02-17 05:39:57 UTC (rev 9448) @@ -0,0 +1,111 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" + "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../../general.ent"> + %general-entities; +]> + +<sect1 id="aboutlvm"> + <?dbhtml filename="aboutlvm.html"?> + + <sect1info> + <othername>$LastChangedBy$</othername> + <date>$Date$</date> + </sect1info> + + <title>About Logical Volume Management (LVM)</title> + + <para>LVM manages disk drives. It allows multiple drives and partitions + to be combined into larger <emphasis>volume groups</emphasis>, assists in + making backups through a <emphasis>snapshot</emphasis>, and allows for + dynamic volume resizing. It can also provide mirroring similar to + a RAID 1 array.</para> + + <para>A complete discussion of LVM is beyond the scope of this introduction, + but basic concepts are presented below.</para> + + <para>To run any of the commands presented here, the <xref linkend='lvm2'/> + package must be installed. All commands must be run as the <systemitem + class="username">root</systemitem> user.</para> + + <para>Management of disks with lvm is accomplished using the following + concepts: </para> + + <variablelist> + <varlistentry> + <term>physical volumes</term> + <listitem><para>These are physical disks or partitions such as + /dev/sda3 or /dev/sdb.</para></listitem> + </varlistentry> + + <varlistentry> + <term>volume groups</term> + <listitem><para>These are named groups of physical volumes that + can be manipulated by the administrator. The number of physical + volumes that make up a volume group is arbitrary. Physical volumes + can be dynamically added or removed from a volume group. + </para></listitem> + </varlistentry> + + <varlistentry> + <term>logical volumes</term> + <listitem><para>Volume groups may be subdivided into logical volumes. + Each logical volume can then be individually formatted as if it were a + regular Linux partition. Logical volumes may be dynamically resized by + the administrator according to need.</para></listitem> + + </varlistentry> + </variablelist> + + <para>To give a concrete example, suppose that we have two 2 TB disks. + Also suppose a really large amount of space is required for a very large database, + mounted on <filename class='directory'>/srv/mysql</filename>. This is what + the initial set of partitions would look like:</para> + + <screen><literal>Partition Use Size Partition Type +/dev/sda1 /boot 100MB 83 (Linux) +/dev/sda2 / 10GB 83 (Linux) +/dev/sda3 swap 2GB 82 (Swap) +/dev/sda4 LVM remainder 8e (LVM) +/dev/sdb1 swap 2GB 82 (Swap) +/dev/sdb2 LVM remainder 8e (LVM)</literal></screen> + + <para>First initialize the physical volumes:</para> + + <screen><userinput>pvcreate /dev/sda4 /dev/sdb2</userinput></screen> + + <para>Next create a volume group named lfs-lvm:</para> + + <screen><userinput>vgcreate lfs-lvm /dev/sda4 /dev/sdb2</userinput></screen> + + <para>The status of the volume group can be checked by running the command + <command>vgscan</command>. Now create the logical volumes. Since there is + about 3900 GB available, leave about 900 GB free for expansion. Note that the + logical volume named <emphasis>mysql</emphasis> is larger than any physical + disk. </para> + + <screen><userinput>lvcreate --name mysql --size 2500G lfs-lvm +lvcreate --name home --size 500G lfs-lvm</userinput></screen> + + <para>Finally the logical volumes can be formatted and mounted. In this + example, the jfs file system (<xref linkend='jfsutils'/>) is used for + demonstration purposes.</para> + + <screen><userinput>mkfs -t ext4 /dev/lfs-lvm/home +mkfs -t jfs /dev/lfs-lvm/mysql +mount /dev/lfs-lvm/home /home +mkdir -p /srv/mysql +mount /dev/lfs-lvm/mysql /srv/mysql</userinput></screen> + + <para>The LFS boot scripts automatically make these file systems available + to the system in the checkfs script. Edit the <filename>/etc/fstab</filename> + file as required to automatically mount them.</para> + + <para>A LVM logical volume can host a root filesystem, but requires the use + of an initramfs (initial RAM file system) and is not discussed here.</para> + + <para>For a more information about LVM, see the <ulink + url="http://www.tldp.org/HOWTO/LVM-HOWTO/">LVM HOWTO</ulink> and + the lvm man pages.</para> + +</sect1> Modified: trunk/BOOK/postlfs/filesystems/filesystems.xml =================================================================== --- trunk/BOOK/postlfs/filesystems/filesystems.xml 2012-02-17 01:32:24 UTC (rev 9447) +++ trunk/BOOK/postlfs/filesystems/filesystems.xml 2012-02-17 05:39:57 UTC (rev 9448) @@ -22,8 +22,8 @@ use instead of the default LFS extended file system (ext2/3/4). It also provides introductory material on managing disk arrays.</para> - <!-- <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="ext3.xml"/> --> <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="lvm2.xml"/> + <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="aboutlvm.xml"/> <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="jfs.xml"/> <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="mdadm.xml"/> <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="aboutraid.xml"/> Modified: trunk/BOOK/postlfs/filesystems/lvm2.xml =================================================================== --- trunk/BOOK/postlfs/filesystems/lvm2.xml 2012-02-17 01:32:24 UTC (rev 9447) +++ trunk/BOOK/postlfs/filesystems/lvm2.xml 2012-02-17 05:39:57 UTC (rev 9448) @@ -63,6 +63,25 @@ </sect2> + <sect2 role="kernel" id='lvm2-kernel'> + <title>Kernel Configuration</title> + + <para>Enable the following option in the kernel configuration + and recompile the kernel:</para> + +<screen><literal>Device Drivers ---> + Multiple devices driver support (RAID and LVM): Y + Device mapper support: Y or M + Crypt target support: (optional) + Snapshot target: (optional) + Mirror target: (optional) </literal></screen> + + <indexterm zone="lvm2 lvm2-kernel"> + <primary sortas="d-lvm2">lvm2</primary> + </indexterm> + + </sect2> + <sect2 role="installation"> <title>Installation of lvm2</title> Modified: trunk/bootscripts/Makefile =================================================================== --- trunk/bootscripts/Makefile 2012-02-17 01:32:24 UTC (rev 9447) +++ trunk/bootscripts/Makefile 2012-02-17 05:39:57 UTC (rev 9448) @@ -5,10 +5,9 @@ DIRMODE=755 CONFMODE=644 -# The grep can probably be improved upon. all: @grep "^install" Makefile | cut -d ":" -f 1 - @echo "Select an appropriate install target from the above list" ; exit 1 + @echo "Select an appropriate install target from the above list" create-dirs: install -d -m ${DIRMODE} ${EXTDIR}/rc.d/rc{0,1,2,3,4,5,6,S}.d Modified: trunk/bootscripts/blfs/init.d/ntpd =================================================================== --- trunk/bootscripts/blfs/init.d/ntpd 2012-02-17 01:32:24 UTC (rev 9447) +++ trunk/bootscripts/blfs/init.d/ntpd 2012-02-17 05:39:57 UTC (rev 9448) @@ -32,7 +32,7 @@ case "$1" in start) log_info_msg "Starting ntpd..." - start_daemon /usr/sbin/ntpd -gx + start_daemon /usr/sbin/ntpd -g evaluate_retval ;; Modified: trunk/bootscripts/blfs/services/bridge =================================================================== --- trunk/bootscripts/blfs/services/bridge 2012-02-17 01:32:24 UTC (rev 9447) +++ trunk/bootscripts/blfs/services/bridge 2012-02-17 05:39:57 UTC (rev 9448) @@ -5,6 +5,7 @@ # Description : Bridge Boot Script # # Authors : Nathan Coulson - [email protected] +# Troy Wu - [email protected] # Bruce Dubbs - [email protected] # # Version : LFS-7.0 -- http://linuxfromscratch.org/mailman/listinfo/blfs-book FAQ: http://www.linuxfromscratch.org/blfs/faq.html Unsubscribe: See the above information page
