A RAID1 LV can be tuned so that certain devices are avoided for
reading while all devices are still written to.
lvchange --
[raid
]writemostly
PV[:y
|n
|t
] LV
The specified device will be marked as "write mostly", which
means that reading from this device will be avoided, and other
devices will be preferred for reading (unless no other devices
are available.) This minimizes the I/O to the specified device.
If the PV name has no suffix, the write mostly attribute is set.
If the PV name has the suffix :n
, the write mostly attribute is
cleared, and the suffix :t
toggles the current setting.
The write mostly option can be repeated on the command line to
change multiple devices at once.
To report the current write mostly setting, the lvs attr field
will show the letter "w" in the 9th position when write mostly is
set:
lvs -a -o name,attr
When a device is marked write mostly, the maximum number of
outstanding writes to that device can be configured. Once the
maximum is reached, further writes become synchronous. When
synchronous, a write to the LV will not complete until writes to
all the mirror images are complete.
lvchange --
[raid
]writebehind
Number LV
To report the current write behind setting, run:
lvs -o name,raid_write_behind
When write behind is not configured, or set to 0, all LV writes
are synchronous.