REDHAT LVM ADMINISTRATOR FOR RHEL 4.5 Configuration

Download or browse on-line these Configuration for Red Hat LVM ADMINISTRATOR FOR RHEL 4.5 Other.

Red Hat LVM ADMINISTRATOR FOR RHEL 4.5 Manual Information:

This manual for Red Hat LVM ADMINISTRATOR FOR RHEL 4.5, given in the PDF format, is available for free online viewing and download without logging on. The guide contains 112 pages, and the size of the file at download is 0.67 Mb. The document type is Configuration.

Download Manual

Summary of Contents:

[Page 1] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

LVM Administrator's Guide for RHEL 4.5 Configuration and Administration 4.5 Cluster_Logical_Volume_Manager ISBN: N/A Publication date: July 2008 ...

[Page 2] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

This book describes the LVM logical volume manager, including information on running LVM in a clustered environment. The content of this document is specific to the LVM2 release in Red Hat Enterprise Linux Release 4.5. LVM Administrator's Guide ...

[Page 3] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

LVM Administrator's Guide for RHEL 4.5: Configuration and Administration Copyright © 2008 Red Hat, Inc. Copyright © 2008 Red Hat, Inc. This material may only be distributed subject to the terms and conditions set forth in the Open Publication ...

[Page 4] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

LVM Administrator's Guide for RHEL 4.5 ...

[Page 5] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

Introduction ...............................................................................................................ix 1. Audience .......................................................................................................ix 2. So...

[Page 6] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

3.10. Combining Volume Groups ...............................................................31 3.11. Backing Up Volume Group Metadata .................................................31 3.12. Renaming a Volume Group ....................................

[Page 7] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

1. Troubleshooting Diagnostics ..........................................................................69 2. Displaying Information on Failed Devices .......................................................69 3. Recovering from LVM Mirror Failure .....

[Page 8] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

viii ...

[Page 9] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

Introduction This book describes the Logical Volume Manager (LVM), including information on running LVM in a clustered environment. The content of this document is specific to the LVM2 release. 1. Audience This book is intended to be used by system a...

[Page 10] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

• Configuring and Managing a Red Hat Cluster — Provides information about installing, configuring and managing Red Hat Cluster components. • Global File System: Configuration and Administration — Provides information about installing, configu...

[Page 11] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

/bin/ bold font Bold font represents application programs and text found on a graphical interface. When shown like this: OK , it indicates a button on a graphical application interface. Additionally, the manual uses different strategies to draw your ...

[Page 12] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

If you spot a typo, or if you have thought of a way to make this manual better, we would love to hear from you. Please submit a report in Bugzilla (http://bugzilla.redhat.com/bugzilla/) against the component rh-cs. Be sure to mention the manual'...

[Page 13] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

The LVM Logical Volume Manager This chapter provides a high-level overview of the components of the Logical Volume Manager (LVM), and includes a summary of new and changed LVM features in Red Hat Enterprise Linux 4.5. 1. New and Changed Features This...

[Page 14] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

• Convenient device naming Logical storage volumes can be managed in user-defined groups, which you can name according to your convenience. • Disk striping You can create a logical volume that stripes data across two or more disks. This can drama...

[Page 15] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

process is analogous to the way in which disks are divided into partitions. A logical volume is used by file systems and applications (such as databases). Figure 1.1, “LVM Logical Volume Components” shows the components of a simple LVM logical vo...

[Page 16] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

Figure 1.2. CLVM Overview Logical volumes created with CLVM on shared storage are visible to all computers that have access to the shared storage. CLVM allows a user to configure logical volumes on shared storage by locking access to physical storage...

[Page 17] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

Note CLVM requires changes to the lvm.conf file for cluster-wide locking. For information on configuring the lvm.conf file to support CLVM, see Section 1, “Creating LVM Volumes in a Cluster”. You configure LVM volumes for use in a cluster with th...

[Page 18] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

6 ...

[Page 19] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

LVM Components This chapter describes the components of an LVM Logical volume. 1. Physical Volumes The underlying physical storage unit of an LVM logical volume is a block device such as a partition or whole disk. To use the device for an LVM logical...

[Page 20] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

In the Linux kernel (and throughout this document), sectors are considered to be 512 bytes in size. Figure 2.1. Physical Volume layout 1.2. Multiple Partitions on a Disk LVM allows you to create physical volumes out of disk partitions. It is generall...

[Page 21] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

may be necessary to move data around partitions when you are migrating an existing system to LVM volumes. Additionally, if you have a very large disk and want to have more than one volume group for administrative purposes then it is necessary to part...

[Page 22] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

Figure 2.2. Extent Mapping The physical volumes that make up a logical volume do not have to be the same size. Figure 2.3, “Linear Volume with Unequal Physical Volumes” shows volume group VG1 with a physical extent size of 4MB. This volume group ...

[Page 23] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

Figure 2.3. Linear Volume with Unequal Physical Volumes You can configure more than one linear logical volume of whatever size you desire from the pool of physical extents. Figure 2.4, “Multiple Logical Volumes” shows the same volume group as in ...

[Page 24] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

Figure 2.4. Multiple Logical Volumes 3.2. Striped Logical Volumes When you write data to an LVM logical volume, the file system lays the data out across the underlying physical volumes. You can control the way the data is written to the physical volu...

[Page 25] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

Figure 2.5. Striping Data Across Three PVs Striped logical volumes can be extended by concatenating another set of devices onto the end of the first set. In order extend a striped logical volume, however, there must be enough free space on the underl...

[Page 26] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

mirror or mirrors. This log can be kept on disk, which will keep it persistent across reboots, or it can be maintained in memory. Figure 2.6, “Mirrored Logical Volume” shows a mirrored logical volume with one mirror. In this configuration, the lo...

[Page 27] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

Because a snapshot copies only the data areas that change after the snapshot is created, the snapshot feature requires a minimal amount of storage. For example, with a rarely updated origin, 3-5 % of the origin's capacity is sufficient to mainta...

[Page 28] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

16 ...

[Page 29] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

LVM Administration Overview This chapter provides an overview of the administrative procedures you use to configure LVM logical volumes. This chapter is intended to provide a general understanding of the steps involved. For specific step-by-step exam...

[Page 30] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

1. Create a GFS file system on the logical volume with the gfs_mkfs command. 2. Create a new mount point with the mkdir command. In a clustered system, create the mount point on all nodes in the cluster. 3. Mount the file system. You may want to add ...

[Page 31] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

vgcfgrestore commands are described in Section 3.11, “Backing Up Volume Group Metadata”. 5. Logging All message output passes through a logging module with independent choices of logging levels for: • standard output/error • syslog • log fi...

[Page 32] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

20 ...

[Page 33] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

LVM Administration with CLI Commands This chapter summarizes the individual administrative tasks you can perform with the LVM Command Line Interface (CLI) commands to create and maintain logical volumes. Note If you are creating or modifying an LVM v...

[Page 34] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

# lvcreate -v -L 50MB new_vg Finding volume group "new_vg" Rounding up size to full physical extent 52.00 MB Archiving volume group "new_vg" metadata (seqno 4). Creating logical volume lvol0 Creating volume group backup "/etc...

[Page 35] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

object. This can be useful in a situation where you remove a physical volume called /dev/sdf which is part of a volume group and, when you plug it back in, you find that it is now /dev/sdk. LVM will still find the physical volume because it identifie...

[Page 36] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

You can scan for block devices that may be used as physical volumes with the lvmdiskscan command, as shown in the following example. # lvmdiskscan /dev/ram0 [ 16.00 MB] /dev/sda [ 17.15 GB] /dev/root [ 13.69 GB] /dev/ram [ 16.00 MB] /dev/sda1 [ 17.14...

[Page 37] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

volume. # pvdisplay --- Physical volume --- PV Name /dev/sdc1 VG Name new_vg PV Size 17.14 GB / not usable 3.40 MB Allocatable yes PE Size (KByte) 4096 Total PE 4388 Free PE 4375 Allocated PE 13 PV UUID Joqlch-yWSj-kuEn-IdwM-01S9-XO8M-mcpsVe The pvsc...

[Page 38] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

the physical volume. 2.5. Removing Physical Volumes If a device is no longer required for use by LVM, you can remove the LVM label with the pvremove command. Executing the pvremove command zeroes the LVM metadata on an empty physical volume. If the p...

[Page 39] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

The contiguous policy requires that new extents are adjacent to existing extents. If there are sufficient free extents to satisfy an allocation request but a normal allocation policy would not use them, the anywhere allocation policy will, even if th...

[Page 40] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

vgscan command, see Section 3.4, “Scanning Disks for Volume Groups to Build the Cache File”. The vgs command provides volume group information in a configurable form, displaying one line per volume group. The vgs command provides a great deal of ...

[Page 41] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

LVM Device Scans with Filters”. The following example shows the output of a vgscan command. # vgscan Reading all physical volumes. This may take a while... Found volume group "new_vg" using metadata type lvm2 Found volume group "offi...

[Page 42] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

There are several volume group parameters that you can change for an existing volume group with the vgchange command. Primarily, however, this command is used to deactivate and activate volume groups, as described in Section 3.7, “Activating and De...

[Page 43] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

3.9. Splitting a Volume Group To split the physical volumes of a volume group and create a new volume group, use the vgsplit command. Logical volumes cannot be split between volume groups. Each existing logical volume must be entirely on the physical...

[Page 44] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

vgrename /dev/vg02 /dev/my_volume_group vgrename vg02 my_volume_group 3.13. Moving a Volume Group to Another System You can move an entire LVM volume group to another system. It is recommended that you use the vgexport and vgimport commands when you ...

[Page 45] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

3.14. Recreating a Volume Group Directory To recreate a volume group directory and logical volume special files, use the vgmknodes command. This command checks the LVM2 special files in the /dev directory that are needed for active logical volumes. I...

[Page 46] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

You can use the -l argument of the lvcreate command to specify the size of the logical volume in extents. You can also use this argument to specify the percentage of the volume group to use for the logical volume. The following command creates a logi...

[Page 47] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

following example creates a linear logical volume out of extents 0 through 25 of physical volume /dev/sda1 and extents 50 through 125 of physical volume /dev/sdb1 in volume group testvg. lvcreate -l 100 -n testlv testvg /dev/sda1:0-25 /dev/sdb1:50-12...

[Page 48] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

across two physical volumes, is named stripelv and is in volume group testvg. The stripe will use sectors 0-50 of /dev/sda1 and sectors 50-100 of /dev/sdb1. # lvcreate -l 100 -i2 -nstripelv testvg /dev/sda1:0-50 /dev/sdb1:50-100 Using default stripes...

[Page 49] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

ignored. The following command creates a mirrored logical volume with a single mirror. The volume is 500 megabytes in size, it is named mirrorlv, and it is carved out of volume group vg0. The first leg of the mirror is on device /dev/sda1, the second...

[Page 50] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

4.2. Persistent Device Numbers Major and minor device numbers are allocated dynamically at module load. Some applications work best if the block device always is activated with the same device (major and minor) number. You can specify these with the ...

[Page 51] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

4.5. Renaming Logical Volumes To rename an existing logical volume, use the lvrename command. Either of the following commands renames logical volume lvold in volume group vg02 to lvnew. lvrename /dev/vg02/lvold /dev/vg02/lvnew lvrename vg02 lvold lv...

[Page 52] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

mapping) in a fixed format. The following command shows the attributes of lvol2 in vg00. If snapshot logical volumes have been created for this original logical volume, this command shows a list of all snapshot logical volumes and their status (activ...

[Page 53] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

[root@tng3-1 ~]# lvextend -l +100%FREE /dev/myvg/testlv Extending logical volume testlv to 68.59 GB Logical volume testlv successfully resized After you have extended the logical volume it is necessary to increase the file system size to match. By de...

[Page 54] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

The following command adds another physical volume to the volume group, which then has 135G of additional space. # vgextend vg /dev/sdc1 Volume group "vg" successfully extended # vgs VG #PV #LV #SN Attr VSize VFree vg 3 1 0 wz--n- 406.97G 1...

[Page 55] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

more required # lvextend -i1 -l+100%FREE vg/stripe1 4.10. Shrinking Logical Volumes To reduce the size of a logical volume, first unmount the file system. You can then use the lvreduce command to shrink the volume. After shrinking the volume, remount...

[Page 56] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

The following example shows the status of the logical volume /dev/new_vg/lvol0, for which a snapshot volume /dev/new_vg/newvgsnap has been created. # lvdisplay /dev/new_vg/lvol0 --- Logical volume --- LV Name /dev/new_vg/lvol0 VG Name new_vg LV UUID ...

[Page 57] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

rescanning. You can control which devices LVM scans by setting up filters in the lvm.conf configuration file. The filters consist of a series of simple regular expressions that get applied to the device names in the /dev directory to decide whether t...

[Page 58] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

The pvmove command breaks up the data to be moved into sections and creates a temporary mirror to move each section. For more information on the operation of the pvmove command, see the pvmove(8) man page. Because the pvmove command uses mirroring, i...

[Page 59] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

You can also activate logical volumes on individual nodes by using LVM tags, which are described in Appendix C, LVM Object Tags. You can also specify activation of nodes in the configuration file, which is described in Appendix B, The LVM Configurati...

[Page 60] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

• You can append a field to the output with the plus sign (+), which is used in combination with the -o argument. The following example displays the UUID of the physical volume in addition to the default fields. # pvs -o +pv_uuid PV VG Fmt Attr PSi...

[Page 61] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

PV=VG=Fmt=Attr=PSize=PFree /dev/sdb1=new_vg=lvm2=a-=17.14G=17.14G /dev/sdc1=new_vg=lvm2=a-=17.14G=17.09G /dev/sdd1=new_vg=lvm2=a-=17.14G=17.14G To keep the fields aligned when using the separator argument, use the separator argument in conjunction wi...

[Page 62] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

17.09G 17.14G The pvs Command Table 4.1, “pvs Display Fields” lists the display arguments of the pvs command, along with the field name as it appears in the header display and a description of the field. Argument Header Description dev_size DevSi...

[Page 63] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

# pvs -v Scanning for physical volume names PV VG Fmt Attr PSize PFree DevSize PV UUID /dev/sdb1 new_vg lvm2 a- 17.14G 17.14G 17.14G onFF2w-1fLC-ughJ-D9eB-M7iv-6XqA-dqGeXY /dev/sdc1 new_vg lvm2 a- 17.14G 17.09G 17.14G Joqlch-yWSj-kuEn-IdwM-01S9-XO8M-...

[Page 64] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

/dev/ram5 -- 0 0 /dev/ram6 -- 0 0 /dev/root -- 0 0 /dev/sda -- 0 0 /dev/sdb -- 0 0 /dev/sdb1 new_vg lvm2 a- 17.14G 17.14G /dev/sdc -- 0 0 /dev/sdc1 new_vg lvm2 a- 17.14G 17.09G /dev/sdd -- 0 0 /dev/sdd1 new_vg lvm2 a- 17.14G 17.14G The vgs Command Ta...

[Page 65] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

# vgs VG #PV #LV #SN Attr VSize VFree new_vg 3 1 1 wz--n- 51.42G 51.36G Using the -v argument with the vgs command adds the following fields to the default display: vg_extent_size, vg_uuid. # vgs -v Finding all volume groups Finding volume group &quo...

[Page 66] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

Argument Header Description lv_kernel_majorKMaj Actual major device number of the logical volume (-1 if inactive) lv_kernel_minorKMIN Actual minor device number of the logical volume (-1 if inactive) lv_major Maj The persistent major device number of...

[Page 67] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

# lvs LV VG Attr LSize Origin Snap% Move Log Copy% lvol0 new_vg owi-a- 52.00M newvgsnap1 new_vg swi-a- 8.00M lvol0 0.20 Using the -v argauament with the lvs command adds the following fields to the default display: seg_count, lv_major, lv_minor, lv_k...

[Page 68] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

argument specified. # lvs LV VG Attr LSize Origin Snap% Move Log Copy% lvol0 new_vg -wi-a- 52.00M # lvs --segments LV VG Attr #Str Type SSize lvol0 new_vg -wi-a- 1 linear 52.00M 9.3. Sorting LVM Reports Normally the entire output of the lvs, vgs, or ...

[Page 69] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

# pvs -o pv_name,pv_size,pv_free -O -pv_free PV PSize PFree /dev/sdd1 17.14G 17.14G /dev/sdb1 17.14G 17.14G /dev/sdc1 17.14G 17.09G 9.4. Specifying Units To specify the unit for the LVM report display, use the --units argument of the report command. ...

[Page 70] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

The following example displays the output of the pvs command as a number of sectors. # pvs --units s PV VG Fmt Attr PSize PFree /dev/sdb1 new_vg lvm2 a- 35946496S 35946496S /dev/sdc1 new_vg lvm2 a- 35946496S 35840000S /dev/sdd1 new_vg lvm2 a- 3594649...

[Page 71] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

LVM Configuration Examples This chapter provides some basic LVM configuration examples. 1. Creating an LVM Logical Volume on Three Disks This example creates an LVM logical volume called new_logical_volume that consists of the disks at /dev/sda1, /de...

[Page 72] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

[root@tng3-1 ~]# lvcreate -L2G -n new_logical_volume new_vol_group Logical volume "new_logical_volume" created 1.4. Creating the File System The following command creates a GFS file system on the logical volume. [root@tng3-1 ~]# gfs_mkfs -p...

[Page 73] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

This command destroys any data on /dev/sda1, /dev/sdb1, and /dev/sdc1. [root@tng3-1 ~]# pvcreate /dev/sda1 /dev/sdb1 /dev/sdc1 Physical volume "/dev/sda1" successfully created Physical volume "/dev/sdb1" successfully created Physi...

[Page 74] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

Are you sure you want to proceed? [y/n] y Device: /dev/striped_vol_group/striped_logical_volume Blocksize: 4096 Filesystem Size: 492484 Journals: 1 Resource Groups: 8 Locking Protocol: lock_nolock Lock Table: Syncing... All Done The following command...

[Page 75] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

3.2. Moving the Data You can move all the used physical extents in /dev/sdc1 to /dev/sdb1 with the pvmove command. The pvmove command can take a long time to execute. [root@tng3-1 ~]# pvmove /dev/sdc1 /dev/sdb1 /dev/sdc1: Moved: 14.7% /dev/sdc1: Move...

[Page 76] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

3.4. Creating the New Logical Volume After creating the new volume group, you can create the new logical volume yourlv. [root@tng3-1 ~]# lvcreate -L5G -n yourlv yourvg Logical volume "yourlv" created 3.5. Making a File System and Mounting t...

[Page 77] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

replace the disk or to use the disk as part of a different volume. In order to remove a disk, you must first move the extents on the LVM physical volume to a different disk or set of disks. 4.1. Moving Extents to Existing Physical Volumes In this exa...

[Page 78] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

/dev/sdd1 myvg lvm2 a- 17.15G 2.15G The disk can now be physically removed or allocated to other users. 4.2. Moving Extents to a New Disk In this example, the logical volume is distributed across three physical volumes in the volume group myvg as fol...

[Page 79] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

/dev/sdb1: Moved: 79.7% ... /dev/sdb1: Moved: 100.0% [root@tng3-1]# pvs -o+pv_used PV VG Fmt Attr PSize PFree Used /dev/sda1 myvg lvm2 a- 17.15G 7.15G 10.00G /dev/sdb1 myvg lvm2 a- 17.15G 17.15G 0 /dev/sdc1 myvg lvm2 a- 17.15G 15.15G 2.00G /dev/sdd1 ...

[Page 80] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

68 ...

[Page 81] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

LVM Troubleshooting This chapter provide instructions for troubleshooting a variety of LVM issues. 1. Troubleshooting Diagnostics If a command is not working as expected, you can gather diagnostics in the following ways: • Use the -v, -vv, -vvv, or...

[Page 82] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

Partial mode. Incomplete volume groups will be activated read-only. VG #PV #LV #SN Attr VSize VFree Devices vg 9 2 0 rz-pn- 2.11T 2.07T unknown device(0) vg 9 2 0 rz-pn- 2.11T 2.07T unknown device(5120),/dev/sda1(0) In this example, the failed device...

[Page 83] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

3. Recovering from LVM Mirror Failure This section provides an example of recovering from a situation where one leg of an LVM mirrored volume fails because the underlying device for a physical volume goes down. When a mirror leg fails, LVM converts t...

[Page 84] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

/dev/sdb1(0) [groupfs_mlog] vg lwi-ao 4.00M /dev/sdc1(0) [root@link-08 ~]# lvs -a -o +devices LV VG Attr LSize Origin Snap% Move Log Copy% Devices groupfs vg mwi-a- 752.00M groupfs_mlog 100.00 groupfs_mimage_0(0),groupfs_mimage_1(0) [groupfs_mimage_0...

[Page 85] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

PV /dev/sdc2 VG vg lvm2 [67.83 GB / 67.83 GB free] PV /dev/sdd1 VG vg lvm2 [67.83 GB / 67.83 GB free] PV /dev/sdd2 VG vg lvm2 [67.83 GB / 67.83 GB free] PV /dev/sde1 VG vg lvm2 [67.83 GB / 67.83 GB free] PV /dev/sde2 VG vg lvm2 [67.83 GB / 67.83 GB f...

[Page 86] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

Copy% Devices groupfs vg mwi-a- 752.00M groupfs_mlog 68.62 groupfs_mimage_0(0),groupfs_mimage_1(0) [groupfs_mimage_0] vg iwi-ao 752.00M /dev/sdb1(0) [groupfs_mimage_1] vg iwi-ao 752.00M /dev/sda1(0) [groupfs_mlog] vg lwi-ao 4.00M /dev/sdc1(0) 4. Reco...

[Page 87] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

Use the --uuid and --restorefile arguments of the pvcreate command to restore the physical volume. The following example labels the /dev/sdh1 device as a physical volume with the UUID indicated above, FmGRh3-zhok-iVI8-7qTD-S5BI-MAEN-NYM5Sk. This comm...

[Page 88] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

If the on-disk LVM metadata takes as least as much space as what overrode it, this command can recover the physical volume. If what overrode the metadata went past the metadata area, the data on the volume may have been affected. You might be able to...

[Page 89] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

# vgdisplay --- Volume group --- ... Free PE / Size 8780 / 34.30 GB Alternately, you can use the vg_free_count and vg_extent_count arguments of the vgs command to display the free extents and the total number of extents. [root@tng3-1 ~]# vgs -o +vg_f...

[Page 90] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

78 ...

[Page 91] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

LVM Administration with the LVM GUI In addition to the Command Line Interface (CLI), LVM provides a Graphical User Interface (GUI) which you can use to configure LVM logical volumes. You can bring up this utility by typing system-config-lvm. The LVM ...

[Page 92] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

80 ...

[Page 93] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

Appendix A. The Device Mapper The Device Mapper is a kernel driver that provides a generic framework for volume management. It provides a generic way of creating mapped devices, which may be used as logical volumes. It does not specifically know abou...

[Page 94] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

82 ...

[Page 95] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

Appendix B. The LVM Configuration Files LVM supports multiple configuration files. At system startup, the lvm.conf configuration file is loaded from the directory specified by the environment variable LVM_SYSTEM_DIR, which is set to /etc/lvm by defau...

[Page 96] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

The following is a sample lvm.conf configuration file. [root@tng3-1 lvm]# cat lvm.conf # 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 file. # # Re...

[Page 97] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

# When testing I like to work with just loopback devices: # filter = [ "a/loop/", "r/.*/" ] # Or maybe all loops and ide drives except hdc: # filter =[ "a|loop|", "r|/dev/hdc|", "a|/dev/ide|", "r...

[Page 98] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

# There are 6 syslog-like log levels currently in use - 2 to 7 inclusive. # 7 is the most verbose (LOG_DEBUG). level = 0 # Format of output messages # Whether or not (1 or 0) to indent messages according to their severity indent = 1 # Whether or not ...

[Page 99] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

} # Settings for the running LVM2 in shell (readline) mode. shell { # Number of lines of history to store in ~/.lvm_history history_size = 100 } # Miscellaneous global LVM2 settings global { library_dir = "/usr/lib" # The file creation mask...

[Page 100] Red Hat LVM ADMINISTRATOR FOR RHEL 4.5

locking_type = 1 # If using external locking (type 2) and initialisation fails, # with this set to 1 an attempt will be made to use the built-in # clustered locking. # If you are using a customised locking_library you should set this to 0. fallback_t...