Red Hat ENTERPRISE LINUX 4 - LVM ADMINISTRATOR Guida di Installazione

Navigare online o scaricare Guida di Installazione per Manuali per software Red Hat ENTERPRISE LINUX 4 - LVM ADMINISTRATOR. Red Hat ENTERPRISE LINUX 4 - LVM ADMINISTRATOR Installation guide Manuale Utente

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa

Sommario

Pagina 1 - Manager Administration

Red Hat Enterprise Linux 6Logical VolumeManager AdministrationLVM Administrator Guide

Pagina 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

Pagina 3

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

Pagina 4

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

Pagina 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

Pagina 6

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

Pagina 7 - Introduction

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

Pagina 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

Pagina 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

Pagina 10 - 6.3. Notes and Warnings

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

Pagina 12

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

Pagina 13 - 1.1. New and Changed Features

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

Pagina 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

Pagina 15

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

Pagina 16

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

Pagina 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

Pagina 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

Pagina 19

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

Pagina 20

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

Pagina 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 #

Pagina 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

Pagina 23 - 2.3. LVM Logical Volumes

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

Pagina 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

Pagina 27

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

Pagina 28

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

Pagina 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

Pagina 30 - 3.4. Logical Volume Backup

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

Pagina 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.

Pagina 33 - Commands

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

Pagina 34

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

Pagina 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

Pagina 36

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

Pagina 37 - 4.3.1. Creating Volume Groups

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

Pagina 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

Pagina 40

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

Pagina 41

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

Pagina 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

Pagina 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

Pagina 44

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

Pagina 45

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

Pagina 47

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

Pagina 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

Pagina 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

Pagina 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

Pagina 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

Pagina 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

Pagina 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

Pagina 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

Pagina 55

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

Pagina 56

iiiIntroduction vii1.

Pagina 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

Pagina 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

Pagina 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

Pagina 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

Pagina 62

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

Pagina 63 - 4.8.2. Object Selection

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

Pagina 64

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

Pagina 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

Pagina 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

Pagina 67

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

Pagina 68

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

Pagina 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"

Pagina 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

Pagina 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

Pagina 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

Pagina 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

Pagina 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

Pagina 75

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

Pagina 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

Pagina 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

Pagina 78

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

Pagina 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

Pagina 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

Pagina 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

Pagina 82

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

Pagina 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

Pagina 84

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

Pagina 85

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

Pagina 86

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

Pagina 87

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

Pagina 88

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

Pagina 90

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

Pagina 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

Pagina 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

Pagina 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

Pagina 94 - offsetN

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

Pagina 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

Pagina 96

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

Pagina 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

Pagina 98

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

Pagina 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

Pagina 100

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

Pagina 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

Pagina 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

Pagina 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

Pagina 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

Pagina 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

Pagina 106

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

Pagina 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

Pagina 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.

Pagina 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

Pagina 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

Pagina 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

Pagina 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

Pagina 113

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

Pagina 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

Pagina 115

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

Pagina 116

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

Pagina 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

Pagina 118

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

Pagina 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

Pagina 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

Pagina 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

Pagina 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

Pagina 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

Pagina 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

Pagina 126

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

Pagina 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

Pagina 128

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

Pagina 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

Pagina 130

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

Pagina 131

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

Pagina 132

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

Commenti su questo manuale

Nessun commento