12 expect_ok ${ZPOOL} create ${name0} mirror ${disk0} ${disk1}
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 " mirror DEGRADED 0 0 0"
33 echo " ${guid0} UNAVAIL 0 0 0 was ${fdname0}"
34 echo " ${disk1} ONLINE 0 0 0"
35 echo "errors: No known data errors"
37 expect "${exp}" ${ZPOOL} status ${name0}
38 expect_ok ${ZPOOL} replace ${name0} ${disk0} ${disk2}
39 wait_for_resilver ${name0}
41 echo " pool: ${name0}"
43 echo " scrub: (scrub|resilver) completed after [0-9]+h[0-9]+m with 0 errors on .*"
45 echo " NAME STATE READ WRITE CKSUM"
46 echo " ${name0} ONLINE 0 0 0"
47 echo " mirror ONLINE 0 0 0"
48 echo " ${disk2} ONLINE 0 0 0( [0-9.]+[A-Z] resilvered)?"
49 echo " ${disk1} ONLINE 0 0 0( [0-9.]+[A-Z] resilvered)?"
50 echo "errors: No known data errors"
52 expect "${exp}" ${ZPOOL} status ${name0}
53 expect_ok ${ZPOOL} destroy ${name0}
54 expect_fl ${ZPOOL} status -x ${name0}
56 expect_ok ${ZPOOL} create ${name0} mirror ${disk0} ${disk1}
57 expect_ok ${ZPOOL} replace ${name0} ${disk1} ${disk2}
58 wait_for_resilver ${name0}
60 echo " pool: ${name0}"
62 echo " scrub: (scrub|resilver) completed after [0-9]+h[0-9]+m with 0 errors on .*"
64 echo " NAME STATE READ WRITE CKSUM"
65 echo " ${name0} ONLINE 0 0 0"
66 echo " mirror ONLINE 0 0 0"
67 echo " ${disk0} ONLINE 0 0 0( [0-9.]+[A-Z] resilvered)?"
68 echo " ${disk2} ONLINE 0 0 0( [0-9.]+[A-Z] resilvered)?"
69 echo "errors: No known data errors"
71 expect "${exp}" ${ZPOOL} status ${name0}
72 expect_ok ${ZPOOL} destroy ${name0}
73 expect_fl ${ZPOOL} status -x ${name0}
75 expect_ok ${ZPOOL} create ${name0} mirror ${disk0} ${disk1}
76 expect_ok ${ZPOOL} export ${name0}
79 guid0=`get_guid ${fdisk0}`
81 expect_ok ${ZPOOL} import ${import_flags} ${name0}
83 echo " pool: ${name0}"
84 echo " state: DEGRADED"
85 echo " scrub: none requested"
87 echo " NAME STATE READ WRITE CKSUM"
88 echo " ${name0} DEGRADED 0 0 0"
89 echo " mirror DEGRADED 0 0 0"
90 echo " ${guid0} REMOVED 0 0 0 was ${fdname0}"
91 echo " ${disk1} ONLINE 0 0 0"
92 echo "errors: No known data errors"
94 expect "${exp}" ${ZPOOL} status ${name0}
95 expect_ok ${ZPOOL} replace ${name0} ${dname0} ${disk2}
96 wait_for_resilver ${name0}
98 echo " pool: ${name0}"
100 echo " scrub: (scrub|resilver) completed after [0-9]+h[0-9]+m with 0 errors on .*"
102 echo " NAME STATE READ WRITE CKSUM"
103 echo " ${name0} ONLINE 0 0 0"
104 echo " mirror ONLINE 0 0 0"
105 echo " ${disk2} ONLINE 0 0 0( [0-9.]+[A-Z] resilvered)?"
106 echo " ${disk1} ONLINE 0 0 0( [0-9.]+[A-Z] resilvered)?"
107 echo "errors: No known data errors"
109 expect "${exp}" ${ZPOOL} status ${name0}
110 expect_ok ${ZPOOL} destroy ${name0}
111 expect_fl ${ZPOOL} status -x ${name0}
112 disk_create 0 ${dname0}
114 expect_ok ${ZPOOL} create ${name0} mirror ${disk0} ${disk1}
115 expect_ok ${ZPOOL} offline ${name0} ${disk1}
116 expect_ok ${ZPOOL} replace ${name0} ${disk1} ${disk2}
117 wait_for_resilver ${name0}
119 echo " pool: ${name0}"
120 echo " state: ONLINE"
121 echo " scrub: (scrub|resilver) completed after [0-9]+h[0-9]+m with 0 errors on .*"
123 echo " NAME STATE READ WRITE CKSUM"
124 echo " ${name0} ONLINE 0 0 0"
125 echo " mirror ONLINE 0 0 0"
126 echo " ${disk0} ONLINE 0 0 0( [0-9.]+[A-Z] resilvered)?"
127 echo " ${disk2} ONLINE 0 0 0( [0-9.]+[A-Z] resilvered)?"
128 echo "errors: No known data errors"
130 expect "${exp}" ${ZPOOL} status ${name0}
131 expect_ok ${ZPOOL} destroy ${name0}
132 expect_fl ${ZPOOL} status -x ${name0}