a linear volume plus one copy.
Specifying the optional argument \fB\-\-nosync\fP will cause the creation
-of the mirror to skip the initial resynchronization. Any data written
-afterwards will be mirrored, but the original contents will not be
-copied. This is useful for skipping a potentially long and resource
-intensive initial sync of an empty device.
+of the mirror LV to skip the initial resynchronization. Any data written
+afterwards will be mirrored, but the original contents will not be copied.
+
+This is useful for skipping a potentially long and resource intensive initial
+sync of an empty mirrored RaidLV.
There are two implementations of mirroring which can be used and correspond
to the "\fIraid1\fP" and "\fImirror\fP" segment types.
.HP
.BR \-\-nosync
.br
-Causes the creation of the mirror to skip the initial resynchronization.
+Causes the creation of mirror, raid1, raid4, raid5 and raid10 to skip the
+initial resynchronization. In case of mirror, raid1 and raid10, any data
+written afterwards will be mirrored, but the original contents will not be
+copied. In case of raid4 and raid5, no parity blocks will be written,
+though any data written afterwards will cause parity blocks to be stored.
+.br
+This is useful for skipping a potentially long and resource intensive initial
+sync of an empty mirror/raid1/raid4/raid5 and raid10 LV.
+.br
+This option is not valid for raid6, because raid6 relies on proper parity
+(P and Q Syndromes) being created during initial synchronization in order
+to reconstruct proper user date in case of device failures.
+
+raid0 and raid0_meta don't provide any data copies or parity support
+and thus don't support initial resynchronization.
.
.HP
.BR \-\-noudevsync
.br
Note the current limitation of 8 stripes total in any RaidLV including parity devices.
+See the \fB\-\-nosync\fP option to optionally avoid initial syncrhonization of RaidLVs.
+
Two implementations of basic striping are available in the kernel.
The original device-mapper implementation is the default and should
normally be used. The alternative implementation using MD, available
since version 1.7 of the RAID device-mapper kernel target (kernel
version 4.2) is provided to facilitate the development of new RAID
-features. It may be accessed with \fB--type raid0\fP, but is best
+features. It may be accessed with \fB--type raid0[_meta]\fP, but is best
avoided at present because of assorted restrictions on resizing and converting
such devices.
.HP
--- /dev/null
+#!/bin/sh
+# Copyright (C) 2016 Red Hat, Inc. All rights reserved.
+#
+# This copyrighted material is made available to anyone wishing to use,
+# modify, copy, or redistribute it subject to the terms and conditions
+# of the GNU General Public License v.2.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+SKIP_WITH_LVMLOCKD=1
+SKIP_WITH_LVMPOLLD=1
+
+. lib/inittest
+
+aux have_raid 1 7 0 || skip
+
+aux prepare_vg 6
+
+
+# Delay 1st leg so that rebuilding status characters
+# can be read before resync finished too quick.
+aux delay_dev "$dev1" 0 1
+
+# raid0/raid0_meta don't support resynchronization
+for r in raid0 raid0_meta
+do
+ lvcreate --yes --type raid0 -i 3 -l 1 -n $lv1 $vg
+ aux check_status_chars $vg $lv1 "AAA"
+ lvremove --yes $vg/$lv1
+done
+
+# raid1 supports resynchronization
+lvcreate --yes --type raid1 -m 2 -l 1 -n $lv1 $vg
+aux check_status_chars $vg $lv1 "aaa"
+aux wait_for_sync $vg $lv1
+aux check_status_chars $vg $lv1 "AAA"
+lvremove --yes $vg/$lv1
+
+# raid1 supports --nosync
+lvcreate --yes --type raid1 --nosync -m 2 -l 1 -n $lv1 $vg
+aux check_status_chars $vg $lv1 "AAA"
+lvremove --yes $vg/$lv1
+
+for r in raid4 raid5
+do
+ # raid4/5 support resynchronization
+ lvcreate --yes --type $r -i 3 -l 1 -n $lv1 $vg
+ aux check_status_chars $vg $lv1 "aaaa"
+ aux wait_for_sync $vg $lv1
+ aux check_status_chars $vg $lv1 "AAAA"
+ lvremove --yes $vg/$lv1
+
+ # raid4/5 support --nosync
+ lvcreate --yes --type $r --nosync -i 3 -l 1 -n $lv1 $vg
+ aux check_status_chars $vg $lv1 "AAAA"
+ lvremove --yes $vg/$lv1
+done
+
+# raid6 supports resynchronization
+lvcreate --yes --type raid6 -i 3 -l 1 -n $lv1 $vg
+aux check_status_chars $vg $lv1 "aaaaa"
+aux wait_for_sync $vg $lv1
+aux check_status_chars $vg $lv1 "AAAAA"
+lvremove --yes $vg/$lv1
+
+# raid6 rejects --nosync; it has to initialize P- and Q-Syndromes
+not lvcreate --yes --type raid6 --nosync -i 3 -l 1 -n $lv1 $vg
+
+# raid10 supports resynchronization
+lvcreate --yes --type raid10 -m 1 -i 3 -l 1 -n $lv1 $vg
+aux check_status_chars $vg $lv1 "aaaaaa"
+aux wait_for_sync $vg $lv1
+aux check_status_chars $vg $lv1 "AAAAAA"
+aux wait_for_sync $vg $lv1
+lvremove --yes $vg/$lv1
+
+# raid10 supports --nosync
+lvcreate --yes --type raid10 --nosync -m 1 -i 3 -l 1 -n $lv1 $vg
+aux check_status_chars $vg $lv1 "AAAAAA"
+aux wait_for_sync $vg $lv1
+lvremove --yes $vg/$lv1
+
+vgremove -ff $vg