Installation guide
Table Of Contents
- LVM Administrator's Guide
- Table of Contents
- Introduction
- Chapter 1. The LVM Logical Volume Manager
- Chapter 2. LVM Components
- Chapter 3. LVM Administration Overview
- Chapter 4. LVM Administration with CLI Commands
- 1. Using CLI Commands
- 2. Physical Volume Administration
- 3. Volume Group Administration
- 3.1. Creating Volume Groups
- 3.2. Adding Physical Volumes to a Volume Group
- 3.3. Displaying Volume Groups
- 3.4. Scanning Disks for Volume Groups to Build the Cache File
- 3.5. Removing Physical Volumes from a Volume Group
- 3.6. Changing the Parameters of a Volume Group
- 3.7. Activating and Deactivating Volume Groups
- 3.8. Removing Volume Groups
- 3.9. Splitting a Volume Group
- 3.10. Combining Volume Groups
- 3.11. Backing Up Volume Group Metadata
- 3.12. Renaming a Volume Group
- 3.13. Moving a Volume Group to Another System
- 3.14. Recreating a Volume Group Directory
- 4. Logical Volume Administration
- 4.1. Creating Logical Volumes
- 4.2. Persistent Device Numbers
- 4.3. Resizing Logical Volumes
- 4.4. Changing the Parameters of a Logical Volume Group
- 4.5. Renaming Logical Volumes
- 4.6. Removing Logical Volumes
- 4.7. Displaying Logical Volumes
- 4.8. Growing Logical Volumes
- 4.9. Extending a Striped Volume
- 4.10. Shrinking Logical Volumes
- 5. Creating Snapshot Volumes
- 6. Controlling LVM Device Scans with Filters
- 7. Online Data Relocation
- 8. Activating Logical Volumes on Individual Nodes in a Cluster
- 9. Customized Reporting for LVM
- Chapter 5. LVM Configuration Examples
- Chapter 6. LVM Troubleshooting
- Chapter 7. LVM Administration with the LVM GUI
- Appendix A. The Device Mapper
- Appendix B. The LVM Configuration Files
- Appendix C. LVM Object Tags
- Appendix D. LVM Volume Group Metadata
- Index

Note
Because the snapshot increases in size as the origin volume changes, it is import-
ant to monitor the percentage of the snapshot volume regularly with the lvs com-
mand to be sure it does not fill. A snapshot that is 100% full is lost completely, as
write to unchanged parts of the originin would be unable to succeed without cor-
rupting the snapshot.
6. Controlling LVM Device Scans with Filters
At startup, the vgscan command is run to scan the block devices on the system looking for LVM
labels, to determine which of them are physical volumes and to read the metadata and build up
a list of volume groups. The names of the physical volumes are stored in the cache file of each
node in the system, /etc/lvm/.cache. Subsequent commands may read that file to avoiding res-
canning.
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 to accept or reject each block device found.
The following examples show the use of filters to control which devices LVM scans. Note that
some of these examples do not necessarily represent best practice, as the regular expressions
are matched freely against the complete pathname. For example, a/loop/ is equivalent to a/
.*loop.*/ and would match /dev/solooperation/lvol1.
The following filter adds all discovered devices, which is the default behavior as there is no filter
configured in the configuration file:
filter = [ "a/.*/" ]
The following filter removes the cdrom device in order to avoid delays if the drive contains no
media:
filter = [ "r|/dev/cdrom|" ]
The following filter adds all loop and removes all other block devices:
filter = [ "a/loop.*/", "r/.*/" ]
The following filter adds all loop and IDE and removes all other block devices:
filter =[ "a|loop.*|", "a|/dev/hd.*|", "r|.*|" ]
The following filter adds just partition 8 on the first IDE drive and removes all other block
devices:
6. Controlling LVM Device Scans with Filters
38