3 # create an array, then change the uuid.
5 mdadm -CR --assume-clean $md0 -l5 -n3 $dev0 $dev1 $dev2
7 mdadm -A /dev/md0 --update=uuid --uuid=0123456789abcdef:fedcba9876543210 $dev0 $dev1 $dev2
9 mdadm -D /dev/md0 | grep -s > /dev/null 01234567:89abcdef:fedcba98:76543210 || {
10 echo Wrong uuid; mdadm -D /dev/md0 ; exit 2;
16 mdadm -CR --assume-clean -e1 $md0 -l5 -n3 $dev0 $dev1 $dev2
18 mdadm -A /dev/md0 --update=uuid --uuid=0123456789abcdef:fedcba9876543210 $dev0 $dev1 $dev2
20 mdadm -D /dev/md0 | grep -s > /dev/null 01234567:89abcdef:fedcba98:76543210 || {
21 echo Wrong uuid; mdadm -D /dev/md0 ; exit 2;
26 # now if we have a bitmap, that needs updating too.
27 rm -f $targetdir/bitmap
28 mdadm -CR --assume-clean -b $targetdir/bitmap $md0 -l5 -n3 $dev0 $dev1 $dev2
30 mdadm -A /dev/md0 -b $targetdir/bitmap --update=uuid --uuid=0123456789abcdef:fedcba9876543210 $dev0 $dev1 $dev2
32 mdadm -D /dev/md0 | grep -s > /dev/null 01234567:89abcdef:fedcba98:76543210 || {
33 echo Wrong uuid; mdadm -D /dev/md0 ; exit 2;
35 if mdadm -X $targetdir/bitmap | grep -s > /dev/null 01234567:89abcdef:fedcba98:76543210 ||
36 mdadm -X $targetdir/bitmap | grep -s > /dev/null 67452301:efcdab89:98badcfe:10325476
38 echo Wrong uuid; mdadm -X $targetdir/bitmap ; exit 2;
42 # and bitmap for version1
43 rm -f $targetdir/bitmap
44 mdadm -CR --assume-clean -e1.1 -b $targetdir/bitmap $md0 -l5 -n3 $dev0 $dev1 $dev2
46 mdadm -A /dev/md0 -b $targetdir/bitmap --update=uuid --uuid=0123456789abcdef:fedcba9876543210 $dev0 $dev1 $dev2
48 mdadm -D /dev/md0 | grep -s > /dev/null 01234567:89abcdef:fedcba98:76543210 || {
49 echo Wrong uuid; mdadm -D /dev/md0 ; exit 2;
51 # -X cannot tell which byteorder to use for the UUID, so allow both.
52 if mdadm -X $targetdir/bitmap | grep -s > /dev/null 01234567:89abcdef:fedcba98:76543210 ||
53 mdadm -X $targetdir/bitmap | grep -s > /dev/null 67452301:efcdab89:98badcfe:10325476
55 echo Wrong uuid; mdadm -X $targetdir/bitmap ; exit 2;
59 # Internal bitmaps too.
60 mdadm -CR --assume-clean -b internal $md0 -l5 -n3 $dev0 $dev1 $dev2
62 mdadm -A /dev/md0 --update=uuid --uuid=0123456789abcdef:fedcba9876543210 $dev0 $dev1 $dev2
64 mdadm -D /dev/md0 | grep -s > /dev/null 01234567:89abcdef:fedcba98:76543210 || {
65 echo Wrong uuid; mdadm -D /dev/md0 ; exit 2;
67 mdadm -X $dev0 | grep -s > /dev/null 01234567:89abcdef:fedcba98:76543210 || {
68 echo Wrong uuid; mdadm -X $dev0; exit 2;
72 mdadm -CR --assume-clean -e1.2 -b internal $md0 -l5 -n3 $dev0 $dev1 $dev2
74 mdadm -A /dev/md0 --update=uuid --uuid=0123456789abcdef:fedcba9876543210 $dev0 $dev1 $dev2
76 mdadm -D /dev/md0 | grep -s > /dev/null 01234567:89abcdef:fedcba98:76543210 || {
77 echo Wrong uuid; mdadm -D /dev/md0 ; exit 2;
79 mdadm -X $dev0 | grep -s > /dev/null 01234567:89abcdef:fedcba98:76543210 || {
80 echo Wrong uuid; mdadm -X $dev0; exit 2;