14 nblocks2
=`expr $nblocks1 / \( $ddbs / 512 \)`
15 src
=`mktemp /tmp/$base.XXXXXX` ||
exit 1
16 dst
=`mktemp /tmp/$base.XXXXXX` ||
exit 1
18 dd if=/dev
/random of
=${src} bs
=$ddbs count
=$nblocks2 >/dev
/null
2>&1
20 mdconfig
-a -t malloc
-s `expr $nblocks1 + 1` -u $us0 ||
exit 1
21 mdconfig
-a -t malloc
-s `expr $nblocks1 + 1` -u $us1 ||
exit 1
22 mdconfig
-a -t malloc
-s `expr $nblocks1 + 1` -u $us2 ||
exit 1
24 gmirror label
-b $balance -s `expr $ddbs / 2` $name /dev
/md
${us0} /dev
/md
${us1} ||
exit 1
27 dd if=${src} of
=/dev
/mirror
/${name} bs
=$ddbs count
=$nblocks2 >/dev
/null
2>&1
28 dd if=/dev
/zero of
=/dev
/md
${us2} bs
=$ddbs count
=$nblocks2 >/dev
/null
2>&1
30 dd if=/dev
/mirror
/${name} of
=${dst} bs
=$ddbs count
=$nblocks2 >/dev
/null
2>&1
31 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then
37 # Connect disk to the mirror.
38 gmirror insert
${name} md
${us2}
39 # Wait for synchronization.
41 dd if=/dev
/md
${us2} of
=${dst} bs
=$ddbs count
=$nblocks2 >/dev
/null
2>&1
42 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then
48 gmirror remove
$name md
${us0} md${us1} md${us2}