11 nblocks2=`expr $nblocks1 / \( $ddbs / 512 \)`
12 src=`mktemp $base.XXXXXX` || exit 1
13 dst=`mktemp $base.XXXXXX` || exit 1
15 dd if=/dev/random of=${src} bs=$ddbs count=$nblocks2 >/dev/null 2>&1
17 us0=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1
18 us1=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1
19 us2=$(attach_md -t malloc -s `expr $nblocks1 + 1`) || exit 1
21 gmirror label -b $balance $name /dev/${us0} /dev/${us1} /dev/${us2} || exit 1
24 dd if=${src} of=/dev/mirror/${name} bs=$ddbs count=$nblocks2 >/dev/null 2>&1
26 dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1
27 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then
33 gmirror remove $name ${us0}
34 dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1
35 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then
41 gmirror remove $name ${us1}
42 dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1
43 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then
49 gmirror remove $name ${us2}
50 dd if=/dev/mirror/${name} of=${dst} bs=$ddbs count=$nblocks2 >/dev/null 2>&1
51 if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then
57 # mirror/${name} should be removed.
58 if [ -c /dev/${name} ]; then