Configuration and Administration 5 - CentOS Project · PDF fileThe LVM Logical Volume Manager ... configuration and administration of Red Hat Enterprise Linux 5. ... configuration

  • Upload
    vodat

  • View
    233

  • Download
    2

Embed Size (px)

Citation preview

  • LVM Administrator's Guide

    Configuration andAdministration

    5.2

    Cluster_Logical_Volume_ManagerISBN: N/A

    Publication date: May 2008

  • This book describes the LVM logical volume manager for Red Hat Enterprise Linux 5.2,including information on running LVM in a clustered environment. The content of this documentis specific to the LVM2 release.

    LVM Administrator's Guide

  • LVM Administrator's Guide: Configuration and AdministrationCopyright 2008 Red Hat, Inc.

    Copyright 2008 Red Hat, Inc. This material may only be distributed subject to the terms and conditions set forth in theOpen Publication License, V1.0 or later with the restrictions noted below (the latest version of the OPL is presentlyavailable at http://www.opencontent.org/openpub/).

    Distribution of substantively modified versions of this document is prohibited without the explicit permission of thecopyright holder.

    Distribution of the work or derivative of the work in any standard (paper) book form for commercial purposes isprohibited unless prior permission is obtained from the copyright holder.

    Red Hat and the Red Hat "Shadow Man" logo are registered trademarks of Red Hat, Inc. in the United States and othercountries.

    All other trademarks referenced herein are the property of their respective owners.

    The GPG fingerprint of the [email protected] key is:

    CA 20 86 86 2B D6 9D FC 65 F6 EC C4 21 91 80 CD DB 42 A6 0E

    1801 Varsity DriveRaleigh, NC 27606-2072USAPhone: +1 919 754 3700Phone: 888 733 4281Fax: +1 919 754 3701PO Box 13588Research Triangle Park, NC 27709USA

    http://www.opencontent.org/openpub/

  • LVM Administrator's Guide

  • Introduction ............................................................................................................... ix1. About This Guide ........................................................................................... ix2. Audience ....................................................................................................... ix3. Software Versions .......................................................................................... ix4. Related Documentation .................................................................................. ix5. Feedback .......................................................................................................x6. Document Conventions ...................................................................................x

    1. The LVM Logical Volume Manager .......................................................................... 11. Logical Volumes ............................................................................................ 12. LVM Architecture Overview ............................................................................ 23. Running LVM in a Cluster ............................................................................... 34. Document Overview ....................................................................................... 5

    2. LVM Components .................................................................................................. 71. Physical Volumes ........................................................................................... 7

    1.1. LVM Physical Volume Layout ............................................................... 71.2. Multiple Partitions on a Disk ................................................................. 8

    2. Volume Groups .............................................................................................. 93. LVM Logical Volumes ..................................................................................... 9

    3.1. Linear Volumes ................................................................................... 93.2. Striped Logical Volumes .....................................................................123.3. Mirrored Logical Volumes ...................................................................133.4. Snapshot Volumes .............................................................................15

    3. LVM Administration Overview ................................................................................171. Creating LVM Volumes in a Cluster ................................................................172. Logical Volume Creation Overview .................................................................173. Growing a File System on a Logical Volume ...................................................184. Logical Volume Backup .................................................................................185. Logging ........................................................................................................18

    4. LVM Administration with CLI Commands ................................................................211. Using CLI Commands ...................................................................................212. Physical Volume Administration .....................................................................22

    2.1. Creating Physical Volumes .................................................................232.2. Displaying Physical Volumes ..............................................................242.3. Preventing Allocation on a Physical Volume .........................................252.4. Resizing a Physical Volume ................................................................252.5. Removing Physical Volumes ...............................................................25

    3. Volume Group Administration ........................................................................263.1. Creating Volume Groups ....................................................................263.2. Adding Physical Volumes to a Volume Group .......................................273.3. Displaying Volume Groups ..................................................................273.4. Scanning Disks for Volume Groups to Build the Cache File ...................283.5. Removing Physical Volumes from a Volume Group ..............................293.6. Changing the Parameters of a Volume Group ......................................293.7. Activating and Deactivating Volume Groups .........................................303.8. Removing Volume Groups ..................................................................303.9. Splitting a Volume Group ....................................................................30

    v

  • 3.10. Combining Volume Groups ...............................................................313.11. Backing Up Volume Group Metadata .................................................313.12. Renaming a Volume Group ...............................................................313.13. Moving a Volume Group to Another System .......................................313.14. Recreating a Volume Group Directory ................................................32

    4. Logical Volume Administration .......................................................................324.1. Creating Logical Volumes ...................................................................334.2. Persistent Device Numbers .................................................................374.3. Resizing Logical Volumes ...................................................................384.4. Changing the Parameters of a Logical Volume Group ...........................384.5. Renaming Logical Volumes .................................................................384.6. Removing Logical Volumes .................................................................394.7. Displaying Logical Volumes ................................................................394.8. Growing Logical Volumes ...................................................................404.9. Extending a Striped Volume ................................................................414.10. Shrinking Logical Volumes ................................................................42

    5. Creating Snapshot Volumes ..........................................................................436. Controlling LVM Device Scans with Filters ......................................................447. Online Data Relocation ..................................................................................458. Activating Logical Volumes on Individual Nodes in a Cluster ............................469. Customized Reporting for LVM ......................................................................46

    9.1. Format Control ...................................................................................479.2. Object Selection .................................................................................499.3. Sorting LVM Reports ..........................................................................569.4. Specifying Units .................................................................................57

    5. LVM Configuration Examples .................................................................................591. Creating an LVM Logical Volume on Three Disks ............................................59

    1.1. Creating the Physical Volumes ............................................................591.2. Creating the Volume Group .................................................................591.3. Creating the Logical Volume ...............................................................591.4. Creating the File System .....................................................................60

    2. Creating a Striped Logical Volume .................................................................602.1. Creating the Physical Volumes ............................................................602.2. Creating the Volume Group .......................................