• Aucun résultat trouvé

3.4 . Logical Volume Backup

Metadata backups and archives are automatically created whenever there is a configuration change for a volume group or logical volume, unless this feature is disabled in the l vm. co nf file. By default, the metadata backup is stored in the /etc/l vm/backup file and the metadata archives are stored in the /etc/l vm/archi ve file. How long the metadata archives stored in the /etc/l vm/archi ve file are kept and how many archive files are kept is determined by parameters you can set in the

l vm. co nf file. A daily system backup should include the contents of the /etc/l vm directory in the backup.

Note that a metadata backup does not back up the user and system data contained in the logical volumes.

You can manually back up the metadata to the /etc/l vm/backup file with the vg cfg backup command. You can restore metadata with the vg cfg resto re command. The vg cfg backup and vg cfg resto re commands are described in Section 4.3.13, “ Backing Up Volume Group Metadata”.

3.5. Logging

All message output passes through a logging module with independent choices of logging levels for:

standard output/error syslog

log file

external log function

The logging levels are set in the /etc/l vm/l vm. co nf file, which is described in Appendix B, The LVM Configuration Files.

3.6. T he Met adat a Daemon (lvmet ad)

LVM can optionally use a central metadata cache, implemented through a daemon (l vmetad) and a ud ev rule. The metadata daemon has two main purposes: it improves performance of LVM

commands and it allows ud ev to automatically activate logical volumes or entire volume groups as they become available to the system.

LVM is configured to make use of the daemon when the g l o bal /use_l vmetad variable is set to 1 in the l vm. co nf configuration file. This is the default value. For information on the l vm. co nf configuration file, refer to Appendix B, The LVM Configuration Files.

Note

The l vmetad daemon is not currently supported across the nodes of a cluster, and requires that the locking type be local file-based locking. When you use the l vmco nf --enabl e-cl uster/--d i sabl e-e-cl uster command, the l vm. co nf file is configured appropriately, including the use_l vmetad setting (which should be 0 for l o cki ng _type= 3).

If you change the value of use_l vmetad from 1 to 0, you must reboot or stop the l vmetad service manually with the following command.

# systemctl sto p l vm2-l vmetad . servi ce

Normally, each LVM command issues a disk scan to find all relevant physical volumes and to read volume group metadata. However, if the metadata daemon is running and enabled, this expensive scan can be skipped. Instead, the l vmetad daemon scans each device only once, when it becomes available, via ud ev rules. This can save a significant amount of I/O and reduce the time required to complete LVM operations, particularly on systems with many disks.

When a new volume group is made available at runtime (for example, through hotplug or iSCSI), its logical volumes must be activated in order to be used. When the l vmetad daemon is enabled, the acti vati o n/auto _acti vati o n_vo l ume_l i st option in the l vm. co nf configuration file can be used to configure a list of volume groups and/or logical volumes that should be automatically activated. Without the l vmetad daemon, a manual activation is necessary.

Note

When the l vmetad daemon is running, the fi l ter = setting in the /etc/l vm/l vm. co nf file does not apply when you execute the pvscan --cache device command. To filter devices, you need to use the g l o bal _fi l ter = setting. Devices that fail the global filter are not opened by LVM and are never scanned. You may need to use a global filter, for example, when you use LVM devices in VMs and you do not want the contents of the devices in the VMs to be scanned by the physical host.

3.7. Displaying LVM Informat ion wit h t he

l vm

Command

The l vm command provides several built-in options that you can use to display information about LVM support and configuration.

l vm d umpco nfi g

Displays the LVM configuration information after loading the /etc/l vm/l vm. co nf file and any other configuration files. For information on the LVM configuration files, see Appendix B, The LVM Configuration Files.

l vm d evtypes

Displays the recognized build-in block device types (Red Hat Enterprise Linux release 6.6 and later).

l vm fo rmats

Displays recognizes metadata formats.

l vm hel p

Displays LVM help text.

l vm seg types

Displayes recognized logical volume segment types.

l vm tag s

Displays any tags defined on this host. For information on LVM object tags, see Appendix C, LVM Object Tags.

l vm versi o n

Displays the current version information.

Chapter 4. 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 volume for a clustered environment, you must ensure that you are running the cl vmd daemon. For information, see Section 3.1, “ Creating LVM Volumes in a Cluster”.

In addition to the LVM Command Line Interface (CLI), you can System Storage Manager (SSM) to configure LVM logical volumes. For information on using SSM with LVM, see the Storage Administration Guide.