zpool dient zur Erstellung und Wartung von ZFS-Pools.
Der grundlegene Syntax lautet:
# zpool create <Poolname> <Pooltyp> <Laufwerke> [spare <Laufwerk[e]>] [-o <Optionen>]
| Typ | Bezeichnung |
|---|---|
| RAID-0/Striping (Standard) | |
| mirror | RAID-1/Mirroring |
| raidz | RAID-Z1 (1 Paritätsbit, ähnlich RAID-5) |
| raidz2 | RAID-Z2 (2 Paritätsbits, ähnlich RAID-6) |
| raidz3 | RAID-Z3 (3 Paritätsbits) |
Mithilfe des Schlagworts spare lassen sich eine oder mehrere Hotspares definieren:
# zpool create pool0 /dev/da{0,1,2,3,4} spare /dev/da5
# zpool status
pool: pool0
state: ONLINE
scrub: none requested
config:
NAME STATE READ WRITE CKSUM
pool0 ONLINE 0 0 0
da0 ONLINE 0 0 0
da1 ONLINE 0 0 0
da2 ONLINE 0 0 0
da3 ONLINE 0 0 0
da4 ONLINE 0 0 0
spares
da5 AVAIL
errors: No known data errors
Ein Pool kann mit dem folgenden Aufruf gelöscht werden:
# zpool destroy <Poolname>
# zpool destroy pool0 # zpool list no pools available
zpool kann den Status eines Pools anzeigen, so kann man beispielsweise ausgefallene Festplatten erkennen:
# zpool status pool0
pool: pool0
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: http://www.sun.com/msg/ZFS-8000-2Q
scrub: none requested
config:
NAME STATE READ WRITE CKSUM
pool0 DEGRADED 0 0 0
raidz1 DEGRADED 0 0 0
da0 ONLINE 0 0 0
da1 ONLINE 0 0 0
da2 ONLINE 0 0 0
da3 ONLINE 0 0 0
da4 ONLINE 0 0 0
da5 UNAVAIL 0 0 0 cannot open
errors: No known data errors
In diesem Fall ist eine Festplatte ausgefallen.