12 expect_ok ${ZPOOL} create ${name0} raidz2 ${disk0} ${disk1} ${disk2} ${disk3}
13 expect_ok ${ZPOOL} export ${name0}
16 guid0=`get_guid ${fdisk0}`
18 disk_create 0 ${dname0}
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 " raidz2 DEGRADED 0 0 0"
33 echo " ${guid0} UNAVAIL 0 0 0 was ${fdname0}"
34 echo " ${disk1} ONLINE 0 0 0"
35 echo " ${disk2} ONLINE 0 0 0"
36 echo " ${disk3} ONLINE 0 0 0"
37 echo "errors: No known data errors"
39 expect "${exp}" ${ZPOOL} status ${name0}
40 expect_ok ${ZPOOL} replace ${name0} ${disk0} ${disk4}
41 wait_for_resilver ${name0}
43 echo " pool: ${name0}"
45 echo " scrub: (scrub|resilver) completed after [0-9]+h[0-9]+m with 0 errors on .*"
47 echo " NAME STATE READ WRITE CKSUM"
48 echo " ${name0} ONLINE 0 0 0"
49 echo " raidz2 ONLINE 0 0 0"
50 echo " ${disk4} ONLINE 0 0 0( [0-9.]+[A-Z] resilvered)?"
51 echo " ${disk1} ONLINE 0 0 0( [0-9.]+[A-Z] resilvered)?"
52 echo " ${disk2} ONLINE 0 0 0( [0-9.]+[A-Z] resilvered)?"
53 echo " ${disk3} ONLINE 0 0 0( [0-9.]+[A-Z] resilvered)?"
54 echo "errors: No known data errors"
56 expect "${exp}" ${ZPOOL} status ${name0}
57 expect_ok ${ZPOOL} destroy ${name0}
58 expect_fl ${ZPOOL} status -x ${name0}
60 expect_ok ${ZPOOL} create ${name0} raidz2 ${disk0} ${disk1} ${disk2} ${disk3}
61 expect_ok ${ZPOOL} replace ${name0} ${disk1} ${disk4}
62 wait_for_resilver ${name0}
64 echo " pool: ${name0}"
66 echo " scrub: (scrub|resilver) completed after [0-9]+h[0-9]+m with 0 errors on .*"
68 echo " NAME STATE READ WRITE CKSUM"
69 echo " ${name0} ONLINE 0 0 0"
70 echo " raidz2 ONLINE 0 0 0"
71 echo " ${disk0} ONLINE 0 0 0( [0-9.]+[A-Z] resilvered)?"
72 echo " ${disk4} ONLINE 0 0 0( [0-9.]+[A-Z] resilvered)?"
73 echo " ${disk2} ONLINE 0 0 0( [0-9.]+[A-Z] resilvered)?"
74 echo " ${disk3} ONLINE 0 0 0( [0-9.]+[A-Z] resilvered)?"
75 echo "errors: No known data errors"
77 expect "${exp}" ${ZPOOL} status ${name0}
78 expect_ok ${ZPOOL} destroy ${name0}
79 expect_fl ${ZPOOL} status -x ${name0}
81 expect_ok ${ZPOOL} create ${name0} raidz2 ${disk0} ${disk1} ${disk2} ${disk3}
82 expect_ok ${ZPOOL} export ${name0}
85 guid0=`get_guid ${fdisk0}`
87 expect_ok ${ZPOOL} import ${import_flags} ${name0}
89 echo " pool: ${name0}"
90 echo " state: DEGRADED"
91 echo " scrub: none requested"
93 echo " NAME STATE READ WRITE CKSUM"
94 echo " ${name0} DEGRADED 0 0 0"
95 echo " raidz2 DEGRADED 0 0 0"
96 echo " ${guid0} REMOVED 0 0 0 was ${fdname0}"
97 echo " ${disk1} ONLINE 0 0 0"
98 echo " ${disk2} ONLINE 0 0 0"
99 echo " ${disk3} ONLINE 0 0 0"
100 echo "errors: No known data errors"
102 expect "${exp}" ${ZPOOL} status ${name0}
103 expect_ok ${ZPOOL} replace ${name0} ${dname0} ${disk4}
104 wait_for_resilver ${name0}
106 echo " pool: ${name0}"
107 echo " state: ONLINE"
108 echo " scrub: (scrub|resilver) completed after [0-9]+h[0-9]+m with 0 errors on .*"
110 echo " NAME STATE READ WRITE CKSUM"
111 echo " ${name0} ONLINE 0 0 0"
112 echo " raidz2 ONLINE 0 0 0"
113 echo " ${disk4} ONLINE 0 0 0( [0-9.]+[A-Z] resilvered)?"
114 echo " ${disk1} ONLINE 0 0 0( [0-9.]+[A-Z] resilvered)?"
115 echo " ${disk2} ONLINE 0 0 0( [0-9.]+[A-Z] resilvered)?"
116 echo " ${disk3} ONLINE 0 0 0( [0-9.]+[A-Z] resilvered)?"
117 echo "errors: No known data errors"
119 expect "${exp}" ${ZPOOL} status ${name0}
120 expect_ok ${ZPOOL} destroy ${name0}
121 expect_fl ${ZPOOL} status -x ${name0}
122 disk_create 0 ${dname0}
124 expect_ok ${ZPOOL} create ${name0} raidz2 ${disk0} ${disk1} ${disk2} ${disk3}
125 expect_ok ${ZPOOL} offline ${name0} ${disk1}
126 expect_ok ${ZPOOL} replace ${name0} ${disk1} ${disk4}
127 wait_for_resilver ${name0}
129 echo " pool: ${name0}"
130 echo " state: ONLINE"
131 echo " scrub: (scrub|resilver) completed after [0-9]+h[0-9]+m with 0 errors on .*"
133 echo " NAME STATE READ WRITE CKSUM"
134 echo " ${name0} ONLINE 0 0 0"
135 echo " raidz2 ONLINE 0 0 0"
136 echo " ${disk0} ONLINE 0 0 0( [0-9.]+[A-Z] resilvered)?"
137 echo " ${disk4} ONLINE 0 0 0( [0-9.]+[A-Z] resilvered)?"
138 echo " ${disk2} ONLINE 0 0 0( [0-9.]+[A-Z] resilvered)?"
139 echo " ${disk3} ONLINE 0 0 0( [0-9.]+[A-Z] resilvered)?"
140 echo "errors: No known data errors"
142 expect "${exp}" ${ZPOOL} status ${name0}
143 expect_ok ${ZPOOL} destroy ${name0}
144 expect_fl ${ZPOOL} status -x ${name0}
146 expect_ok ${ZPOOL} create ${zpool_f_flag} ${name0} raidz2 ${disk0} ${disk1} ${disk2} ${disk3}
147 expect_ok ${ZPOOL} export ${name0}
150 guid0=`get_guid ${fdisk0}`
152 disk_create 0 ${dname0}
155 guid1=`get_guid ${fdisk1}`
157 disk_create 1 ${dname1}
158 expect_ok ${ZPOOL} import ${import_flags} ${name0}
160 echo " pool: ${name0}"
161 echo " state: DEGRADED"
162 echo "status: One or more devices could not be used because the label is missing or"
163 echo " invalid. Sufficient replicas exist for the pool to continue"
164 echo " functioning in a degraded state."
165 echo "action: Replace the device using 'zpool replace'."
166 echo " see: http://www.sun.com/msg/ZFS-8000-4J"
167 echo " scrub: none requested"
169 echo " NAME STATE READ WRITE CKSUM"
170 echo " ${name0} DEGRADED 0 0 0"
171 echo " raidz2 DEGRADED 0 0 0"
172 echo " ${guid0} UNAVAIL 0 0 0 was ${fdname0}"
173 echo " ${guid1} UNAVAIL 0 0 0 was ${fdname1}"
174 echo " ${disk2} ONLINE 0 0 0"
175 echo " ${disk3} ONLINE 0 0 0"
176 echo "errors: No known data errors"
178 expect "${exp}" ${ZPOOL} status ${name0}
179 expect_ok ${ZPOOL} replace ${name0} ${disk0} ${disk4}
180 expect_ok ${ZPOOL} replace ${name0} ${disk1} ${disk5}
181 wait_for_resilver ${name0}
183 echo " pool: ${name0}"
184 echo " state: ONLINE"
185 echo " scrub: (scrub|resilver) completed after [0-9]+h[0-9]+m with 0 errors on .*"
187 echo " NAME STATE READ WRITE CKSUM"
188 echo " ${name0} ONLINE 0 0 0"
189 echo " raidz2 ONLINE 0 0 0"
190 echo " ${disk4} ONLINE 0 0 0( [0-9.]+[A-Z] resilvered)?"
191 echo " ${disk5} ONLINE 0 0 0( [0-9.]+[A-Z] resilvered)?"
192 echo " ${disk2} ONLINE 0 0 0( [0-9.]+[A-Z] resilvered)?"
193 echo " ${disk3} ONLINE 0 0 0( [0-9.]+[A-Z] resilvered)?"
194 echo "errors: No known data errors"
196 expect "${exp}" ${ZPOOL} status ${name0}
197 expect_ok ${ZPOOL} destroy ${name0}
198 expect_fl ${ZPOOL} status -x ${name0}
200 expect_ok ${ZPOOL} create ${name0} raidz2 ${disk0} ${disk1} ${disk2} ${disk3}
201 expect_ok ${ZPOOL} replace ${name0} ${disk1} ${disk4}
202 expect_ok ${ZPOOL} replace ${name0} ${disk2} ${disk5}
203 wait_for_resilver ${name0}
205 echo " pool: ${name0}"
206 echo " state: ONLINE"
207 echo " scrub: (scrub|resilver) completed after [0-9]+h[0-9]+m with 0 errors on .*"
209 echo " NAME STATE READ WRITE CKSUM"
210 echo " ${name0} ONLINE 0 0 0"
211 echo " raidz2 ONLINE 0 0 0"
212 echo " ${disk0} ONLINE 0 0 0( [0-9.]+[A-Z] resilvered)?"
213 echo " ${disk4} ONLINE 0 0 0( [0-9.]+[A-Z] resilvered)?"
214 echo " ${disk5} ONLINE 0 0 0( [0-9.]+[A-Z] resilvered)?"
215 echo " ${disk3} ONLINE 0 0 0( [0-9.]+[A-Z] resilvered)?"
216 echo "errors: No known data errors"
218 expect "${exp}" ${ZPOOL} status ${name0}
219 expect_ok ${ZPOOL} destroy ${name0}
220 expect_fl ${ZPOOL} status -x ${name0}
222 expect_ok ${ZPOOL} create ${name0} raidz2 ${disk0} ${disk1} ${disk2} ${disk3}
223 expect_ok ${ZPOOL} export ${name0}
226 guid0=`get_guid ${fdisk0}`
230 guid1=`get_guid ${fdisk1}`
232 expect_ok ${ZPOOL} import ${import_flags} ${name0}
234 echo " pool: ${name0}"
235 echo " state: DEGRADED"
236 echo " scrub: none requested"
238 echo " NAME STATE READ WRITE CKSUM"
239 echo " ${name0} DEGRADED 0 0 0"
240 echo " raidz2 DEGRADED 0 0 0"
241 echo " ${guid0} REMOVED 0 0 0 was ${fdname0}"
242 echo " ${guid1} REMOVED 0 0 0 was ${fdname1}"
243 echo " ${disk2} ONLINE 0 0 0"
244 echo " ${disk3} ONLINE 0 0 0"
245 echo "errors: No known data errors"
247 expect "${exp}" ${ZPOOL} status ${name0}
248 expect_ok ${ZPOOL} replace ${name0} ${dname0} ${disk4}
249 expect_ok ${ZPOOL} replace ${name0} ${dname1} ${disk5}
250 wait_for_resilver ${name0}
252 echo " pool: ${name0}"
253 echo " state: ONLINE"
254 echo " scrub: (scrub|resilver) completed after [0-9]+h[0-9]+m with 0 errors on .*"
256 echo " NAME STATE READ WRITE CKSUM"
257 echo " ${name0} ONLINE 0 0 0"
258 echo " raidz2 ONLINE 0 0 0"
259 echo " ${disk4} ONLINE 0 0 0( [0-9.]+[A-Z] resilvered)?"
260 echo " ${disk5} ONLINE 0 0 0( [0-9.]+[A-Z] resilvered)?"
261 echo " ${disk2} ONLINE 0 0 0( [0-9.]+[A-Z] resilvered)?"
262 echo " ${disk3} ONLINE 0 0 0( [0-9.]+[A-Z] resilvered)?"
263 echo "errors: No known data errors"
265 expect "${exp}" ${ZPOOL} status ${name0}
266 expect_ok ${ZPOOL} destroy ${name0}
267 expect_fl ${ZPOOL} status -x ${name0}
268 disk_create 0 ${dname0}
269 disk_create 1 ${dname1}
271 expect_ok ${ZPOOL} create ${name0} raidz2 ${disk0} ${disk1} ${disk2} ${disk3}
272 expect_ok ${ZPOOL} offline ${name0} ${disk0}
273 add_msg="# TODO Sun CR 6328632, Lustre bug 16878"
274 expect_ok ${ZPOOL} offline ${name0} ${disk1}
276 echo " pool: ${name0}"
277 echo " state: DEGRADED"
278 echo "status: One or more devices has been taken offline by the administrator."
279 echo " Sufficient replicas exist for the pool to continue functioning in a"
280 echo " degraded state."
281 echo "action: Online the device using 'zpool online' or replace the device with"
282 echo " 'zpool replace'."
283 echo " scrub: none requested"
285 echo " NAME STATE READ WRITE CKSUM"
286 echo " ${name0} DEGRADED 0 0 0"
287 echo " raidz2 DEGRADED 0 0 0"
288 echo " ${disk0} OFFLINE 0 0 0"
289 echo " ${disk1} OFFLINE 0 0 0"
290 echo " ${disk2} ONLINE 0 0 0"
291 echo " ${disk3} ONLINE 0 0 0"
292 echo "errors: No known data errors"
294 expect "${exp}" ${ZPOOL} status ${name0}
296 expect_ok ${ZPOOL} replace ${name0} ${disk0} ${disk4}
297 expect_ok ${ZPOOL} replace ${name0} ${disk1} ${disk5}
298 wait_for_resilver ${name0}
300 echo " pool: ${name0}"
301 echo " state: ONLINE"
302 echo " scrub: (scrub|resilver) completed after [0-9]+h[0-9]+m with 0 errors on .*"
304 echo " NAME STATE READ WRITE CKSUM"
305 echo " ${name0} ONLINE 0 0 0"
306 echo " raidz2 ONLINE 0 0 0"
307 echo " ${disk4} ONLINE 0 0 0( [0-9.]+[A-Z] resilvered)?"
308 echo " ${disk5} ONLINE 0 0 0( [0-9.]+[A-Z] resilvered)?"
309 echo " ${disk2} ONLINE 0 0 0( [0-9.]+[A-Z] resilvered)?"
310 echo " ${disk3} ONLINE 0 0 0( [0-9.]+[A-Z] resilvered)?"
311 echo "errors: No known data errors"
313 expect "${exp}" ${ZPOOL} status ${name0}
314 expect_ok ${ZPOOL} destroy ${name0}
315 expect_fl ${ZPOOL} status -x ${name0}
317 expect_ok ${ZPOOL} create ${zpool_f_flag} ${name0} raidz2 ${disk0} ${disk1} ${disk2} ${disk3}
318 expect_ok ${ZPOOL} export ${name0}
321 guid0=`get_guid ${fdisk0}`
323 disk_create 0 ${dname0}
324 expect_ok ${ZPOOL} import ${import_flags} ${name0}
326 echo " pool: ${name0}"
327 echo " state: DEGRADED"
328 echo "status: One or more devices could not be used because the label is missing or"
329 echo " invalid. Sufficient replicas exist for the pool to continue"
330 echo " functioning in a degraded state."
331 echo "action: Replace the device using 'zpool replace'."
332 echo " see: http://www.sun.com/msg/ZFS-8000-4J"
333 echo " scrub: none requested"
335 echo " NAME STATE READ WRITE CKSUM"
336 echo " ${name0} DEGRADED 0 0 0"
337 echo " raidz2 DEGRADED 0 0 0"
338 echo " ${guid0} UNAVAIL 0 0 0 was ${fdname0}"
339 echo " ${disk1} ONLINE 0 0 0"
340 echo " ${disk2} ONLINE 0 0 0"
341 echo " ${disk3} ONLINE 0 0 0"
342 echo "errors: No known data errors"
344 expect "${exp}" ${ZPOOL} status ${name0}
345 expect_ok ${ZPOOL} replace ${name0} ${disk0} ${disk4}
346 expect_ok ${ZPOOL} replace ${name0} ${disk1} ${disk5}
347 wait_for_resilver ${name0}
349 echo " pool: ${name0}"
350 echo " state: ONLINE"
351 echo " scrub: (scrub|resilver) completed after [0-9]+h[0-9]+m with 0 errors on .*"
353 echo " NAME STATE READ WRITE CKSUM"
354 echo " ${name0} ONLINE 0 0 0"
355 echo " raidz2 ONLINE 0 0 0"
356 echo " ${disk4} ONLINE 0 0 0( [0-9.]+[A-Z] resilvered)?"
357 echo " ${disk5} ONLINE 0 0 0( [0-9.]+[A-Z] resilvered)?"
358 echo " ${disk2} ONLINE 0 0 0( [0-9.]+[A-Z] resilvered)?"
359 echo " ${disk3} ONLINE 0 0 0( [0-9.]+[A-Z] resilvered)?"
360 echo "errors: No known data errors"
362 expect "${exp}" ${ZPOOL} status ${name0}
363 expect_ok ${ZPOOL} destroy ${name0}
364 expect_fl ${ZPOOL} status -x ${name0}
366 expect_ok ${ZPOOL} create ${name0} raidz2 ${disk0} ${disk1} ${disk2} ${disk3}
367 expect_ok ${ZPOOL} export ${name0}
370 guid0=`get_guid ${fdisk0}`
372 disk_create 0 ${dname0}
375 guid1=`get_guid ${fdisk1}`
377 expect_ok ${ZPOOL} import ${import_flags} ${name0}
379 echo " pool: ${name0}"
380 echo " state: DEGRADED"
381 echo "status: One or more devices could not be used because the label is missing or"
382 echo " invalid. Sufficient replicas exist for the pool to continue"
383 echo " functioning in a degraded state."
384 echo "action: Replace the device using 'zpool replace'."
385 echo " see: http://www.sun.com/msg/ZFS-8000-4J"
386 echo " scrub: none requested"
388 echo " NAME STATE READ WRITE CKSUM"
389 echo " ${name0} DEGRADED 0 0 0"
390 echo " raidz2 DEGRADED 0 0 0"
391 echo " ${guid0} UNAVAIL 0 0 0 was ${fdname0}"
392 echo " ${guid1} REMOVED 0 0 0 was ${fdname1}"
393 echo " ${disk2} ONLINE 0 0 0"
394 echo " ${disk3} ONLINE 0 0 0"
395 echo "errors: No known data errors"
397 expect "${exp}" ${ZPOOL} status ${name0}
398 expect_ok ${ZPOOL} replace ${name0} ${disk0} ${disk4}
399 expect_ok ${ZPOOL} replace ${name0} ${dname1} ${disk5}
400 wait_for_resilver ${name0}
402 echo " pool: ${name0}"
403 echo " state: ONLINE"
404 echo " scrub: (scrub|resilver) completed after [0-9]+h[0-9]+m with 0 errors on .*"
406 echo " NAME STATE READ WRITE CKSUM"
407 echo " ${name0} ONLINE 0 0 0"
408 echo " raidz2 ONLINE 0 0 0"
409 echo " ${disk4} ONLINE 0 0 0( [0-9.]+[A-Z] resilvered)?"
410 echo " ${disk5} ONLINE 0 0 0( [0-9.]+[A-Z] resilvered)?"
411 echo " ${disk2} ONLINE 0 0 0( [0-9.]+[A-Z] resilvered)?"
412 echo " ${disk3} ONLINE 0 0 0( [0-9.]+[A-Z] resilvered)?"
413 echo "errors: No known data errors"
415 expect "${exp}" ${ZPOOL} status ${name0}
416 expect_ok ${ZPOOL} destroy ${name0}
417 expect_fl ${ZPOOL} status -x ${name0}
418 disk_create 1 ${dname1}
420 expect_ok ${ZPOOL} create ${name0} raidz2 ${disk0} ${disk1} ${disk2} ${disk3}
421 expect_ok ${ZPOOL} export ${name0}
424 guid0=`get_guid ${fdisk0}`
426 expect_ok ${ZPOOL} import ${import_flags} ${name0}
428 echo " pool: ${name0}"
429 echo " state: DEGRADED"
430 echo " scrub: none requested"
432 echo " NAME STATE READ WRITE CKSUM"
433 echo " ${name0} DEGRADED 0 0 0"
434 echo " raidz2 DEGRADED 0 0 0"
435 echo " ${guid0} REMOVED 0 0 0 was ${fdname0}"
436 echo " ${disk1} ONLINE 0 0 0"
437 echo " ${disk2} ONLINE 0 0 0"
438 echo " ${disk3} ONLINE 0 0 0"
439 echo "errors: No known data errors"
441 expect "${exp}" ${ZPOOL} status ${name0}
442 expect_ok ${ZPOOL} replace ${name0} ${dname0} ${disk4}
443 expect_ok ${ZPOOL} replace ${name0} ${disk1} ${disk5}
444 wait_for_resilver ${name0}
446 echo " pool: ${name0}"
447 echo " state: ONLINE"
448 echo " scrub: (scrub|resilver) completed after [0-9]+h[0-9]+m with 0 errors on .*"
450 echo " NAME STATE READ WRITE CKSUM"
451 echo " ${name0} ONLINE 0 0 0"
452 echo " raidz2 ONLINE 0 0 0"
453 echo " ${disk4} ONLINE 0 0 0( [0-9.]+[A-Z] resilvered)?"
454 echo " ${disk5} ONLINE 0 0 0( [0-9.]+[A-Z] resilvered)?"
455 echo " ${disk2} ONLINE 0 0 0( [0-9.]+[A-Z] resilvered)?"
456 echo " ${disk3} ONLINE 0 0 0( [0-9.]+[A-Z] resilvered)?"
457 echo "errors: No known data errors"
459 expect "${exp}" ${ZPOOL} status ${name0}
460 expect_ok ${ZPOOL} destroy ${name0}
461 expect_fl ${ZPOOL} status -x ${name0}
462 disk_create 0 ${dname0}
464 expect_ok ${ZPOOL} create ${name0} raidz2 ${disk0} ${disk1} ${disk2} ${disk3}
465 expect_ok ${ZPOOL} offline ${name0} ${disk0}
467 echo " pool: ${name0}"
468 echo " state: DEGRADED"
469 echo "status: One or more devices has been taken offline by the administrator."
470 echo " Sufficient replicas exist for the pool to continue functioning in a"
471 echo " degraded state."
472 echo "action: Online the device using 'zpool online' or replace the device with"
473 echo " 'zpool replace'."
474 echo " scrub: none requested"
476 echo " NAME STATE READ WRITE CKSUM"
477 echo " ${name0} DEGRADED 0 0 0"
478 echo " raidz2 DEGRADED 0 0 0"
479 echo " ${disk0} OFFLINE 0 0 0"
480 echo " ${disk1} ONLINE 0 0 0"
481 echo " ${disk2} ONLINE 0 0 0"
482 echo " ${disk3} ONLINE 0 0 0"
483 echo "errors: No known data errors"
485 expect "${exp}" ${ZPOOL} status ${name0}
486 expect_ok ${ZPOOL} replace ${name0} ${disk0} ${disk4}
487 expect_ok ${ZPOOL} replace ${name0} ${disk1} ${disk5}
488 wait_for_resilver ${name0}
490 echo " pool: ${name0}"
491 echo " state: ONLINE"
492 echo " scrub: (scrub|resilver) completed after [0-9]+h[0-9]+m with 0 errors on .*"
494 echo " NAME STATE READ WRITE CKSUM"
495 echo " ${name0} ONLINE 0 0 0"
496 echo " raidz2 ONLINE 0 0 0"
497 echo " ${disk4} ONLINE 0 0 0( [0-9.]+[A-Z] resilvered)?"
498 echo " ${disk5} ONLINE 0 0 0( [0-9.]+[A-Z] resilvered)?"
499 echo " ${disk2} ONLINE 0 0 0( [0-9.]+[A-Z] resilvered)?"
500 echo " ${disk3} ONLINE 0 0 0( [0-9.]+[A-Z] resilvered)?"
501 echo "errors: No known data errors"
503 expect "${exp}" ${ZPOOL} status ${name0}
504 expect_ok ${ZPOOL} destroy ${name0}
505 expect_fl ${ZPOOL} status -x ${name0}
507 expect_ok ${ZPOOL} create ${zpool_f_flag} ${name0} raidz2 ${disk0} ${disk1} ${disk2} ${disk3}
508 expect_ok ${ZPOOL} offline ${name0} ${disk0}
509 expect_ok ${ZPOOL} export ${name0}
512 guid1=`get_guid ${fdisk1}`
514 disk_create 1 ${dname1}
515 expect_ok ${ZPOOL} import ${import_flags} ${name0}
517 echo " pool: ${name0}"
518 echo " state: DEGRADED"
519 echo "status: One or more devices could not be used because the label is missing or"
520 echo " invalid. Sufficient replicas exist for the pool to continue"
521 echo " functioning in a degraded state."
522 echo "action: Replace the device using 'zpool replace'."
523 echo " see: http://www.sun.com/msg/ZFS-8000-4J"
524 echo " scrub: none requested"
526 echo " NAME STATE READ WRITE CKSUM"
527 echo " ${name0} DEGRADED 0 0 0"
528 echo " raidz2 DEGRADED 0 0 0"
529 echo " ${disk0} OFFLINE 0 0 0"
530 echo " ${guid1} UNAVAIL 0 0 0 was ${fdname1}"
531 echo " ${disk2} ONLINE 0 0 0"
532 echo " ${disk3} ONLINE 0 0 0"
533 echo "errors: No known data errors"
535 expect "${exp}" ${ZPOOL} status ${name0}
536 expect_ok ${ZPOOL} replace ${name0} ${disk0} ${disk4}
537 expect_ok ${ZPOOL} replace ${name0} ${disk1} ${disk5}
538 wait_for_resilver ${name0}
540 echo " pool: ${name0}"
541 echo " state: ONLINE"
542 echo " scrub: (scrub|resilver) completed after [0-9]+h[0-9]+m with 0 errors on .*"
544 echo " NAME STATE READ WRITE CKSUM"
545 echo " ${name0} ONLINE 0 0 0"
546 echo " raidz2 ONLINE 0 0 0"
547 echo " ${disk4} ONLINE 0 0 0( [0-9.]+[A-Z] resilvered)?"
548 echo " ${disk5} ONLINE 0 0 0( [0-9.]+[A-Z] resilvered)?"
549 echo " ${disk2} ONLINE 0 0 0( [0-9.]+[A-Z] resilvered)?"
550 echo " ${disk3} ONLINE 0 0 0( [0-9.]+[A-Z] resilvered)?"
551 echo "errors: No known data errors"
553 expect "${exp}" ${ZPOOL} status ${name0}
554 expect_ok ${ZPOOL} destroy ${name0}
555 expect_fl ${ZPOOL} status -x ${name0}
557 expect_ok ${ZPOOL} create ${zpool_f_flag} ${name0} raidz2 ${disk0} ${disk1} ${disk2} ${disk3}
558 expect_ok ${ZPOOL} offline ${name0} ${disk0}
559 expect_ok ${ZPOOL} export ${name0}
562 guid1=`get_guid ${fdisk1}`
564 expect_ok ${ZPOOL} import ${import_flags} ${name0}
566 echo " pool: ${name0}"
567 echo " state: DEGRADED"
568 echo "status: One or more devices has been taken offline by the administrator."
569 echo " Sufficient replicas exist for the pool to continue functioning in a"
570 echo " degraded state."
571 echo "action: Online the device using 'zpool online' or replace the device with"
572 echo " 'zpool replace'."
573 echo " scrub: none requested"
575 echo " NAME STATE READ WRITE CKSUM"
576 echo " ${name0} DEGRADED 0 0 0"
577 echo " raidz2 DEGRADED 0 0 0"
578 echo " ${disk0} OFFLINE 0 0 0"
579 echo " ${guid1} REMOVED 0 0 0 was ${fdname1}"
580 echo " ${disk2} ONLINE 0 0 0"
581 echo " ${disk3} ONLINE 0 0 0"
582 echo "errors: No known data errors"
584 expect "${exp}" ${ZPOOL} status ${name0}
585 expect_ok ${ZPOOL} replace ${name0} ${disk0} ${disk4}
586 expect_ok ${ZPOOL} replace ${name0} ${dname1} ${disk5}
587 wait_for_resilver ${name0}
589 echo " pool: ${name0}"
590 echo " state: ONLINE"
591 echo " scrub: (scrub|resilver) completed after [0-9]+h[0-9]+m with 0 errors on .*"
593 echo " NAME STATE READ WRITE CKSUM"
594 echo " ${name0} ONLINE 0 0 0"
595 echo " raidz2 ONLINE 0 0 0"
596 echo " ${disk4} ONLINE 0 0 0( [0-9.]+[A-Z] resilvered)?"
597 echo " ${disk5} ONLINE 0 0 0( [0-9.]+[A-Z] resilvered)?"
598 echo " ${disk2} ONLINE 0 0 0( [0-9.]+[A-Z] resilvered)?"
599 echo " ${disk3} ONLINE 0 0 0( [0-9.]+[A-Z] resilvered)?"
600 echo "errors: No known data errors"
602 expect "${exp}" ${ZPOOL} status ${name0}
603 expect_ok ${ZPOOL} destroy ${name0}
604 expect_fl ${ZPOOL} status -x ${name0}
605 disk_create 1 ${dname1}