Red Hat ENTERPRISE LINUX 4 - LVM ADMINISTRATOR Guide d'installation

Naviguer en ligne ou télécharger Guide d'installation pour Manuels des logiciels Red Hat ENTERPRISE LINUX 4 - LVM ADMINISTRATOR. Red Hat ENTERPRISE LINUX 4 - LVM ADMINISTRATOR Installation guide Manuel d'utilisatio

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 132
  • Table des matières
  • DEPANNAGE
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs

Résumé du contenu

Page 1 - Manager Administration

Red Hat Enterprise Linux 6Logical VolumeManager AdministrationLVM Administrator Guide

Page 2 - Edition 1

IntroductionxPublican is a DocBook publishing system.6.2. Pull-quote ConventionsTerminal output and source code listings are set off visually from the

Page 3

Appendix A. The Device Mapper88The following example shows a pure failover target definition for the same multipath device. In thistarget there are fo

Page 4

The dmsetup Command89deviceblock device, referenced by the device name in the filesystem or by the major and minor numbersin the format major:minoroff

Page 5

Appendix A. The Device Mapper90Event numberThe current number of events received. Issuing a dmsetup wait n command allows the userto wait for the n&a

Page 6

The dmsetup status Command91[root@grant-01 ~]# dmsetup ls --target mirrorlock_stress-grant--02.1722 (253, 34)lock_stress-grant--01.1720 (253

Page 7 - Introduction

Appendix A. The Device Mapper92The following example shows the command to list the dependencies of all currently configuredmapped devices.[root@ask-07

Page 8 - 6. Document Conventions

udev Integration with the Device Mapper93and LVM). Without this support, it was a common problem for a user to try to remove a device that wasstill op

Page 9

Appendix A. The Device Mapper94• DM_SUSPENDED: the suspended state of Device Mapper device• DM_UDEV_RULES_VSN: udev rules version (this is primarily f

Page 10 - 6.3. Notes and Warnings

Commands and Interfaces that Support udev95 dmsetup command ... ... dmsetup command ...--noudevrulesDisables udev rules. Nodes/symlinks will be cre

Page 12

97Appendix B. The LVM ConfigurationFilesLVM supports multiple configuration files. At system startup, the lvm.conf configuration file is loadedfrom th

Page 13 - 1.1. New and Changed Features

Notes and WarningsxiWarningWarnings should not be ignored. Ignoring warnings will most likely cause data loss.

Page 14 - 1.2. Logical Volumes

Appendix B. The LVM Configuration Files98# the environment variable LVM_SYSTEM_DIR before running the tools.## N.B. Take care that each setting only a

Page 15

Sample lvm.conf File99 # filter =[ "a|loop|", "r|/dev/hdc|", "a|/dev/ide|", "r|.*|" ] # Use anchors if y

Page 16

Appendix B. The LVM Configuration Files100 # But note that pvcreate --dataalignmentoffset will skip this detection. # 1 enables; 0 disables.

Page 17 - # service clvmd start

Sample lvm.conf File101# Set to 1 to guarantee that mirror logs will always be placed on # different PVs from the mirror images. This was the d

Page 18 - 1.5. Document Overview

Appendix B. The LVM Configuration Files102 backup_dir = "/etc/lvm/backup" # Should we maintain an archive of old metadata configuratio

Page 19

Sample lvm.conf File103 # The default metadata format that commands should use - "lvm1" or "lvm2". # The command line overri

Page 20

Appendix B. The LVM Configuration Files104 # If set to 1, no operations that change on-disk metadata will be permitted. # Additionally, read-onl

Page 21 - LVM Components

Sample lvm.conf File105 reserved_stack = 256 # How much memory (in KB) to reserve for use while devices suspended reserved_memory = 8192 #

Page 22 - 2.2. Volume Groups

Appendix B. The LVM Configuration Files106 # snapshot should be extended: when its space usage exceeds this many # percent. The latter defines h

Page 23 - 2.3. LVM Logical Volumes

Sample lvm.conf File107 # are used at the individual PV level using 'pvchange # --metadataignore y/n'. # vgmetadatacopies = 0 #

Page 26 - 2.3.4. Snapshot Volumes

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

Page 27

Appendix C. LVM Object Tags110For example, the following entry in the configuration file always defines tag1, and defines tag2 if thehostname is host1

Page 28

111Appendix D. LVM Volume GroupMetadataThe configuration details of a volume group are referred to as the metadata. By default, an identicalcopy of th

Page 29 - LVM Administration Overview

Appendix D. LVM Volume Group Metadata112• A version number which is incremented whenever the metadata gets updated• Any properties: Read/Write? Resize

Page 30 - 3.4. Logical Volume Backup

Sample Metadata113 status = ["ALLOCATABLE"] dev_size = 35964301 # 17.1491 Gigabytes

Page 32

115Appendix E. Revision HistoryRevision 3.0-5 Thu Dec 1 2011 Steven Levine [email protected] for GA of Red Hat Enterprise Linux 6.2Revision 3.

Page 33 - Commands

Appendix E. Revision History116Documents support for including multiple --addtag and --deltag arguments on a single commandline.Resolves: #694604Docum

Page 34

117IndexSymbols/lib/udev/rules.d directory, 93Aactivating logical volumesindividual nodes, 49activating volume groups, 30individual nodes, 30local nod

Page 35

Chapter 1.1The LVM Logical Volume ManagerThis chapter provides a summary of the features of the LVM logical volume manager that are new forthe initial

Page 36

Index118displaying, 43, 49, 54exclusive access, 49extending, 43growing, 43linear, 32local access, 49lvs display arguments, 54mirrored, 34reducing, 47r

Page 37 - 4.3.1. Creating Volume Groups

119report format, LVM devices, 49resizinglogical volume, 42physical volume, 25rules.d directory, 93Sscanningblock devices, 23scanning devices, filters

Page 39

Chapter 1. The LVM Logical Volume Manager2• You can now create a mirror log for a mirrored logical device that is itself mirrored by using the --mirro

Page 40

LVM Architecture Overview3Volume management creates a layer of abstraction over physical storage, allowing you to createlogical storage volumes. This

Page 41

Chapter 1. The LVM Logical Volume Manager4• atomic changes to metadata• redundant copies of metadataLVM2 is backwards compatible with LVM1, with the e

Page 42 - 4.3.9. Removing Volume Groups

The Clustered Logical Volume Manager (CLVM)5• If you are using a clustered system for failover where only a single node that accesses the storageis ac

Page 43 - # vgmerge -v databases my_vg

Chapter 1. The LVM Logical Volume Manager6Figure 1.2. CLVM OverviewNoteCLVM requires changes to the lvm.conf file for cluster-wide locking. Informatio

Page 44

Document Overview7• Chapter 3, LVM Administration Overview provides an overview of the basic steps you perform toconfigure LVM logical volumes, whethe

Page 45

Logical Volume Manager AdministrationRed Hat Enterprise Linux 6 Logical Volume ManagerAdministrationLVM Administrator GuideEdition 1Copyright © 2011 R

Page 47

Chapter 2.9LVM ComponentsThis chapter describes the components of an LVM Logical volume.2.1. Physical VolumesThe underlying physical storage unit of a

Page 48

Chapter 2. LVM Components10Figure 2.1. Physical Volume layout2.1.2. Multiple Partitions on a DiskLVM allows you to create physical volumes out of disk

Page 49

LVM Logical Volumes11A logical volume is allocated into logical extents of the same size as the physical extents. The extentsize is thus the same for

Page 50

Chapter 2. LVM Components12of 4MB. This volume group includes 2 physical volumes named PV1 and PV2. The physical volumesare divided into 4MB units, si

Page 51 - # lvconvert -m0 vg00/lvol1

Mirrored Logical Volumes13striped logical volume. For large sequential reads and writes, this can improve the efficiency of thedata I/O.Striping enhan

Page 52

Chapter 2. LVM Components14A mirror maintains identical copies of data on different devices. When data is written to one device, itis written to a sec

Page 53 - # lvconvert --merge @some_tag

Snapshot Volumes15NoteLVM snapshots are not supported for LVM mirrored logical volumes.Because a snapshot copies only the data areas that change after

Page 54 - # lvrename vg02 lvold lvnew

Chapter 2. LVM Components16As of the Red Hat Enterprise Linux 6 release, you can use the --merge option of the lvconvertcommand to merge a snapshot in

Page 55

Chapter 3.17LVM Administration OverviewThis chapter provides an overview of the administrative procedures you use to configure LVM logicalvolumes. Thi

Page 56

iiiIntroduction vii1.

Page 57

Chapter 3. LVM Administration Overview18The following is a summary of the steps to perform to create an LVM logical volume.1. Initialize the partition

Page 58

Logging19in the /etc/lvm/backup file and the metadata archives are stored in the /etc/lvm/archivefile. How long the metadata archives stored in the /e

Page 60 - 4.6. Online Data Relocation

Chapter 4.21LVM Administration with CLICommandsThis chapter summarizes the individual administrative tasks you can perform with the LVM CommandLine In

Page 61 - 4.8.1. Format Control

Chapter 4. LVM Administration with CLI Commands22 Found volume group "new_vg" Creating new_vg-lvol0 Loading new_vg-lvol0 table R

Page 62

Creating Physical Volumes23The following subsections describe the commands used for creating physical volumes.4.2.1.1. Setting the Partition TypeIf yo

Page 63 - 4.8.2. Object Selection

Chapter 4. LVM Administration with CLI Commands24 /dev/ram8 [ 16.00 MB] /dev/ram9 [ 16.00 MB] /de

Page 64

Preventing Allocation on a Physical Volume25You can define a filter in the lvm.conf so that this command will avoid scanning specific physicalvolumes.

Page 65 - The vgs Command

Chapter 4. LVM Administration with CLI Commands26# vgcreate vg1 /dev/sdd1 /dev/sde1When physical volumes are used to create a volume group, its disk s

Page 66 - The lvs Command

Adding Physical Volumes to a Volume Group27You create volume groups in a cluster environment with the vgcreate command, just as you createthem on a si

Page 67

Logical Volume Manager Administrationiv4.3.9. Removing Volume Groups ...

Page 68

Chapter 4. LVM Administration with CLI Commands28For information on using the vgs command to customize your output, see Section 4.8, “CustomizedReport

Page 69 - 4.8.4. Specifying Units

Removing Physical Volumes from a Volume Group29# vgscan Reading all physical volumes. This may take a while... Found volume group "new_vg"

Page 70

Chapter 4. LVM Administration with CLI Commands304.3.8. Activating and Deactivating Volume GroupsWhen you create a volume group it is, by default, act

Page 71 - LVM Configuration Examples

Backing Up Volume Group Metadata31extent sizes of the volume are equal and the physical and logical volume summaries of both volumegroups fit into the

Page 72

Chapter 4. LVM Administration with CLI Commands323. Use the vgexport command to export the volume group. This prevents it from being accessed bythe sy

Page 73 - 5.3. Splitting a Volume Group

Creating Linear Logical Volumes33The following command creates a 1500 MB linear logical volume named testlv in the volume grouptestvg, creating the bl

Page 74 - 5.3.2. Moving the Data

Chapter 4. LVM Administration with CLI Commands34You can specify which extents of a physical volume are to be used for a logical volume. The following

Page 75

Creating Mirrored Volumes35Mirrored LVM Logical Volumes in a ClusterCreating a mirrored LVM logical volume in a cluster requires the same commands and

Page 76

Chapter 4. LVM Administration with CLI Commands36LVM maintains a small log which it uses to keep track of which regions are in sync with the mirror or

Page 77 - 5.4.2.3. Moving the Data

Creating Mirrored Volumes37When a mirror is created, the mirror regions are synchronized. For large mirror components, the syncprocess may take a long

Page 78

v6.2. Displaying Information on Failed Devices ... 696.3. Recovering from LVM Mirror

Page 79

Chapter 4. LVM Administration with CLI Commands38By default, the mirror_image_fault_policy parameter is set to remove. With this policy, if amirror im

Page 80

Creating Snapshot Volumes39specified by the mirror_log_fault_policy and mirror_device_fault_policy parametersin the lvm.conf file.4.4.3.4. Changing Mi

Page 81 - LVM Troubleshooting

Chapter 4. LVM Administration with CLI Commands40NoteAs of the Red Hat Enterprise Linux 6.1 release, LVM snapshots are supported for mirrored logicalv

Page 82

Merging Snapshot Volumes41WarningBecause the snapshot increases in size as the origin volume changes, it is important to monitorthe percentage of the

Page 83

Chapter 4. LVM Administration with CLI Commands424.4.7. Resizing Logical VolumesTo reduce the size of a logical volume, use the lvreduce command. If t

Page 84

Displaying Logical Volumes43[root@tng3-1 lvm]# lvremove /dev/testvg/testlvDo you really want to remove active logical volume "testlv"? [y/n]

Page 85

Chapter 4. LVM Administration with CLI Commands44# lvextend -L+1G /dev/myvg/homevollvextend -- extending logical volume "/dev/myvg/homevol"

Page 86

Growing Logical Volumes45The following command adds another physical volume to the volume group, which then has 135G ofadditional space.# vgextend vg

Page 87

Chapter 4. LVM Administration with CLI Commands46For example, if you have logical volumes that are mirrored between two sites within a single volumegr

Page 88

Shrinking Logical Volumes47[root@taft-03 ~]# lvs -a -o +devices LV VG Attr LSize Log Copy% Devices mirror

Page 90

Chapter 4. LVM Administration with CLI Commands48filter = [ "a/.*/" ]The following filter removes the cdrom device in order to avoid delays

Page 91 - Appendix A. The Device Mapper

Activating Logical Volumes on Individual Nodes in a Cluster49# pvmove -i5 /dev/sdd14.7. Activating Logical Volumes on Individual Nodes in aClusterIf y

Page 92

Chapter 4. LVM Administration with CLI Commands50 /dev/sdb1 17.14G /dev/sdc1 17.14G /dev/sdd1 17.14G• You can append a field to the output with

Page 93

Object Selection51 /dev/sdd1 =new_vg=lvm2=a- =17.14G=17.14GYou can use the -P argument of the lvs or vgs command to display information about a fail

Page 94 - offsetN

Chapter 4. LVM Administration with CLI Commands52Argument Header Descriptionpv_name PV The physical volume namepv_pe_alloc_count Alloc Number of used

Page 95

Object Selection53 /dev/sdb1 vg lvm2 a- 17.14G 17.14G 0 4389 /dev/sdc1 vg lvm2 a- 17.14G 17.14G 0 4389 /dev/sdd1 v

Page 96

Chapter 4. LVM Administration with CLI Commands54Argument Header Descriptionvg_free_count Free Number of free physical extents in the volume groupvg_n

Page 97 - 0 65536 error

Object Selection55Argument Header DescriptionBit 3: Allocation policy: (c)ontiguous, (n)ormal,(a)nywhere, (i)nherited. This is capitalized if the volu

Page 98

Chapter 4. LVM Administration with CLI Commands56# lvs LV VG Attr LSize Origin Snap% Move Log Copy% Convert lvol0 new_vg owi-a

Page 99

Sorting LVM Reports574.8.3. Sorting LVM ReportsNormally the entire output of the lvs, vgs, or pvs command has to be generated and stored internallybef

Page 100

viiIntroduction1. About This GuideThis book describes the Logical Volume Manager (LVM), including information on running LVM in aclustered environment

Page 101 - A.2. The dmsetup Command

Chapter 4. LVM Administration with CLI Commands58# pvs --units m PV VG Fmt Attr PSize PFree /dev/sda1 lvm2 -- 17555.40M 1

Page 102 - A.2.2. The dmsetup ls Command

Chapter 5.59LVM Configuration ExamplesThis chapter provides some basic LVM configuration examples.5.1. Creating an LVM Logical Volume on Three DisksTh

Page 103

Chapter 5. LVM Configuration Examples60[root@tng3-1 ~]# mkfs.gfs2 -plock_nolock -j 1 /dev/new_vol_group/new_logical_volumeThis will destroy any data o

Page 104

Creating the Logical Volume61You can use the vgs command to display the attributes of the new volume group.[root@tng3-1 ~]# vgs VG #PV

Page 105

Chapter 5. LVM Configuration Examples62In the initial set up, the logical volume mylv is carved from the volume group myvol, which in turnconsists of

Page 106

Creating the New Logical Volume63 Volume group "yourvg" successfully split from "myvg"You can use the vgs command to see the attr

Page 107 - dmsetup command

Chapter 5. LVM Configuration Examples64This example shows how you can remove a disk from an existing logical volume, either to replace thedisk or to u

Page 108

Moving Extents to a New Disk65[root@tng3-1]# pvs -o+pv_used PV VG Fmt Attr PSize PFree Used /dev/sda1 myvg lvm2 a- 17.15G 7.15G 10.

Page 109 - B.2. Sample lvm.conf File

Chapter 5. LVM Configuration Examples665.5. Creating a Mirrored LVM Logical Volume in a ClusterCreating a mirrored LVM logical volume in a cluster req

Page 110

Creating a Mirrored LVM Logical Volume in a Cluster675. Create the mirror. The first step is creating the physical volumes. The following commands cre

Page 111 - Sample lvm.conf File

Introductionviii• Release Notes — Provides information about the current release of Red Hat products.High Availability Add-On documentation and other

Page 112

Chapter 5. LVM Configuration Examples68May 10 14:55:00 doc-07 lvm[19402]: vg001-mirrorlv is now in-sync8. You can use the lvs with the -o +devices opt

Page 113

Chapter 6.69LVM TroubleshootingThis chapter provide instructions for troubleshooting a variety of LVM issues.6.1. Troubleshooting DiagnosticsIf a comm

Page 114

Chapter 6. LVM Troubleshooting70[root@link-07 tmp]# lvs -a -o +devices Volume group "vg" not foundUsing the -P argument shows the logical v

Page 115

Recovering from LVM Mirror Failure71 Physical volume "/dev/sdc1" successfully created Physical volume "/dev/sdc2" successfully c

Page 116

Chapter 6. LVM Troubleshooting72 groupfs vg -wi-a- 752.00M /dev/sdb1(0)At this point you should still be able to use

Page 117

Recovering Physical Volume Metadata73 Logical volume mirror converted.You can use the lvs command to verify that the mirror is restored.[root@link-08

Page 118

Chapter 6. LVM Troubleshooting74indicated above, FmGRh3-zhok-iVI8-7qTD-S5BI-MAEN-NYM5Sk. This command restores thephysical volume label with the metad

Page 119

Removing Lost Physical Volumes from a Volume Group756.6. Removing Lost Physical Volumes from a Volume GroupIf you lose a physical volume, you can acti

Page 120

Chapter 6. LVM Troubleshooting76Alternately, you can extend the logical volume to use a percentage of the remaining free spacein the volume group by u

Page 121 - Appendix C. LVM Object Tags

Chapter 7.77LVM Administration with the LVM GUIIn addition to the Command Line Interface (CLI), LVM provides a Graphical User Interface (GUI)which you

Page 122

Typographic ConventionsixPress Ctrl+Alt+F2 to switch to the first virtual terminal. Press Ctrl+Alt+F1 toreturn to your X-Windows session.The first par

Page 124 - D.3. Sample Metadata

79Appendix A. The Device MapperThe Device Mapper is a kernel driver that provides a framework for volume management. It providesa generic way of creat

Page 125 - Sample Metadata

Appendix A. The Device Mapper80• mirror• snapshot and snapshot-origin• error• zero• multipath• cryptA.1.1. The linear Mapping TargetA linear mapping t

Page 126

The striped Mapping Target81startstarting block in virtual devicelengthlength of this segment#stripesnumber of stripes for the virtual devicechunk_siz

Page 127 - Appendix E. Revision History

Appendix A. The Device Mapper820 65536 striped 2 512 /dev/hda 0 /dev/hdb 0A.1.3. The mirror Mapping TargetThe mirror mapping target supports the mappi

Page 128

The snapshot and snapshot-origin Mapping Targets83logargsthe log arguments for the mirror; the number of log arguments provided is specified by the #l

Page 129

Appendix A. The Device Mapper841. A device with a linear mapping containing the original mapping table of the source volume.2. A device with a linear

Page 130

The error Mapping Target85startstarting block in virtual devicelengthlength of this segmentoriginbase volume of snapshotCOW-deviceDevice on which chan

Page 131

Appendix A. The Device Mapper86The zero mapping target takes no additional parameters besides the start and lengthparameters.The following example sho

Page 132

The multipath Mapping Target87pathgroupThe next path group to try.pathgroupsargsEach path group consists of the following arguments:pathselector #sele

Commentaires sur ces manuels

Pas de commentaire