Die SSDs im UNRAID-Server laufen nun schon seit 2 Jahren ununterbrochen. Eine InfluxDB protokolliert ständig Messwerte und sorgt so neben den Schreibzugriffen von den Clients für ständige Schreiboperationen auf den SSDs. Zeit also, die SSDs mal zu tauschen.
Nachdem ein bekanntes Technikkaufhaus gerade günstig SAMSUNG 1TB-SSDs im Angebot hatte, ist also nun der Zeitpunkt gekommen. Glücklicherweise hatten wir unser UNRAID-System mit einem ZFS-RAIDZ1 aufgesetzt. Ein Plattentausch sollte also problemlos im laufenden Betrieb gelingen. Wir zeigen nun, wie es geht.
Zunächst schauen wir uns mit zpool status ssd
den Zustand des ZFS an:
root@toothless:/mnt/ssd/Gemeinsam# zpool status ssd
pool: ssd
state: ONLINE
config:
NAME STATE READ WRITE CKSUM
ssd ONLINE 0 0 0
raidz1-0 ONLINE 0 0 0
sdc ONLINE 0 0 0
sdd ONLINE 0 0 0
sde ONLINE 0 0 0
sdf ONLINE 0 0 0
sdg ONLINE 0 0 0
sdh ONLINE 0 0 0
sdi ONLINE 0 0 0
sdj ONLINE 0 0 0
errors: No known data errors
Nun tauschen wir ganz mutig im laufenden Betrieb z. B. die Platte sdd aus und schauen erneut:
root@toothless:~# zpool status ssd
pool: ssd
state: DEGRADED
status: One or more devices are faulted in response to persistent errors.
Sufficient replicas exist for the pool to continue functioning in a
degraded state.
action: Replace the faulted device, or use 'zpool clear' to mark the device
repaired.
config:
NAME STATE READ WRITE CKSUM
ssd DEGRADED 0 0 0
raidz1-0 DEGRADED 0 0 0
sdc ONLINE 0 0 0
sdd FAULTED 3 995 0 too many errors
sde ONLINE 0 0 0
sdf ONLINE 0 0 0
sdg ONLINE 0 0 0
sdh ONLINE 0 0 0
sdi ONLINE 0 0 0
sdj ONLINE 0 0 0
errors: No known data errors
Erwartungsgemäß zeigt die sdd nun mit der neuen Platte Fehler, aber unser ZFS befindet sich insgesamt noch in einem lauffähigen Zustand ohne Datenverluste, wenngleich auch DEGRADED. Nun stößt man mit zpool replace ssd sdd
ein Resilvering der ausgetauschten Platte an:
root@toothless:~# zpool replace ssd sdd
root@toothless:~# zpool status ssd
pool: ssd
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.
scan: resilver in progress since Sun Nov 20 05:44:52 2022
227G scanned at 37.9G/s, 7.88M issued at 1.31M/s, 1.82T total
0B resilvered, 0.00% done, no estimated completion time
config:
NAME STATE READ WRITE CKSUM
ssd DEGRADED 0 0 0
raidz1-0 DEGRADED 0 0 0
sdc ONLINE 0 0 0
replacing-1 DEGRADED 0 0 0
old FAULTED 3 995 0 too many errors
sdd ONLINE 0 0 0
sde ONLINE 0 0 0
sdf ONLINE 0 0 0
sdg ONLINE 0 0 0
sdh ONLINE 0 0 0
sdi ONLINE 0 0 0
sdj ONLINE 0 0 0
errors: No known data errors
Nach kurzer Zeit liegt die Zeitschätzung korrekt bei etwa 20 Minuten für den Austausch einer 500 GB-SSD.
root@toothless:/mnt/ssd/Gemeinsam# zpool status ssd
pool: ssd
state: ONLINE
scan: resilvered 231G in 00:20:07 with 0 errors on Sun Nov 20 05:22:23 2022
config:
NAME STATE READ WRITE CKSUM
ssd ONLINE 0 0 0
raidz1-0 ONLINE 0 0 0
sdc ONLINE 0 0 0
sdd ONLINE 0 0 0
sde ONLINE 0 0 0
sdf ONLINE 0 0 0
sdg ONLINE 0 0 0
sdh ONLINE 0 0 0
sdi ONLINE 0 0 0
sdj ONLINE 0 0 0
errors: No known data errors
Auf diese Weise tauscht man nun eine Platte nach der anderen.
Hinweis: Einen Ausfall einer 2. Platte sollte man während des Tauschs unbedingt vermeiden, denn ein ZFS-RAIDZ1 verkraftet nur den Ausfall einer Platte. Will man gegen ein solches Szenario gewappnet sein, muss man einen höheren Level wie ZFS-RAIDZ2 wählen. Einen Stromausfall verkraftet das ZFS, indem es das Resilvering nach dem erneuten Hochlauf wieder an der Unterbrechungsstelle fortsetzt.