When LVM allocates disk space to a logical volume,
it automatically creates a mapping of the logical extents to physical
extents. This mapping depends on the policy chosen when creating the
logical volume. Logical extents are allocated sequentially, starting
at zero, for each logical volume. LVM uses this mapping to access
the data, regardless of where it physically resides. Commands are
provided for you to examine this mapping; see pvdisplay(1M) and lvdisplay(1M).
Except for mirrored, striped, or striped-mirrored
logical volumes, each logical extent is mapped to one physical extent.
For mirrored logical volumes, each logical extent is mapped to multiple
physical extents, depending on the number of mirror copies. For example,
if one mirror copy exists, then each logical extent maps to two physical
extents, one extent for the original and one for the mirror copy.
For more information on mirroring, see “Increasing Data Availability Through Mirroring”. For information on striped logical
volumes, see “Increasing Performance Through Disk Striping”. Also refer to the book Disk and File Management Tasks
Figure 1-2 shows an example of several types of mapping available between
physical extents and logical extents within a volume group.
Figure 1-2 Physical Extents and Logical Extents
As shown in Figure 1-2, the contents of the first logical volume are
contained on all three physical volumes in the volume group. Because
the second logical volume is mirrored, each logical extent is mapped
to more than one physical extent. In this case, there are two physical
extents containing the data, each on both the second and third disks
within the volume group.
By default, LVM assigns physical extents to logical
volumes by selecting available physical extents from disks in the
order in which they appear in the LVM configuration files, /etc/lvmtab and /etc/lvmtab_p. As
a system administrator, you can bypass this default assignment and
control which disks are used by a logical volume (see “Extending a Logical Volume to a Specific Disk”).
If a logical volume is to be used for root, boot,
primary swap, or dump, the physical extents must be contiguous, which means that the physical extents must
be allocated in increasing order with no gaps on a single physical
volume. For logical volumes that are not being used for root, boot,
primary swap or dump, physical extents that correspond to contiguous
logical extents within a logical volume can be noncontiguous on a physical volume or reside on entirely
different disks. As a result, a file system created within one logical
volume can reside on more than one disk.