- How does LVM decide which disk (PV) to use to allocate extents of the LVs being created when no specific PVs are specified.
Answer:
When a VG is created, the PV instances get an order or sequence
number in the order the PVs are added to the VG. This sequence number
is known to the LVM for each VG. So in a VG when an LV is created or extended without any specific device reservations, the order in which the Physical extents are allocated is the same as the sequence
number as kept by LVM for the VG.
The extent start getting allocated from the first PV first. When the
free PEs on the first PV are exhausted that goes to the second PV and
so on.
In
case you have made an LV as PV strict that will mean that the PEs
which are mirrored for that LVs will strictly reside in the different
PVs and LVM ensures to maintain that.
So if
you are creating the LV, the first sequenced PVs is used to create
the LV. Then when the mirror is created, the extents come from the
next PV even if PV1 has free PEs. This happens as a combined result
of the PV strict mirror policy and the Sequence of the PVs (the order
in which the PVs had been added to the VG) information which LVM
maintains and for the fact that there has been no device reservation
specified either for the original PEs of the LV or for the mirror PEs
for the original PEs.
No comments:
Post a Comment