xref: /freebsd/sys/contrib/openzfs/man/man8/zpool-events.8 (revision b670c9bafc0e31c7609969bf374b2e80bdc00211)
1.\" SPDX-License-Identifier: CDDL-1.0
2.\"
3.\" CDDL HEADER START
4.\"
5.\" The contents of this file are subject to the terms of the
6.\" Common Development and Distribution License (the "License").
7.\" You may not use this file except in compliance with the License.
8.\"
9.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10.\" or https://opensource.org/licenses/CDDL-1.0.
11.\" See the License for the specific language governing permissions
12.\" and limitations under the License.
13.\"
14.\" When distributing Covered Code, include this CDDL HEADER in each
15.\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16.\" If applicable, add the following below this CDDL HEADER, with the
17.\" fields enclosed by brackets "[]" replaced with your own identifying
18.\" information: Portions Copyright [yyyy] [name of copyright owner]
19.\"
20.\" CDDL HEADER END
21.\"
22.\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved.
23.\" Copyright (c) 2012, 2018 by Delphix. All rights reserved.
24.\" Copyright (c) 2012 Cyril Plisko. All Rights Reserved.
25.\" Copyright (c) 2017 Datto Inc.
26.\" Copyright (c) 2018 George Melikov. All Rights Reserved.
27.\" Copyright 2017 Nexenta Systems, Inc.
28.\" Copyright (c) 2017 Open-E, Inc. All Rights Reserved.
29.\" Copyright (c) 2024, 2025, Klara, Inc.
30.\"
31.Dd May 27, 2025
32.Dt ZPOOL-EVENTS 8
33.Os
34.
35.Sh NAME
36.Nm zpool-events
37.Nd list recent events generated by kernel
38.Sh SYNOPSIS
39.Nm zpool
40.Cm events
41.Op Fl vHf
42.Op Ar pool
43.Nm zpool
44.Cm events
45.Fl c
46.
47.Sh DESCRIPTION
48Lists all recent events generated by the ZFS kernel modules.
49These events are consumed by the
50.Xr zed 8
51and used to automate administrative tasks such as replacing a failed device
52with a hot spare.
53For more information about the subclasses and event payloads
54that can be generated see
55.Sx EVENTS
56and the following sections.
57.
58.Sh OPTIONS
59.Bl -tag -compact -width Ds
60.It Fl c
61Clear all previous events.
62.It Fl f
63Follow mode.
64.It Fl H
65Scripted mode.
66Do not display headers, and separate fields by a
67single tab instead of arbitrary space.
68.It Fl v
69Print the entire payload for each event.
70.El
71.
72.Sh EVENTS
73These are the different event subclasses.
74The full event name would be
75.Sy ereport.fs.zfs.\& Ns Em SUBCLASS ,
76but only the last part is listed here.
77.Pp
78.Bl -tag -compact -width "vdev.bad_guid_sum"
79.It Sy checksum
80Issued when a checksum error has been detected.
81.It Sy io
82Issued when there is an I/O error in a vdev in the pool.
83.It Sy data
84Issued when there have been data errors in the pool.
85.It Sy deadman
86Issued when an I/O request is determined to be "hung", this can be caused
87by lost completion events due to flaky hardware or drivers.
88See
89.Sy zfs_deadman_failmode
90in
91.Xr zfs 4
92for additional information regarding "hung" I/O detection and configuration.
93.It Sy delay
94Issued when a completed I/O request exceeds the maximum allowed time
95specified by the
96.Sy zio_slow_io_ms
97module parameter.
98This can be an indicator of problems with the underlying storage device.
99The number of delay events is ratelimited by the
100.Sy zfs_slow_io_events_per_second
101module parameter.
102.It Sy dio_verify_rd
103Issued when there was a checksum verify error after a Direct I/O read has been
104issued.
105.It Sy dio_verify_wr
106Issued when there was a checksum verify error after a Direct I/O write has been
107issued.
108This event can only take place if the module parameter
109.Sy zfs_vdev_direct_write_verify
110is not set to zero.
111See
112.Xr zfs 4
113for more details on the
114.Sy zfs_vdev_direct_write_verify
115module parameter.
116.It Sy config
117Issued every time a vdev change have been done to the pool.
118.It Sy zpool
119Issued when a pool cannot be imported.
120.It Sy zpool.destroy
121Issued when a pool is destroyed.
122.It Sy zpool.export
123Issued when a pool is exported.
124.It Sy zpool.import
125Issued when a pool is imported.
126.It Sy zpool.reguid
127Issued when a REGUID (new unique identifier for the pool have been regenerated)
128have been detected.
129.It Sy vdev.unknown
130Issued when the vdev is unknown.
131Such as trying to clear device errors on a vdev that have failed/been kicked
132from the system/pool and is no longer available.
133.It Sy vdev.open_failed
134Issued when a vdev could not be opened (because it didn't exist for example).
135.It Sy vdev.corrupt_data
136Issued when corrupt data have been detected on a vdev.
137.It Sy vdev.no_replicas
138Issued when there are no more replicas to sustain the pool.
139This would lead to the pool being
140.Em DEGRADED .
141.It Sy vdev.bad_guid_sum
142Issued when a missing device in the pool have been detected.
143.It Sy vdev.too_small
144Issued when the system (kernel) have removed a device, and ZFS
145notices that the device isn't there any more.
146This is usually followed by a
147.Sy probe_failure
148event.
149.It Sy vdev.bad_label
150Issued when the label is OK but invalid.
151.It Sy vdev.bad_ashift
152Issued when the ashift alignment requirement has increased.
153.It Sy vdev.remove
154Issued when a vdev is detached from a mirror (or a spare detached from a
155vdev where it have been used to replace a failed drive - only works if
156the original drive have been re-added).
157.It Sy vdev.clear
158Issued when clearing device errors in a pool.
159Such as running
160.Nm zpool Cm clear
161on a device in the pool.
162.It Sy vdev.check
163Issued when a check to see if a given vdev could be opened is started.
164.It Sy vdev.spare
165Issued when a spare have kicked in to replace a failed device.
166.It Sy vdev.autoexpand
167Issued when a vdev can be automatically expanded.
168.It Sy io_failure
169Issued when there is an I/O failure in a vdev in the pool.
170.It Sy probe_failure
171Issued when a probe fails on a vdev.
172This would occur if a vdev
173have been kicked from the system outside of ZFS (such as the kernel
174have removed the device).
175.It Sy log_replay
176Issued when the intent log cannot be replayed.
177The can occur in the case of a missing or damaged log device.
178.It Sy resilver.start
179Issued when a resilver is started.
180.It Sy resilver.finish
181Issued when the running resilver have finished.
182.It Sy scrub.start
183Issued when a scrub is started on a pool.
184.It Sy scrub.finish
185Issued when a pool has finished scrubbing.
186.It Sy scrub.abort
187Issued when a scrub is aborted on a pool.
188.It Sy scrub.resume
189Issued when a scrub is resumed on a pool.
190.It Sy scrub.paused
191Issued when a scrub is paused on a pool.
192.It Sy bootfs.vdev.attach
193.El
194.
195.Sh PAYLOADS
196This is the payload (data, information) that accompanies an
197event.
198.Pp
199For
200.Xr zed 8 ,
201these are set to uppercase and prefixed with
202.Sy ZEVENT_ .
203.Pp
204.Bl -tag -compact -width "vdev_cksum_errors"
205.It Sy pool
206Pool name.
207.It Sy pool_failmode
208Failmode -
209.Sy wait ,
210.Sy continue ,
211or
212.Sy panic .
213See the
214.Sy failmode
215property in
216.Xr zpoolprops 7
217for more information.
218.It Sy pool_guid
219The GUID of the pool.
220.It Sy pool_context
221The load state for the pool (0=none, 1=open, 2=import, 3=tryimport, 4=recover
2225=error).
223.It Sy vdev_guid
224The GUID of the vdev in question (the vdev failing or operated upon with
225.Nm zpool Cm clear ,
226etc.).
227.It Sy vdev_type
228Type of vdev -
229.Sy disk ,
230.Sy file ,
231.Sy mirror ,
232etc.
233See the
234.Sy Virtual Devices
235section of
236.Xr zpoolconcepts 7
237for more information on possible values.
238.It Sy vdev_path
239Full path of the vdev, including any
240.Em -partX .
241.It Sy vdev_devid
242ID of vdev (if any).
243.It Sy vdev_fru
244Physical FRU location.
245.It Sy vdev_state
246State of vdev (0=uninitialized, 1=closed, 2=offline, 3=removed, 4=failed to
247open, 5=faulted, 6=degraded, 7=healthy).
248.It Sy vdev_ashift
249The ashift value of the vdev.
250.It Sy vdev_complete_ts
251The time the last I/O request completed for the specified vdev.
252.It Sy vdev_delta_ts
253The time since the last I/O request completed for the specified vdev.
254.It Sy vdev_spare_paths
255List of spares, including full path and any
256.Em -partX .
257.It Sy vdev_spare_guids
258GUID(s) of spares.
259.It Sy vdev_read_errors
260How many read errors that have been detected on the vdev.
261.It Sy vdev_write_errors
262How many write errors that have been detected on the vdev.
263.It Sy vdev_cksum_errors
264How many checksum errors that have been detected on the vdev.
265.It Sy parent_guid
266GUID of the vdev parent.
267.It Sy parent_type
268Type of parent.
269See
270.Sy vdev_type .
271.It Sy parent_path
272Path of the vdev parent (if any).
273.It Sy parent_devid
274ID of the vdev parent (if any).
275.It Sy zio_objset
276The object set number for a given I/O request.
277.It Sy zio_object
278The object number for a given I/O request.
279.It Sy zio_level
280The indirect level for the block.
281Level 0 is the lowest level and includes data blocks.
282Values > 0 indicate metadata blocks at the appropriate level.
283.It Sy zio_blkid
284The block ID for a given I/O request.
285.It Sy zio_err
286The error number for a failure when handling a given I/O request,
287compatible with
288.Xr errno 3
289with the value of
290.Sy EBADE
291used to indicate a ZFS checksum error.
292.It Sy zio_offset
293The offset in bytes of where to write the I/O request for the specified vdev.
294.It Sy zio_size
295The size in bytes of the I/O request.
296.It Sy zio_flags
297The current flags describing how the I/O request should be handled.
298See the
299.Sy I/O FLAGS
300section for the full list of I/O flags.
301.It Sy zio_stage
302The current stage of the I/O in the pipeline.
303See the
304.Sy I/O STAGES
305section for a full list of all the I/O stages.
306.It Sy zio_pipeline
307The valid pipeline stages for the I/O.
308See the
309.Sy I/O STAGES
310section for a full list of all the I/O stages.
311.It Sy zio_priority
312The queue priority of the I/O request.
313See the
314.Sy I/O PRIORITIES
315section for a full list of all the I/O priorities.
316.It Sy zio_tyoe
317The type of the I/O request.
318See the
319.Sy I/O TYPES
320section for a full list of all the I/O types.
321.It Sy zio_delay
322The time elapsed (in nanoseconds) waiting for the block layer to complete the
323I/O request.
324Unlike
325.Sy zio_delta ,
326this does not include any vdev queuing time and is
327therefore solely a measure of the block layer performance.
328.It Sy zio_timestamp
329The time when a given I/O request was submitted.
330.It Sy zio_delta
331The time required to service a given I/O request.
332.It Sy prev_state
333The previous state of the vdev.
334.It Sy cksum_algorithm
335Checksum algorithm used.
336See
337.Xr zfsprops 7
338for more information on the available checksum algorithms.
339.It Sy cksum_byteswap
340Whether or not the data is byteswapped.
341.It Sy bad_ranges
342.No [\& Ns Ar start , end )
343pairs of corruption offsets.
344Offsets are always aligned on a 64-bit boundary,
345and can include some gaps of non-corruption.
346(See
347.Sy bad_ranges_min_gap )
348.It Sy bad_ranges_min_gap
349In order to bound the size of the
350.Sy bad_ranges
351array, gaps of non-corruption
352less than or equal to
353.Sy bad_ranges_min_gap
354bytes have been merged with
355adjacent corruption.
356Always at least 8 bytes, since corruption is detected on a 64-bit word basis.
357.It Sy bad_range_sets
358This array has one element per range in
359.Sy bad_ranges .
360Each element contains
361the count of bits in that range which were clear in the good data and set
362in the bad data.
363.It Sy bad_range_clears
364This array has one element per range in
365.Sy bad_ranges .
366Each element contains
367the count of bits for that range which were set in the good data and clear in
368the bad data.
369.It Sy bad_set_bits
370If this field exists, it is an array of
371.Pq Ar bad data No & ~( Ns Ar good data ) ;
372that is, the bits set in the bad data which are cleared in the good data.
373Each element corresponds a byte whose offset is in a range in
374.Sy bad_ranges ,
375and the array is ordered by offset.
376Thus, the first element is the first byte in the first
377.Sy bad_ranges
378range, and the last element is the last byte in the last
379.Sy bad_ranges
380range.
381.It Sy bad_cleared_bits
382Like
383.Sy bad_set_bits ,
384but contains
385.Pq Ar good data No & ~( Ns Ar bad data ) ;
386that is, the bits set in the good data which are cleared in the bad data.
387.El
388.
389.Sh I/O STAGES
390The ZFS I/O pipeline is comprised of various stages which are defined below.
391The individual stages are used to construct these basic I/O
392operations: Read, Write, Free, Claim, Flush and Trim.
393These stages may be
394set on an event to describe the life cycle of a given I/O request.
395.Pp
396.TS
397tab(:);
398l l l .
399Stage:Bit Mask:Operations
400_:_:_
401ZIO_STAGE_OPEN:0x00000001:RWFCXT
402
403ZIO_STAGE_READ_BP_INIT:0x00000002:R-----
404ZIO_STAGE_WRITE_BP_INIT:0x00000004:-W----
405ZIO_STAGE_FREE_BP_INIT:0x00000008:--F---
406ZIO_STAGE_ISSUE_ASYNC:0x00000010:-WF--T
407ZIO_STAGE_WRITE_COMPRESS:0x00000020:-W----
408
409ZIO_STAGE_ENCRYPT:0x00000040:-W----
410ZIO_STAGE_CHECKSUM_GENERATE:0x00000080:-W----
411
412ZIO_STAGE_NOP_WRITE:0x00000100:-W----
413
414ZIO_STAGE_BRT_FREE:0x00000200:--F---
415
416ZIO_STAGE_DDT_READ_START:0x00000400:R-----
417ZIO_STAGE_DDT_READ_DONE:0x00000800:R-----
418ZIO_STAGE_DDT_WRITE:0x00001000:-W----
419ZIO_STAGE_DDT_FREE:0x00002000:--F---
420
421ZIO_STAGE_GANG_ASSEMBLE:0x00004000:RWFC--
422ZIO_STAGE_GANG_ISSUE:0x00008000:RWFC--
423
424ZIO_STAGE_DVA_THROTTLE:0x00010000:-W----
425ZIO_STAGE_DVA_ALLOCATE:0x00020000:-W----
426ZIO_STAGE_DVA_FREE:0x00040000:--F---
427ZIO_STAGE_DVA_CLAIM:0x00080000:---C--
428
429ZIO_STAGE_READY:0x00100000:RWFCIT
430
431ZIO_STAGE_VDEV_IO_START:0x00200000:RW--XT
432ZIO_STAGE_VDEV_IO_DONE:0x00400000:RW--XT
433ZIO_STAGE_VDEV_IO_ASSESS:0x00800000:RW--XT
434
435ZIO_STAGE_CHECKSUM_VERIFY:0x01000000:R-----
436ZIO_STAGE_DIO_CHECKSUM_VERIFY:0x02000000:-W----
437
438ZIO_STAGE_DONE:0x04000000:RWFCXT
439.TE
440.
441.Sh I/O FLAGS
442Every I/O request in the pipeline contains a set of flags which describe its
443function and are used to govern its behavior.
444These flags will be set in an event as a
445.Sy zio_flags
446payload entry.
447.Pp
448.TS
449tab(:);
450l l .
451Flag:Bit Mask
452_:_
453ZIO_FLAG_DONT_AGGREGATE:0x00000001
454ZIO_FLAG_IO_REPAIR:0x00000002
455ZIO_FLAG_SELF_HEAL:0x00000004
456ZIO_FLAG_RESILVER:0x00000008
457ZIO_FLAG_SCRUB:0x00000010
458ZIO_FLAG_SCAN_THREAD:0x00000020
459ZIO_FLAG_PHYSICAL:0x00000040
460
461ZIO_FLAG_CANFAIL:0x00000080
462ZIO_FLAG_SPECULATIVE:0x00000100
463ZIO_FLAG_CONFIG_WRITER:0x00000200
464ZIO_FLAG_DONT_RETRY:0x00000400
465ZIO_FLAG_NODATA:0x00001000
466ZIO_FLAG_INDUCE_DAMAGE:0x00002000
467
468ZIO_FLAG_IO_ALLOCATING:0x00004000
469ZIO_FLAG_IO_RETRY:0x00008000
470ZIO_FLAG_PROBE:0x00010000
471ZIO_FLAG_TRYHARD:0x00020000
472ZIO_FLAG_OPTIONAL:0x00040000
473
474ZIO_FLAG_DONT_QUEUE:0x00080000
475ZIO_FLAG_DONT_PROPAGATE:0x00100000
476ZIO_FLAG_IO_BYPASS:0x00200000
477ZIO_FLAG_IO_REWRITE:0x00400000
478ZIO_FLAG_RAW_COMPRESS:0x00800000
479ZIO_FLAG_RAW_ENCRYPT:0x01000000
480
481ZIO_FLAG_GANG_CHILD:0x02000000
482ZIO_FLAG_DDT_CHILD:0x04000000
483ZIO_FLAG_GODFATHER:0x08000000
484ZIO_FLAG_NOPWRITE:0x10000000
485ZIO_FLAG_REEXECUTED:0x20000000
486ZIO_FLAG_DELEGATED:0x40000000
487ZIO_FLAG_FASTWRITE:0x80000000
488.TE
489.
490.Sh I/O TYPES
491Every I/O request in the pipeline has a single type value.
492This value describes the kind of low-level work the I/O represents.
493This value will be set in an event as a
494.Sy zio_type
495payload entry.
496.Pp
497.TS
498tab(:);
499l l l .
500Type:Value:Description
501_:_:_
502ZIO_TYPE_NULL:0x0:internal I/O sync point
503ZIO_TYPE_READ:0x1:data read
504ZIO_TYPE_WRITE:0x2:data write
505ZIO_TYPE_FREE:0x3:block free
506ZIO_TYPE_CLAIM:0x4:block claim (ZIL replay)
507ZIO_TYPE_FLUSH:0x5:disk cache flush request
508ZIO_TYPE_TRIM:0x6:trim (discard)
509.TE
510.
511.Sh I/O PRIORITIES
512Every I/O request in the pipeline has a single priority value.
513This value is used by the queuing code to decide which I/O to issue next.
514This value will be set in an event as a
515.Sy zio_priority
516payload entry.
517.Pp
518.TS
519tab(:);
520l l l .
521Type:Value:Description
522_:_:_
523ZIO_PRIORITY_SYNC_READ:0x0:
524ZIO_PRIORITY_SYNC_WRITE:0x1:ZIL
525ZIO_PRIORITY_ASYNC_READ:0x2:prefetch
526ZIO_PRIORITY_ASYNC_WRITE:0x3:spa_sync()
527ZIO_PRIORITY_SCRUB:0x4:asynchronous scrub/resilver reads
528ZIO_PRIORITY_REMOVAL:0x5:reads/writes for vdev removal
529ZIO_PRIORITY_INITIALIZING:0x6:initializing I/O
530ZIO_PRIORITY_TRIM:0x7:trim I/O (discard)
531ZIO_PRIORITY_REBUILD:0x8:reads/writes for vdev rebuild
532ZIO_PRIORITY_NOW:0xa:non-queued i/os (e.g. free)
533.TE
534.
535.Sh SEE ALSO
536.Xr zfs 4 ,
537.Xr zed 8 ,
538.Xr zpool-wait 8
539