teardown_udev_cookies
test ! -f MD_DEV || cleanup_md_dev
+
+ test ! -f WAIT_MD_DEV || mddev=$(< WAIT_MD_DEV)
udev_wait
- mdadm --stop --scan || true
+ test ! -f WAIT_MD_DEV || mdadm --stop $mddev || true
udev_wait
test ! -f DEVICES || teardown_devs_prefixed "$PREFIX"
test ! -f RAMDISK || { modprobe -r brd || true ; }
- mdadm --stop --scan || true
+ test ! -f WAIT_MD_DEV || mdadm --stop $mddev || true
# NOTE: SCSI_DEBUG_DEV test must come before the LOOP test because
# prepare_scsi_debug_dev() also sets LOOP to short-circuit prepare_loop()
break
fi
done
+ echo "$md" > WAIT_MD_DEV
}
prepare_backing_dev() {
test -f /proc/mdstat && grep -q raid0 /proc/mdstat || \
modprobe raid0 || skip
-not grep md0 /proc/mdstat || skip
+
+mddev="/dev/md33"
+not grep $mddev /proc/mdstat || skip
aux lvmconf 'devices/md_component_detection = 1'
aux lvmconf 'devices/md_component_checks = "auto"'
-mddev="/dev/md0"
mdadm --create --metadata=1.0 "$mddev" --level 0 --chunk=64 --raid-devices=2 "$dev1" "$dev2"
aux wait_md_create "$mddev"
pvcreate "$mddev"
aux lvmconf 'devices/md_component_checks = "start"'
-mddev="/dev/md0"
mdadm --create --metadata=1.0 "$mddev" --level 0 --chunk=64 --raid-devices=2 "$dev1" "$dev2"
aux wait_md_create "$mddev"
pvcreate "$mddev"
aux lvmconf 'devices/md_component_checks = "auto"'
-mddev="/dev/md0"
mdadm --create --metadata=1.0 "$mddev" --level 0 --chunk=64 --raid-devices=2 "$dev1" "$dev2"
aux wait_md_create "$mddev"
pvcreate "$mddev"
aux lvmconf 'devices/md_component_checks = "start"'
-mddev="/dev/md0"
mdadm --create --metadata=1.0 "$mddev" --level 0 --chunk=64 --raid-devices=2 "$dev1" "$dev2"
aux wait_md_create "$mddev"
pvcreate "$mddev"
aux lvmconf 'devices/md_component_checks = "start"'
-mddev="/dev/md0"
mdadm --create --metadata=1.0 "$mddev" --level 0 --chunk=64 --raid-devices=2 "$dev1" "$dev2"
aux wait_md_create "$mddev"
pvcreate "$mddev"
cat /proc/mdstat
# for some reason enabling dev2 starts an odd md dev
mdadm --stop "$mddev" || true
-mdadm --stop --scan
cat /proc/mdstat
wipefs -a "$dev1" || true
wipefs -a "$dev2" || true
aux lvmconf 'devices/md_component_checks = "auto"'
-mddev="/dev/md0"
mdadm --create --metadata=1.0 "$mddev" --level 0 --chunk=64 --raid-devices=2 "$dev1" "$dev2"
aux wait_md_create "$mddev"
pvcreate "$mddev"
cat /proc/mdstat
# for some reason enabling dev2 starts an odd md dev
mdadm --stop "$mddev" || true
-mdadm --stop --scan
cat /proc/mdstat
wipefs -a "$dev1" || true
wipefs -a "$dev2" || true
test -f /proc/mdstat && grep -q raid1 /proc/mdstat || \
modprobe raid1 || skip
-not grep md0 /proc/mdstat || skip
+
+mddev="/dev/md33"
+not grep $mddev /proc/mdstat || skip
aux lvmconf 'devices/md_component_detection = 1'
aux lvmconf 'devices/md_component_checks = "auto"'
-mddev="/dev/md0"
mdadm --create --metadata=1.0 "$mddev" --level 1 --chunk=64 --raid-devices=2 "$dev1" "$dev2"
aux wait_md_create "$mddev"
pvcreate "$mddev"
aux lvmconf 'devices/md_component_checks = "start"'
-mddev="/dev/md0"
mdadm --create --metadata=1.0 "$mddev" --level 1 --chunk=64 --raid-devices=2 "$dev1" "$dev2"
aux wait_md_create "$mddev"
pvcreate "$mddev"
aux lvmconf 'devices/md_component_checks = "auto"'
-mddev="/dev/md0"
mdadm --create --metadata=1.0 "$mddev" --level 1 --chunk=64 --raid-devices=2 "$dev1" "$dev2"
aux wait_md_create "$mddev"
pvcreate "$mddev"
aux lvmconf 'devices/md_component_checks = "start"'
-mddev="/dev/md0"
mdadm --create --metadata=1.0 "$mddev" --level 1 --chunk=64 --raid-devices=2 "$dev1" "$dev2"
aux wait_md_create "$mddev"
pvcreate "$mddev"
aux lvmconf 'devices/md_component_checks = "start"'
-mddev="/dev/md0"
mdadm --create --metadata=1.0 "$mddev" --level 1 --chunk=64 --raid-devices=2 "$dev1" "$dev2"
aux wait_md_create "$mddev"
pvcreate "$mddev"
cat /proc/mdstat
# for some reason enabling dev2 starts an odd md dev
mdadm --stop "$mddev" || true
-mdadm --stop --scan
cat /proc/mdstat
wipefs -a "$dev1" || true
wipefs -a "$dev2" || true
aux lvmconf 'devices/md_component_checks = "auto"'
-mddev="/dev/md0"
mdadm --create --metadata=1.0 "$mddev" --level 1 --chunk=64 --raid-devices=2 "$dev1" "$dev2"
aux wait_md_create "$mddev"
pvcreate "$mddev"
cat /proc/mdstat
# for some reason enabling dev2 starts an odd md dev
mdadm --stop "$mddev" || true
-mdadm --stop --scan
cat /proc/mdstat
wipefs -a "$dev1" || true
wipefs -a "$dev2" || true
aux lvmconf 'devices/md_component_checks = "auto"'
-mddev="/dev/md0"
mdadm --create --metadata=1.0 "$mddev" --level 1 --chunk=64 --raid-devices=3 "$dev1" "$dev2" "$dev4"
aux wait_md_create "$mddev"
pvcreate "$mddev"
aux lvmconf 'devices/md_component_checks = "start"'
-mddev="/dev/md0"
mdadm --create --metadata=1.0 "$mddev" --level 1 --chunk=64 --raid-devices=3 "$dev1" "$dev2" "$dev4"
aux wait_md_create "$mddev"
pvcreate "$mddev"
cat /proc/mdstat
# for some reason enabling dev2 starts an odd md dev
mdadm --stop "$mddev" || true
-mdadm --stop --scan
cat /proc/mdstat
wipefs -a "$dev1" || true
wipefs -a "$dev2" || true
test -f /proc/mdstat && grep -q raid1 /proc/mdstat || \
modprobe raid1 || skip
-not grep md0 /proc/mdstat || skip
+
+mddev="/dev/md33"
+not grep $mddev /proc/mdstat || skip
aux lvmconf 'devices/md_component_detection = 1'
# create 2 disk MD raid1 array
# by default using metadata format 1.0 with data at the end of device
-mddev="/dev/md0"
mdadm --create --metadata=1.0 "$mddev" --level 1 --chunk=64 --raid-devices=2 "$dev1" "$dev2"
aux wait_md_create "$mddev"
vgcreate $vg "$mddev"
# When a raid0 md array is stopped, the components will not look like
# duplicate PVs as they do with raid1.
-mddev="/dev/md0"
mdadm --create --metadata=1.0 "$mddev" --level 0 --chunk=64 --raid-devices=2 "$dev1" "$dev2"
aux wait_md_create "$mddev"
vgcreate $vg "$mddev"
# When a raid0 md array is stopped, the components will not look like
# duplicate PVs as they do with raid1.
-mddev="/dev/md0"
mdadm --create --metadata=1.0 "$mddev" --level 0 --chunk=64 --raid-devices=2 "$dev1" "$dev2"
aux wait_md_create "$mddev"
test -f /proc/mdstat && grep -q raid0 /proc/mdstat || \
modprobe raid0 || skip
-not grep md0 /proc/mdstat || skip
+mddev="/dev/md33"
+not grep $mddev /proc/mdstat || skip
aux lvmconf 'devices/md_component_detection = 1'
aux extend_filter_md "a|/dev/md|"
aux prepare_devs 2
# create 2 disk MD raid0 array (stripe_width=128K)
-mddev="/dev/md0"
mdadm --create --metadata=1.0 "$mddev" --level 0 --chunk=64 --raid-devices=2 "$dev1" "$dev2"
aux wait_md_create "$mddev"
# Test newer topology-aware alignment detection w/ --dataalignment override
if aux kernel_at_least 2 6 33 ; then
- mddev="/dev/md0"
mdadm --create --metadata=1.0 "$mddev" --level 0 --chunk=1024 --raid-devices=2 "$dev1" "$dev2"
aux wait_md_create "$mddev"
pvdev="$mddev"