12 expect_ok ${ZPOOL} create ${name0} ${disk0} log mirror ${disk1} ${disk2}
13 expect_ok ${ZPOOL} export ${name0}
16 guid1=`get_guid ${fdisk1}`
18 disk_create 1 ${dname1}
19 expect_ok ${ZPOOL} import ${import_flags} ${name0}
21 echo " pool: ${name0}"
22 echo " state: DEGRADED"
23 echo "status: One or more devices could not be used because the label is missing or"
24 echo " invalid. Sufficient replicas exist for the pool to continue"
25 echo " functioning in a degraded state."
26 echo "action: Replace the device using 'zpool replace'."
27 echo " see: http://www.sun.com/msg/ZFS-8000-4J"
28 echo " scrub: none requested"
30 echo " NAME STATE READ WRITE CKSUM"
31 echo " ${name0} DEGRADED 0 0 0"
32 echo " ${disk0} ONLINE 0 0 0"
33 echo " logs DEGRADED 0 0 0"
34 echo " mirror DEGRADED 0 0 0"
35 echo " ${guid1} UNAVAIL 0 0 0 was ${fdname1}"
36 echo " ${disk2} ONLINE 0 0 0"
37 echo "errors: No known data errors"
39 add_msg="# TODO Sun CR 6710376, Lustre bug 16912"
40 expect "${exp}" ${ZPOOL} status ${name0}
42 expect_ok ${ZPOOL} replace ${name0} ${disk1} ${disk3}
43 wait_for_resilver ${name0}
45 echo " pool: ${name0}"
47 echo " scrub: resilver completed after [0-9]+h[0-9]+m with 0 errors on .*"
49 echo " NAME STATE READ WRITE CKSUM"
50 echo " ${name0} ONLINE 0 0 0"
51 echo " ${disk0} ONLINE 0 0 0"
52 echo " logs ONLINE 0 0 0"
53 echo " mirror ONLINE 0 0 0"
54 echo " ${disk3} ONLINE 0 0 0"
55 echo " ${disk2} ONLINE 0 0 0"
56 echo "errors: No known data errors"
58 expect "${exp}" ${ZPOOL} status ${name0}
59 expect_ok ${ZPOOL} destroy ${name0}
60 expect_fl ${ZPOOL} status -x ${name0}
62 expect_ok ${ZPOOL} create ${name0} ${disk0} log mirror ${disk1} ${disk2}
63 expect_ok ${ZPOOL} replace ${name0} ${disk2} ${disk3}
64 wait_for_resilver ${name0}
66 echo " pool: ${name0}"
68 echo " scrub: resilver completed after [0-9]+h[0-9]+m with 0 errors on .*"
70 echo " NAME STATE READ WRITE CKSUM"
71 echo " ${name0} ONLINE 0 0 0"
72 echo " ${disk0} ONLINE 0 0 0"
73 echo " logs ONLINE 0 0 0"
74 echo " mirror ONLINE 0 0 0"
75 echo " ${disk1} ONLINE 0 0 0"
76 echo " ${disk3} ONLINE 0 0 0"
77 echo "errors: No known data errors"
79 expect "${exp}" ${ZPOOL} status ${name0}
80 expect_ok ${ZPOOL} destroy ${name0}
81 expect_fl ${ZPOOL} status -x ${name0}
83 expect_ok ${ZPOOL} create ${name0} ${disk0} log mirror ${disk1} ${disk2}
84 expect_ok ${ZPOOL} export ${name0}
87 guid1=`get_guid ${fdisk1}`
89 expect_ok ${ZPOOL} import ${import_flags} ${name0}
91 echo " pool: ${name0}"
92 echo " state: DEGRADED"
93 echo "status: One or more devices could not be opened. Sufficient replicas exist for"
94 echo " the pool to continue functioning in a degraded state."
95 echo "action: Attach the missing device and online it using 'zpool online'."
96 echo " see: http://www.sun.com/msg/ZFS-8000-2Q"
97 echo " scrub: none requested"
99 echo " NAME STATE READ WRITE CKSUM"
100 echo " ${name0} DEGRADED 0 0 0"
101 echo " ${disk0} ONLINE 0 0 0"
102 echo " logs DEGRADED 0 0 0"
103 echo " mirror DEGRADED 0 0 0"
104 echo " ${guid1} UNAVAIL 0 0 0 was ${fdname1}"
105 echo " ${disk2} ONLINE 0 0 0"
106 echo "errors: No known data errors"
108 expect "${exp}" ${ZPOOL} status ${name0}
109 expect_ok ${ZPOOL} replace ${name0} ${dname1} ${disk3}
110 wait_for_resilver ${name0}
112 echo " pool: ${name0}"
113 echo " state: ONLINE"
114 echo " scrub: resilver completed after [0-9]+h[0-9]+m with 0 errors on .*"
116 echo " NAME STATE READ WRITE CKSUM"
117 echo " ${name0} ONLINE 0 0 0"
118 echo " ${disk0} ONLINE 0 0 0"
119 echo " logs ONLINE 0 0 0"
120 echo " mirror ONLINE 0 0 0"
121 echo " ${disk3} ONLINE 0 0 0"
122 echo " ${disk2} ONLINE 0 0 0"
123 echo "errors: No known data errors"
125 expect "${exp}" ${ZPOOL} status ${name0}
126 expect_ok ${ZPOOL} destroy ${name0}
127 expect_fl ${ZPOOL} status -x ${name0}
128 disk_create 1 ${dname1}
130 expect_ok ${ZPOOL} create ${name0} ${disk0} log mirror ${disk1} ${disk2}
131 expect_ok ${ZPOOL} offline ${name0} ${disk1}
132 expect_ok ${ZPOOL} replace ${name0} ${disk1} ${disk3}
133 wait_for_resilver ${name0}
135 echo " pool: ${name0}"
136 echo " state: ONLINE"
137 echo " scrub: resilver completed after [0-9]+h[0-9]+m with 0 errors on .*"
139 echo " NAME STATE READ WRITE CKSUM"
140 echo " ${name0} ONLINE 0 0 0"
141 echo " ${disk0} ONLINE 0 0 0"
142 echo " logs ONLINE 0 0 0"
143 echo " mirror ONLINE 0 0 0"
144 echo " ${disk3} ONLINE 0 0 0"
145 echo " ${disk2} ONLINE 0 0 0"
146 echo "errors: No known data errors"
148 expect "${exp}" ${ZPOOL} status ${name0}
149 expect_ok ${ZPOOL} destroy ${name0}
150 expect_fl ${ZPOOL} status -x ${name0}