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 July 3, 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.It Sy sitout 194Issued when a 195.Sy RAIDZ 196or 197.Sy DRAID 198vdev triggers the 199.Sy autosit 200logic. 201This logic detects when a disk in such a vdev is significantly slower than its 202peers, and sits them out temporarily to preserve the performance of the pool. 203.El 204. 205.Sh PAYLOADS 206This is the payload (data, information) that accompanies an 207event. 208.Pp 209For 210.Xr zed 8 , 211these are set to uppercase and prefixed with 212.Sy ZEVENT_ . 213.Pp 214.Bl -tag -compact -width "vdev_cksum_errors" 215.It Sy pool 216Pool name. 217.It Sy pool_failmode 218Failmode - 219.Sy wait , 220.Sy continue , 221or 222.Sy panic . 223See the 224.Sy failmode 225property in 226.Xr zpoolprops 7 227for more information. 228.It Sy pool_guid 229The GUID of the pool. 230.It Sy pool_context 231The load state for the pool (0=none, 1=open, 2=import, 3=tryimport, 4=recover 2325=error). 233.It Sy vdev_guid 234The GUID of the vdev in question (the vdev failing or operated upon with 235.Nm zpool Cm clear , 236etc.). 237.It Sy vdev_type 238Type of vdev - 239.Sy disk , 240.Sy file , 241.Sy mirror , 242etc. 243See the 244.Sy Virtual Devices 245section of 246.Xr zpoolconcepts 7 247for more information on possible values. 248.It Sy vdev_path 249Full path of the vdev, including any 250.Em -partX . 251.It Sy vdev_devid 252ID of vdev (if any). 253.It Sy vdev_fru 254Physical FRU location. 255.It Sy vdev_state 256State of vdev (0=uninitialized, 1=closed, 2=offline, 3=removed, 4=failed to 257open, 5=faulted, 6=degraded, 7=healthy). 258.It Sy vdev_ashift 259The ashift value of the vdev. 260.It Sy vdev_complete_ts 261The time the last I/O request completed for the specified vdev. 262.It Sy vdev_delta_ts 263The time since the last I/O request completed for the specified vdev. 264.It Sy vdev_spare_paths 265List of spares, including full path and any 266.Em -partX . 267.It Sy vdev_spare_guids 268GUID(s) of spares. 269.It Sy vdev_read_errors 270How many read errors that have been detected on the vdev. 271.It Sy vdev_write_errors 272How many write errors that have been detected on the vdev. 273.It Sy vdev_cksum_errors 274How many checksum errors that have been detected on the vdev. 275.It Sy parent_guid 276GUID of the vdev parent. 277.It Sy parent_type 278Type of parent. 279See 280.Sy vdev_type . 281.It Sy parent_path 282Path of the vdev parent (if any). 283.It Sy parent_devid 284ID of the vdev parent (if any). 285.It Sy zio_objset 286The object set number for a given I/O request. 287.It Sy zio_object 288The object number for a given I/O request. 289.It Sy zio_level 290The indirect level for the block. 291Level 0 is the lowest level and includes data blocks. 292Values > 0 indicate metadata blocks at the appropriate level. 293.It Sy zio_blkid 294The block ID for a given I/O request. 295.It Sy zio_err 296The error number for a failure when handling a given I/O request, 297compatible with 298.Xr errno 3 299with the value of 300.Sy EBADE 301used to indicate a ZFS checksum error. 302.It Sy zio_offset 303The offset in bytes of where to write the I/O request for the specified vdev. 304.It Sy zio_size 305The size in bytes of the I/O request. 306.It Sy zio_flags 307The current flags describing how the I/O request should be handled. 308See the 309.Sy I/O FLAGS 310section for the full list of I/O flags. 311.It Sy zio_stage 312The current stage of the I/O in the pipeline. 313See the 314.Sy I/O STAGES 315section for a full list of all the I/O stages. 316.It Sy zio_pipeline 317The valid pipeline stages for the I/O. 318See the 319.Sy I/O STAGES 320section for a full list of all the I/O stages. 321.It Sy zio_priority 322The queue priority of the I/O request. 323See the 324.Sy I/O PRIORITIES 325section for a full list of all the I/O priorities. 326.It Sy zio_tyoe 327The type of the I/O request. 328See the 329.Sy I/O TYPES 330section for a full list of all the I/O types. 331.It Sy zio_delay 332The time elapsed (in nanoseconds) waiting for the block layer to complete the 333I/O request. 334Unlike 335.Sy zio_delta , 336this does not include any vdev queuing time and is 337therefore solely a measure of the block layer performance. 338.It Sy zio_timestamp 339The time when a given I/O request was submitted. 340.It Sy zio_delta 341The time required to service a given I/O request. 342.It Sy prev_state 343The previous state of the vdev. 344.It Sy cksum_algorithm 345Checksum algorithm used. 346See 347.Xr zfsprops 7 348for more information on the available checksum algorithms. 349.It Sy cksum_byteswap 350Whether or not the data is byteswapped. 351.It Sy bad_ranges 352.No [\& Ns Ar start , end ) 353pairs of corruption offsets. 354Offsets are always aligned on a 64-bit boundary, 355and can include some gaps of non-corruption. 356(See 357.Sy bad_ranges_min_gap ) 358.It Sy bad_ranges_min_gap 359In order to bound the size of the 360.Sy bad_ranges 361array, gaps of non-corruption 362less than or equal to 363.Sy bad_ranges_min_gap 364bytes have been merged with 365adjacent corruption. 366Always at least 8 bytes, since corruption is detected on a 64-bit word basis. 367.It Sy bad_range_sets 368This array has one element per range in 369.Sy bad_ranges . 370Each element contains 371the count of bits in that range which were clear in the good data and set 372in the bad data. 373.It Sy bad_range_clears 374This array has one element per range in 375.Sy bad_ranges . 376Each element contains 377the count of bits for that range which were set in the good data and clear in 378the bad data. 379.It Sy bad_set_bits 380If this field exists, it is an array of 381.Pq Ar bad data No & ~( Ns Ar good data ) ; 382that is, the bits set in the bad data which are cleared in the good data. 383Each element corresponds a byte whose offset is in a range in 384.Sy bad_ranges , 385and the array is ordered by offset. 386Thus, the first element is the first byte in the first 387.Sy bad_ranges 388range, and the last element is the last byte in the last 389.Sy bad_ranges 390range. 391.It Sy bad_cleared_bits 392Like 393.Sy bad_set_bits , 394but contains 395.Pq Ar good data No & ~( Ns Ar bad data ) ; 396that is, the bits set in the good data which are cleared in the bad data. 397.El 398. 399.Sh I/O STAGES 400The ZFS I/O pipeline is comprised of various stages which are defined below. 401The individual stages are used to construct these basic I/O 402operations: Read, Write, Free, Claim, Flush and Trim. 403These stages may be 404set on an event to describe the life cycle of a given I/O request. 405.Pp 406.TS 407tab(:); 408l l l . 409Stage:Bit Mask:Operations 410_:_:_ 411ZIO_STAGE_OPEN:0x00000001:RWFCXT 412 413ZIO_STAGE_READ_BP_INIT:0x00000002:R----- 414ZIO_STAGE_WRITE_BP_INIT:0x00000004:-W---- 415ZIO_STAGE_FREE_BP_INIT:0x00000008:--F--- 416ZIO_STAGE_ISSUE_ASYNC:0x00000010:-WF--T 417ZIO_STAGE_WRITE_COMPRESS:0x00000020:-W---- 418 419ZIO_STAGE_ENCRYPT:0x00000040:-W---- 420ZIO_STAGE_CHECKSUM_GENERATE:0x00000080:-W---- 421 422ZIO_STAGE_NOP_WRITE:0x00000100:-W---- 423 424ZIO_STAGE_BRT_FREE:0x00000200:--F--- 425 426ZIO_STAGE_DDT_READ_START:0x00000400:R----- 427ZIO_STAGE_DDT_READ_DONE:0x00000800:R----- 428ZIO_STAGE_DDT_WRITE:0x00001000:-W---- 429ZIO_STAGE_DDT_FREE:0x00002000:--F--- 430 431ZIO_STAGE_GANG_ASSEMBLE:0x00004000:RWFC-- 432ZIO_STAGE_GANG_ISSUE:0x00008000:RWFC-- 433 434ZIO_STAGE_DVA_THROTTLE:0x00010000:-W---- 435ZIO_STAGE_DVA_ALLOCATE:0x00020000:-W---- 436ZIO_STAGE_DVA_FREE:0x00040000:--F--- 437ZIO_STAGE_DVA_CLAIM:0x00080000:---C-- 438 439ZIO_STAGE_READY:0x00100000:RWFCIT 440 441ZIO_STAGE_VDEV_IO_START:0x00200000:RW--XT 442ZIO_STAGE_VDEV_IO_DONE:0x00400000:RW--XT 443ZIO_STAGE_VDEV_IO_ASSESS:0x00800000:RW--XT 444 445ZIO_STAGE_CHECKSUM_VERIFY:0x01000000:R----- 446ZIO_STAGE_DIO_CHECKSUM_VERIFY:0x02000000:-W---- 447 448ZIO_STAGE_DONE:0x04000000:RWFCXT 449.TE 450. 451.Sh I/O FLAGS 452Every I/O request in the pipeline contains a set of flags which describe its 453function and are used to govern its behavior. 454These flags will be set in an event as a 455.Sy zio_flags 456payload entry. 457.Pp 458.TS 459tab(:); 460l l . 461Flag:Bit Mask 462_:_ 463ZIO_FLAG_DONT_AGGREGATE:0x00000001 464ZIO_FLAG_IO_REPAIR:0x00000002 465ZIO_FLAG_SELF_HEAL:0x00000004 466ZIO_FLAG_RESILVER:0x00000008 467ZIO_FLAG_SCRUB:0x00000010 468ZIO_FLAG_SCAN_THREAD:0x00000020 469ZIO_FLAG_PHYSICAL:0x00000040 470 471ZIO_FLAG_CANFAIL:0x00000080 472ZIO_FLAG_SPECULATIVE:0x00000100 473ZIO_FLAG_CONFIG_WRITER:0x00000200 474ZIO_FLAG_DONT_RETRY:0x00000400 475ZIO_FLAG_NODATA:0x00001000 476ZIO_FLAG_INDUCE_DAMAGE:0x00002000 477 478ZIO_FLAG_ALLOC_THROTTLED:0x00004000 479ZIO_FLAG_IO_RETRY:0x00008000 480ZIO_FLAG_PROBE:0x00010000 481ZIO_FLAG_TRYHARD:0x00020000 482ZIO_FLAG_OPTIONAL:0x00040000 483 484ZIO_FLAG_DONT_QUEUE:0x00080000 485ZIO_FLAG_DONT_PROPAGATE:0x00100000 486ZIO_FLAG_IO_BYPASS:0x00200000 487ZIO_FLAG_IO_REWRITE:0x00400000 488ZIO_FLAG_RAW_COMPRESS:0x00800000 489ZIO_FLAG_RAW_ENCRYPT:0x01000000 490 491ZIO_FLAG_GANG_CHILD:0x02000000 492ZIO_FLAG_DDT_CHILD:0x04000000 493ZIO_FLAG_GODFATHER:0x08000000 494ZIO_FLAG_NOPWRITE:0x10000000 495ZIO_FLAG_REEXECUTED:0x20000000 496ZIO_FLAG_DELEGATED:0x40000000 497ZIO_FLAG_FASTWRITE:0x80000000 498.TE 499. 500.Sh I/O TYPES 501Every I/O request in the pipeline has a single type value. 502This value describes the kind of low-level work the I/O represents. 503This value will be set in an event as a 504.Sy zio_type 505payload entry. 506.Pp 507.TS 508tab(:); 509l l l . 510Type:Value:Description 511_:_:_ 512ZIO_TYPE_NULL:0x0:internal I/O sync point 513ZIO_TYPE_READ:0x1:data read 514ZIO_TYPE_WRITE:0x2:data write 515ZIO_TYPE_FREE:0x3:block free 516ZIO_TYPE_CLAIM:0x4:block claim (ZIL replay) 517ZIO_TYPE_FLUSH:0x5:disk cache flush request 518ZIO_TYPE_TRIM:0x6:trim (discard) 519.TE 520. 521.Sh I/O PRIORITIES 522Every I/O request in the pipeline has a single priority value. 523This value is used by the queuing code to decide which I/O to issue next. 524This value will be set in an event as a 525.Sy zio_priority 526payload entry. 527.Pp 528.TS 529tab(:); 530l l l . 531Type:Value:Description 532_:_:_ 533ZIO_PRIORITY_SYNC_READ:0x0: 534ZIO_PRIORITY_SYNC_WRITE:0x1:ZIL 535ZIO_PRIORITY_ASYNC_READ:0x2:prefetch 536ZIO_PRIORITY_ASYNC_WRITE:0x3:spa_sync() 537ZIO_PRIORITY_SCRUB:0x4:asynchronous scrub/resilver reads 538ZIO_PRIORITY_REMOVAL:0x5:reads/writes for vdev removal 539ZIO_PRIORITY_INITIALIZING:0x6:initializing I/O 540ZIO_PRIORITY_TRIM:0x7:trim I/O (discard) 541ZIO_PRIORITY_REBUILD:0x8:reads/writes for vdev rebuild 542ZIO_PRIORITY_NOW:0xa:non-queued i/os (e.g. free) 543.TE 544. 545.Sh SEE ALSO 546.Xr zfs 4 , 547.Xr zed 8 , 548.Xr zpool-wait 8 549