Die Ausgangssituation hier ist ein ZFS Pool, welcher mindestens drei Platten umfasst und (mindestens) mit Raid-Z1 läuft. Damit ist gesichert, dass das System – so lange nur eine Platte ausfällt, noch funktionstüchtig ist. Wenn dies der Fall ist, gilt es zuerst einmal die fehlerhafte Platte am System zu finden. Dies passiert mit zpool status -x:
pool: MyPool
state: DEGRADED
status: One or more devices could not be opened. Sufficient replicas exist for
the pool to continue functioning in a degraded state.
action: Attach the missing device and online it using 'zpool online'.
see: https://web.archive.org/web/20090511160031/http://www.sun.com:80/msg/ZFS-8000-2Q
scrub: none requested
config:
NAME STATE READ WRITE CKSUM
Ahsay DEGRADED 0 0 0
raidz1 DEGRADED 0 0 0
c1t0d5 ONLINE 0 0 0
c1t0d6 ONLINE 0 0 0
c1t0d7 UNAVAIL 0 0 0 cannot open
c1t0d8 ONLINE 0 0 0
errors: No known data errors
In unserem Fall ist die defekte Platte c1t0d7. Ist die Platte als solches unversehrt, kann man versuchen sie wieder online zu bringen. Dies passiert mit dem Befehl ‚zpool online
Wenn dies klappt, repariert sich der Pool selbst und alles ist wieder in Butter. Sollte man jedoch eine neue Platte einbauen müssen, so wird diese mit ‚zpool replace
pool: MyPool
state: DEGRADED
status: One or more devices is currently being resilvered. The pool will
continue to function, possibly in a degraded state.
action: Wait for the resilver to complete.
scrub: resilver in progress for 0h0m, 0.00% done, 517h14m to go
config:
NAME STATE READ WRITE CKSUM
Ahsay DEGRADED 0 0 0
raidz1 DEGRADED 0 0 0
c1t0d5 ONLINE 0 0 0
c1t0d6 ONLINE 0 0 0
replacing DEGRADED 0 0 7
c1t0d7s0/o FAULTED 0 0 0 corrupted data
c1t0d7 ONLINE 0 0 0 3.54M resilvered
c1t0d8 ONLINE 0 0 0
errors: No known data errors
Nachdem der Rebuild, das sogenannte Resilvering abgeschlossen ist, ist das Thema auch schon überstanden. Kurz, Schmerzlos und irgendwie schon fast zu schön um Wahr zu sein, weil das Ganze online passiert und das System immer verfügbar ist.