12 expect_ok ${ZPOOL} create ${name0} raidz1 ${disk0} ${disk1} ${disk2}
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 " raidz1 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 "errors: No known data errors"
38 expect "${exp}" ${ZPOOL} status ${name0}
39 expect_ok ${ZPOOL} replace ${name0} ${disk0} ${disk3}
40 wait_for_resilver ${name0}
42 echo " pool: ${name0}"
44 echo " scrub: (scrub|resilver) completed after [0-9]+h[0-9]+m with 0 errors on .*"
46 echo " NAME STATE READ WRITE CKSUM"
47 echo " ${name0} ONLINE 0 0 0"
48 echo " raidz1 ONLINE 0 0 0"
49 echo " ${disk3} ONLINE 0 0 0( [0-9.]+[A-Z] resilvered)?"
50 echo " ${disk1} ONLINE 0 0 0( [0-9.]+[A-Z] resilvered)?"
51 echo " ${disk2} ONLINE 0 0 0( [0-9.]+[A-Z] resilvered)?"
52 echo "errors: No known data errors"
54 expect "${exp}" ${ZPOOL} status ${name0}
55 expect_ok ${ZPOOL} destroy ${name0}
56 expect_fl ${ZPOOL} status -x ${name0}
58 expect_ok ${ZPOOL} create ${name0} raidz1 ${disk0} ${disk1} ${disk2}
59 expect_ok ${ZPOOL} replace ${name0} ${disk1} ${disk3}
60 wait_for_resilver ${name0}
62 echo " pool: ${name0}"
64 echo " scrub: (scrub|resilver) completed after [0-9]+h[0-9]+m with 0 errors on .*"
66 echo " NAME STATE READ WRITE CKSUM"
67 echo " ${name0} ONLINE 0 0 0"
68 echo " raidz1 ONLINE 0 0 0"
69 echo " ${disk0} ONLINE 0 0 0( [0-9.]+[A-Z] resilvered)?"
70 echo " ${disk3} ONLINE 0 0 0( [0-9.]+[A-Z] resilvered)?"
71 echo " ${disk2} ONLINE 0 0 0( [0-9.]+[A-Z] resilvered)?"
72 echo "errors: No known data errors"
74 expect "${exp}" ${ZPOOL} status ${name0}
75 expect_ok ${ZPOOL} destroy ${name0}
76 expect_fl ${ZPOOL} status -x ${name0}
78 expect_ok ${ZPOOL} create ${name0} raidz1 ${disk0} ${disk1} ${disk2}
79 expect_ok ${ZPOOL} export ${name0}
82 guid0=`get_guid ${fdisk0}`
84 expect_ok ${ZPOOL} import ${import_flags} ${name0}
86 echo " pool: ${name0}"
87 echo " state: DEGRADED"
88 echo " scrub: none requested"
90 echo " NAME STATE READ WRITE CKSUM"
91 echo " ${name0} DEGRADED 0 0 0"
92 echo " raidz1 DEGRADED 0 0 0"
93 echo " ${guid0} REMOVED 0 0 0 was ${fdname0}"
94 echo " ${disk1} ONLINE 0 0 0"
95 echo " ${disk2} ONLINE 0 0 0"
96 echo "errors: No known data errors"
98 expect "${exp}" ${ZPOOL} status ${name0}
99 expect_ok ${ZPOOL} replace ${name0} ${dname0} ${disk3}
100 wait_for_resilver ${name0}
102 echo " pool: ${name0}"
103 echo " state: ONLINE"
104 echo " scrub: (scrub|resilver) completed after [0-9]+h[0-9]+m with 0 errors on .*"
106 echo " NAME STATE READ WRITE CKSUM"
107 echo " ${name0} ONLINE 0 0 0"
108 echo " raidz1 ONLINE 0 0 0"
109 echo " ${disk3} ONLINE 0 0 0( [0-9.]+[A-Z] resilvered)?"
110 echo " ${disk1} ONLINE 0 0 0( [0-9.]+[A-Z] resilvered)?"
111 echo " ${disk2} ONLINE 0 0 0( [0-9.]+[A-Z] resilvered)?"
112 echo "errors: No known data errors"
114 expect "${exp}" ${ZPOOL} status ${name0}
115 expect_ok ${ZPOOL} destroy ${name0}
116 expect_fl ${ZPOOL} status -x ${name0}
117 disk_create 0 ${dname0}
119 expect_ok ${ZPOOL} create ${name0} raidz1 ${disk0} ${disk1} ${disk2}
120 expect_ok ${ZPOOL} offline ${name0} ${disk1}
121 expect_ok ${ZPOOL} replace ${name0} ${disk1} ${disk3}
122 wait_for_resilver ${name0}
124 echo " pool: ${name0}"
125 echo " state: ONLINE"
126 echo " scrub: (scrub|resilver) completed after [0-9]+h[0-9]+m with 0 errors on .*"
128 echo " NAME STATE READ WRITE CKSUM"
129 echo " ${name0} ONLINE 0 0 0"
130 echo " raidz1 ONLINE 0 0 0"
131 echo " ${disk0} ONLINE 0 0 0( [0-9.]+[A-Z] resilvered)?"
132 echo " ${disk3} ONLINE 0 0 0( [0-9.]+[A-Z] resilvered)?"
133 echo " ${disk2} ONLINE 0 0 0( [0-9.]+[A-Z] resilvered)?"
134 echo "errors: No known data errors"
136 expect "${exp}" ${ZPOOL} status ${name0}
137 expect_ok ${ZPOOL} destroy ${name0}
138 expect_fl ${ZPOOL} status -x ${name0}