Red Hat ENTERPRISE LINUX 5 - LOGICAL VOLUME MANAGER ADMINISTRATION Instalační příručka Strana 1

Procházejte online nebo si stáhněte Instalační příručka pro Software Red Hat ENTERPRISE LINUX 5 - LOGICAL VOLUME MANAGER ADMINISTRATION. Red Hat ENTERPRISE LINUX 5 - LOGICAL VOLUME MANAGER ADMINISTRATION Installation guide Uživatelská příručka

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 92
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 0
LVM Administrator's Guide
Configuration and Administration
Zobrazit stránku 0
1 2 3 4 5 6 ... 91 92

Shrnutí obsahu

Strany 1

LVM Administrator's GuideConfiguration and Administration

Strany 2

Chapter 1. The LVM Logical VolumeManagerThis chapter provides a high-level overview of the components of the Logical Volume Manager(LVM).1. Logical Vo

Strany 3

Using logical volumes, you can take device snapshots for consistent backups or to test theeffect of changes without affecting the real data.The implem

Strany 4 - Table of Contents

Figure 1.1. LVM Logical Volume ComponentsFor detailed information on the components of an LVM logical volume, see Chapter 2, LVMComponents.3. Running

Strany 5

Figure 1.2. CLVM OverviewLogical volumes created with CLVM on shared storage are visible to all computers that have ac-cess to the shared storage.CLVM

Strany 6

This remainder of this document includes the following chapters:• Chapter 2, LVM Components describes the components that make up an LVM logicalvolume

Strany 7 - 4. Related Documentation

Chapter 2. LVM ComponentsThis chapter describes the components of an LVM Logical volume.1. Physical VolumesThe underlying physical storage unit of an

Strany 8 - 5. Document Conventions

512 bytes in size.Figure 2.1. Physical Volume layout1.2. Multiple Partitions on a DiskLVM allows you to create physical volumes out of disk partitions

Strany 9 - Important

striped volumes.2. Volume GroupsPhysical volumes are combined into volume groups (VGs). This creates a pool of disk space outof which logical volumes

Strany 10 - 1. Logical Volumes

Figure 2.2. Extent MappingThe physical volumes that make up a logical volume do not have to be the same size. Fig-ure 2.3, “Linear Volume with Unequal

Strany 11 - 2. LVM Architecture Overview

Figure 2.3. Linear Volume with Unequal Physical VolumesYou can configure more than one linear logical volume of whatever size you desire from thepool

Strany 12 - 3. Running LVM in a Cluster

LVM Administrator's Guide: Configuration and AdministrationCopyright © 2007 Red Hat, Inc.This book describes the LVM logical volume manager, incl

Strany 13 - 4. Document Overview

3.2. Striped Logical VolumesWhen you write data to an LVM logical volume, the file system lays the data out across the un-derlying physical volumes. Y

Strany 14

space on the underlying physical volumes that make up the volume group to support the stripe.For example, if you have a two-way stripe that uses up an

Strany 15 - Chapter 2. LVM Components

NoteMirrored logical volumes are not currently supported in a cluster.For information on creating and modifying mirrors, see Section 4.1.3, “Creating

Strany 16

• You can execute the fsck command on a snapshot file system to check the file system integ-rity and determine whether the original file system requir

Strany 17 - 3. LVM Logical Volumes

Chapter 3. LVM AdministrationOverviewThis chapter provides an overview of the administrative procedures you use to configure LVMlogical volumes. This

Strany 18 - Figure 2.2. Extent Mapping

that use the storage have local copies, but can recreate that from what is on the physicalvolumes. You can attach physical volumes to a different serv

Strany 19

• external log functionThe logging levels are set in the /etc/lvm/lvm.conf file, which is described in Appendix B, TheLVM Configuration Files.5. Loggi

Strany 20 - 3.2. Striped Logical Volumes

Chapter 4. LVM Administration withCLI CommandsThis chapter summarizes the individual administrative tasks you can perform with the LVMCommand Line Int

Strany 21 - 3.3. Mirrored Logical Volumes

tails about the command execution. The -vvvv argument provides the maximum amount of in-formation at this time. The following example shows only the f

Strany 22 - 3.4. Snapshot Volumes

dd if=/dev/zero of=PhysicalVolume bs=512 count=12.1.2. Initializing Physical VolumesUse the pvcreate command to initialize a block device to be used a

Strany 24 - Overview

2.2. Displaying Physical VolumesThere are three commands you can use to display properties of LVM physical volumes: pvs,pvdisplay, and pvscan.The pvs

Strany 25 - 5. Logging

previously been disallowed.2.4. Resizing a Physical VolumeIf you need to change the size of an underlying block device for any reason, use the pvresiz

Strany 26 - LVM Configuration Files

The contiguous policy requires that new extents are adjacent to existing extents. If there are suf-ficient free extents to satisfy an allocation reque

Strany 27 - CLI Commands

The vgdisplay command displays volume group properties (such as size, extents, number ofphysical volumes, etc.) in a fixed form. The following example

Strany 28

vgreduce command shrinks a volume group's capacity by removing one or more empty physicalvolumes. This frees those physical volumes to be used in

Strany 29

The following example deactivates the volume group my_volume_group.vgchange -a n my_volume_groupIf clustered locking is enabled, add ’e’ to activate o

Strany 30

Metadata backups and archives are automatically created on every volume group and logicalvolume configuration change unless disabled in the lvm.conf f

Strany 31 - 3.1. Creating Volume Groups

When the system is next shut down, you can unplug the disks that constitute the volumegroup and connect them to the new system.4. When the disks are p

Strany 32 - 3.3. Displaying Volume Groups

The following command creates a 50 gigabyte logical volume named gfslv from the free extentsin volume group vg0.lvcreate -L 50G -n gfslv vg0You can us

Strany 33

lvcreate -l 100 -n testlv testvg /dev/sda1:0-25 /dev/sdb1:50-125The following example creates a linear logical volume out of extents 0 through 25 of p

Strany 34

Table of ContentsIntroduction ... vii1. Abo

Strany 35 - 3.10. Combining Volume Groups

copies of the file system: a linear logical volume plus one copy. Similarly, specifying -m2 createstwo mirrors, yielding three copies of the file syst

Strany 36 - 3.12. Renaming a Volume Group

4.1.4. Changing Mirrored Volume ConfigurationYou can convert a logical volume from a mirrored volume to a linear volume or from a linearvolume to a mi

Strany 37 - 4.1. Creating Logical Volumes

lvreduce -l -3 vg00/lvol14.4. Changing the Parameters of a Logical Volume GroupTo change the parameters of a logical volume, use the lvchange command.

Strany 38

There are three commands you can use to display properties of LVM logical volumes: lvs,lvdisplay, and lvscan.The lvs command provides logical volume i

Strany 39

testlv to fill all of the unallocated space in the volume group myvg.[root@tng3-1 ~]# lvextend -l +100%FREE /dev/myvg/testlvExtending logical volume t

Strany 40

At this point you cannot extend the striped logical volume to the full size of the volume group,because two underlying devices are needed in order to

Strany 41 - 4.3. Resizing Logical Volumes

al extents.lvreduce -l -3 vg00/lvol15. Creating Snapshot VolumesUse the -s argument of the lvcreate command to create a snapshot volume. A snapshotvol

Strany 42 - 4.6. Removing Logical Volumes

NoteBecause the snapshot increases in size as the origin volume changes, it is import-ant to monitor the percentage of the snapshot volume regularly w

Strany 43 - 4.8. Growing Logical Volumes

filter = [ "a|^/dev/hda8$|", "r/.*/" ]For more information on the lvm.conf file, see Appendix B, The LVM Configuration Files and t

Strany 44

To activate logical volumes exclusively on one node, use the lvchange -aey command. Alternat-ively, you can use lvchange -aly command to activate logi

Strany 45

3.10. Combining Volume Groups ...263.11. Backing Up Volume Group Metadata ...

Strany 46 - 5. Creating Snapshot Volumes

the -o argument.The following example displays the UUID of the physical volume in addition to the defaultfields.# pvs -o +pv_uuidPV VG Fmt Attr PSize

Strany 47

volume that would otherwise not appear in the output. For information on the output this argu-ment yields, see Section 2, “Displaying Information on F

Strany 48 - Nodes in a Cluster

Argument Header Descriptionpv_pe_count PE Number of physical extentspvseg_size SSize The segment size of the physical volumepvseg_start Start The star

Strany 49 - 9.1. Format Control

/dev/sda1 vg lvm2 a- 17.14G 16.75G 126 24/dev/sda1 vg lvm2 a- 17.14G 16.75G 150 22/dev/sda1 vg lvm2 a- 17.14G 16.75G 172 4217/dev/sdb1 vg lvm2 a- 17.1

Strany 50

Argument Header Descriptionvg_fmt Fmt The metadata format of the volume group (lvm2 or lvm1)vg_free VFree Size of the free space remaining in the volu

Strany 51 - 9.2. Object Selection

Argument Header Descriptionphysical volumes, logical volumes, and start physical extentsand logical extentslv_attr Attr The status of the logical volu

Strany 52 - Table 4.1. pvs Display Fields

Argument Header Descriptionseg_size SSize The size of the segments in the logical volumeseg_start Start Offset of the segment in the logical volumeseg

Strany 53 - The vgs Command

Using the -v argument with the lvs --segments command adds the following fields to the defaultdisplay: seg_start, stripesize, chunksize.# lvs -v --seg

Strany 54 - The lvs Command

To display a reverse sort, precede a field you specify after the -O argument with the - character.# pvs -o pv_name,pv_size,pv_free -O -pv_freePV PSize

Strany 55

The following example displays the output of the pvs command in units of 4 megabytes.# pvs --units 4mPV VG Fmt Attr PSize PFree/dev/sdb1 new_vg lvm2 a

Strany 56 - Table 4.3. lvs Display Fields

4. Recovering Physical Volume Metadata ...635. Replacing a Missing Physical Volume ...

Strany 57 - 9.3. Sorting LVM Reports

Chapter 5. LVM ConfigurationExamplesThis chapter provides some basic LVM configuration examples.1. Creating an LVM Logical Volume on ThreeDisksThis ex

Strany 58 - 9.4. Specifying Units

Logical volume "new_logical_volume" created1.4. Creating the File SystemThe following command creates a GFS file system on the logical volum

Strany 59

[root@tng3-1 ~]# vgcreate striped_vol_group /dev/sda1 /dev/sdb1 /dev/sdc1Volume group "striped_vol_group" successfully createdYou can use th

Strany 60 - Examples

unused space on the physical volumes, a new volume group can be created without adding newdisks.In the initial set up, the logical volume mylv is carv

Strany 61 - 1.4. Creating the File System

group yourvg.[root@tng3-1 ~]# lvchange -a n /dev/myvg/mylv[root@tng3-1 ~]# vgsplit myvg yourvg /dev/sdc1Volume group "yourvg" successfully s

Strany 62 - 3. Splitting a Volume Group

4. Removing a Disk from a Logical VolumeThis example shows how you can remove a disk from an existing logical volume, either to re-place the disk or t

Strany 63 - 3.2. Moving the Data

4.2. Moving Extents to a New DiskIn this example, the logical volume is distributed across three physical volumes in the volumegroup myvg as follows:[

Strany 64

[root@tng3-1 ~]# vgreduce myvg /dev/sdb1Removed "/dev/sdb1" from volume group "myvg"You can now reallocate the disk to another vol

Strany 65

Chapter 6. LVM TroubleshootingThis chapter provide instructions for troubleshooting a variety of LVM issues.1. Troubleshooting DiagnosticsIf a command

Strany 66 - 4.2.3. Moving the Data

In this example, the failed device caused both a linear and a striped logical volume in thevolume group to fail. The lvs command without the -P argume

Strany 67

Introduction1. About This GuideThis book describes the Logical Volume Manager (LVM), including information on running LVMin a clustered environment. T

Strany 68

Physical volume "/dev/sdf2" successfully createdPhysical volume "/dev/sdg1" successfully createdPhysical volume "/dev/sdg2&qu

Strany 69

[root@link-08 ~]# pvcreate /dev/sda[12]Physical volume "/dev/sda1" successfully createdPhysical volume "/dev/sda2" successfully cr

Strany 70

4. Recovering Physical Volume MetadataIf the volume group metadata area of a physical volume is accidentally overwritten or otherwisedestroyed, you wi

Strany 71

Physical volume "/dev/sdh1" successfully createdYou can then use the vgcfgrestore command to restore the volume group's metadata.[root@

Strany 72

Like most LVM operations, the vgreduce command is reversible in a sense if you immediatelyuse the vgcfgrestore command to restore the volume group met

Strany 73 - Volume Group

Chapter 7. LVM Administration withthe LVM GUIIn addition to the Command Line Interface (CLI), LVM provides a Graphical User Interface (GUI)which you c

Strany 74

Appendix A. The Device MapperThe Device Mapper is a kernel driver that provides a generic framework for volume manage-ment. It provides a generic way

Strany 75

Appendix B. The LVMConfiguration FilesLVM supports multiple configuration files. At system startup, the lvm.conf configuration file isloaded from the

Strany 76 - Appendix A. The Device Mapper

# This is an example configuration file for the LVM2 system.# It contains the default settings that would be used if there was no# /etc/lvm/lvm.conf f

Strany 77 - Configuration Files

# Advanced settings.# List of pairs of additional acceptable block device types found# in /proc/devices with maximum (non-zero) number of partitions.#

Strany 78 - 2. Sample lvm.conf File

• Using GNBD with Global File System — Provides an overview on using Global NetworkBlock Device (GNBD) with Red Hat GFS.• Linux Virtual Server Adminis

Strany 79

# Backups are stored in a human readable text format.backup {# Should we maintain a backup of the current metadata configuration ?# Use 1 for Yes; 0 f

Strany 80

# The default metadata format that commands should use - "lvm1" or "lvm2".# The command line override is -M1 or -M2.# Defaults to

Strany 81

# Size (in KB) of each copy operation when mirroringmirror_region_size = 512# 'mirror_image_fault_policy' and 'mirror_log_fault_policy&

Strany 82

# pvmetadatasize = 255# List of directories holding live copies of text format metadata.# These directories must not be on logical volumes!# It's

Strany 83

Appendix C. LVM Object TagsAn LVM tag is a word that can be used to group LVM2 objects of the same type together. Tagscan be attached to objects such

Strany 84 - Appendix C. LVM Object Tags

3. Controlling Activation with TagsYou can specify in the configuration file that only certain logical volumes should be activated onthat host. For ex

Strany 85

Appendix D. LVM Volume GroupMetadataThe configuration details of a volume group are referred to as the metadata. By default, anidentical copy of the m

Strany 86 - Metadata

The volume group metadata contains:• Information about how and when it was created• Information about the volume group:The volume group information co

Strany 87 - 3. Sample Metadata

extent_size = 8192 # 4 Megabytesmax_lv = 0max_pv = 0physical_volumes {pv0 {id = "ZBW5qW-dXF2-0bGw-ZCad-2RlV-phwu-1c1RFt"device = "/dev/

Strany 88

type = "striped"stripe_count = 1 # linearstripes = ["pv1", 0]}}}}3. Sample Metadata80

Strany 89

TipA tip is typically an alternative way of performing a task.ImportantImportant information is necessary, but possibly unexpected, such as a configur

Strany 90

IndexAactivating logical volumesindividual nodes, 39activating volume groups, 25individual nodes, 26local node only, 26administrative procedures, 15al

Strany 91

creation example, 51definition, 1, 8displaying, 33, 40, 45exclusive access, 39extending, 34growing, 34linear, 28local access, 39lvs display arguments,

Strany 92

renaminglogical volume, 33volume group, 27report format, LVM devices, 40resizinglogical volume, 32physical volume, 22Sscanningblock devices, 20scannin

Komentáře k této Příručce

Žádné komentáře