Chapter 16. Layering LVM physical volumes on top of logical volumes
You can configure LVM so that it is possible to create physical volumes on top of logical volumes.
By default, LVM commands do not scan the logical volumes on your system. This default behavior provides the following advantages:
- If there are many active logical volumes on the system, every LVM command would require additional time, negatively impacting performance and causing unwanted delays or timeouts.
- If logical volumes contain physical volumes from a guest VM image, the host usually does not want to scan or use those layered physical volumes which belong to the guest. Note, however, that in the cases where a guest VM’s physical volume exists directly on an SCSI device visible to the host, in order to prevent LVM on the host from accessing those physical volumes you will need to configure a filter, as described in Chapter 15, Controlling LVM device scanning.
Scanning logical volumes may be necessary when layering physical volumes on top of logical volumes is intentional. This will allow the
pvcreate command to be run on a logical volume. To configure LVM to scan all logical volumes, set the
scan_lvs configuration option in the
/etc/lvm/lvm.conf file to
scan_lvs=1. To restrict which logical volumes LVM commands scan, you can then set up device filters in the
/etc/lvm/lvm.conf configuration file, as described in Chapter 15, Controlling LVM device scanning.