### ZFS Test Suite Configuration Example Source: https://github.com/openzfs/zfs/blob/master/tests/README.md Example configuration output from the ZFS Test Suite, showing details like the runfile, tools path, test file directory, and disk configurations. ```text --- Configuration --- Runfile: /usr/share/zfs/runfiles/linux.run STF_TOOLS: /usr/share/zfs/test-runner STF_SUITE: /usr/share/zfs/zfs-tests STF_PATH: /var/tmp/constrained_path.G0Sf FILEDIR: /tmp/test FILES: /tmp/test/file-vdev0 /tmp/test/file-vdev1 /tmp/test/file-vdev2 LOOPBACKS: /dev/loop0 /dev/loop1 /dev/loop2 DISKS: loop0 loop1 loop2 NUM_DISKS: 3 FILESIZE: 4G ITERATIONS: 1 TAGS: functional Keep pool(s): rpool ``` -------------------------------- ### Install ZFS Test Suite using Apt-get Source: https://github.com/openzfs/zfs/blob/master/tests/README.md Install the ZFS Test Suite package from a distribution repository using apt-get. ```bash apt-get install zfs-test ``` -------------------------------- ### Install ZFS Test Suite using Dpkg Source: https://github.com/openzfs/zfs/blob/master/tests/README.md Install the ZFS Test Suite package using the dpkg command after building from source. ```bash dpkg -i ./zfs-test*.deb ``` -------------------------------- ### Install ZFS Test Suite using RPM Source: https://github.com/openzfs/zfs/blob/master/tests/README.md Install the ZFS Test Suite package using the rpm command after building from source. ```bash rpm -ivh ./zfs-test*.rpm ``` -------------------------------- ### Install ZFS Test Suite using Yum Source: https://github.com/openzfs/zfs/blob/master/tests/README.md Install the ZFS Test Suite package from a distribution repository using yum. ```bash yum install zfs-test ``` -------------------------------- ### Makefile.am Entry for zpool_example Source: https://github.com/openzfs/zfs/blob/master/tests/README.md Example of how to add a new test case directory to a Makefile.am file. Ensure the line ending is escaped if other directories follow. ```makefile zpool_example \ (Make sure to escape the line end as there will be other folders names following) ``` -------------------------------- ### Running ZFS Test Suite Source: https://github.com/openzfs/zfs/blob/master/tests/README.md Example command to run the ZFS Test Suite with verbose output and a specified file directory. The output shows configuration details, test execution progress, and a summary of results. ```bash $ /usr/share/zfs/zfs-tests.sh -v -d /tmp/test ``` -------------------------------- ### Updating zpool_example.run for Multiple Tests Source: https://github.com/openzfs/zfs/blob/master/tests/README.md Example of updating the 'tests' section in a runfile to include an additional test case, 'zpool_example_002_pos'. ```ini [DEFAULT] timeout = 600 outputdir = /var/tmp/test_results tags = ['functional'] tests = ['zpool_example_001_pos', 'zpool_example_002_pos'] ``` -------------------------------- ### ZFS Test Results Summary Example Source: https://github.com/openzfs/zfs/blob/master/tests/README.md Example summary of ZFS Test Suite results, indicating the number of skipped and passed tests, total running time, percentage passed, and the log directory. ```text Results Summary SKIP 52 PASS 1129 Running Time: 02:35:33 Percent passed: 95.6% Log directory: /var/tmp/test_results/20180515T054509 ``` -------------------------------- ### Makefile.am for ZFS Test Suite Runfiles Source: https://github.com/openzfs/zfs/blob/master/tests/README.md Example of a Makefile.am that lists the available runfiles for the ZFS Test Suite. This ensures these files are included in the distribution. ```makefile pkgdatadir = $(datadir)/@PACKAGE@/runfiles dist_pkgdata_DATA = \ zpool_example.run \ common.run \ freebsd.run \ linux.run \ longevity.run \ perf-regression.run \ sanity.run \ sunos.run ``` -------------------------------- ### Makefile.am for zpool_example Test Scripts Source: https://github.com/openzfs/zfs/blob/master/tests/README.md Makefile.am to specify the test scripts for the zpool_example test case. It lists the executable scripts that will be installed. ```makefile pkgdatadir = $(datadir)/@PACKAGE@/zfs-tests/tests/functional/cli_root/zpool_example dist_pkgdata_SCRIPTS = \ zpool_example_001_pos.ksh ``` -------------------------------- ### Run ZFS Test Suite from Installed Location Source: https://github.com/openzfs/zfs/blob/master/tests/README.md Execute the ZFS Test Suite script from its installed location. Ensure all prerequisites are met before running. ```bash /usr/share/zfs/zfs-tests.sh ``` -------------------------------- ### Custom Test Case Script (zpool_example_001_pos.ksh) Source: https://github.com/openzfs/zfs/blob/master/tests/README.md A basic ZFS test case script that demonstrates creating a pool using two loopback devices and then destroying it. It includes setup, execution, and cleanup steps. ```shell # DESCRIPTION: # zpool_example Test # # STRATEGY: # 1. Demo a very basic test case # DISKS_DEV1="/dev/loop0" DISKS_DEV2="/dev/loop1" TESTPOOL=EXAMPLE_POOL function cleanup { # Cleanup destroy_pool $TESTPOOL log_must rm -f $DISKS_DEV1 log_must rm -f $DISKS_DEV2 } log_assert "zpool_example" # Run function "cleanup" on exit log_onexit cleanup # Prep backend device log_must dd if=/dev/zero of=$DISKS_DEV1 bs=512 count=140000 log_must dd if=/dev/zero of=$DISKS_DEV2 bs=512 count=140000 # Create pool log_must zpool create $TESTPOOL $type $DISKS_DEV1 $DISKS_DEV2 log_pass "zpool_example" ``` -------------------------------- ### Run ZFS Test Suite from Source Tree Source: https://github.com/openzfs/zfs/blob/master/tests/README.md Execute the ZFS Test Suite script directly from the source tree for development and rapid validation. Ensure ZFS udev rules are installed. ```bash ./scripts/zfs-tests.sh ``` -------------------------------- ### zpool_example.run Configuration Source: https://github.com/openzfs/zfs/blob/master/tests/README.md Configuration file for a custom test case, defining default timeout, output directory, tags, and the list of tests to run. ```ini [DEFAULT] timeout = 600 outputdir = /var/tmp/test_results tags = ['functional'] tests = ['zpool_example_001_pos'] ``` -------------------------------- ### Build ZFS Test Suite from Source Source: https://github.com/openzfs/zfs/blob/master/tests/README.md Compile the ZFS Test Suite utilities from source using configure and make. ```bash ./configure make pkg-utils ``` -------------------------------- ### Create ZFS Pool and Filesystem Source: https://github.com/openzfs/zfs/blob/master/tests/zfs-tests/tests/functional/history/i386.orig_history.txt Use 'zpool create' to initialize a new ZFS storage pool and 'zfs create' to establish a new filesystem within that pool. Ensure the specified path for pool creation is valid. ```bash zpool create history_pool /var/tmp/i386.migratedpool.DAT ``` ```bash zfs create history_pool/fs ``` -------------------------------- ### Run All Unit Tests Source: https://github.com/openzfs/zfs/blob/master/tests/unit/README.md Execute all available unit tests using the 'make unit' command. This command builds and runs the tests, displaying their status and summary. ```bash $ make unit UNITTEST tests/unit/test_zap Running test suite with seed 0x9d36890b... zap.mock_microzap_sanity [ OK ] [ 0.00001088 / 0.00000939 CPU ] zap.mock_fatzap_sanity [ OK ] [ 0.00004281 / 0.00004257 CPU ] zap.zap_basic type=micro [ OK ] [ 0.00001899 / 0.00001893 CPU ] type=fat [ OK ] [ 0.00004174 / 0.00004135 CPU ] 4 of 4 (100%) tests successful, 0 (0%) test skipped. ``` -------------------------------- ### Makefile.am for Functional CLI Root Tests Source: https://github.com/openzfs/zfs/blob/master/tests/README.md Makefile.am snippet showing how to include the zpool_example test directory within the functional CLI root tests. ```makefile SUBDIRS = \ zpool_example \ ``` -------------------------------- ### Debian Init Script Linking Source: https://github.com/openzfs/zfs/blob/master/etc/init.d/README.md Manually set up init script links for ZFS services on Debian-based systems. The order is crucial for correct system initialization. ```bash update-rc.d zfs-import start 07 S . stop 07 0 1 6 . ``` ```bash update-rc.d zfs-load-key start 02 2 3 4 5 . stop 06 0 1 6 . ``` ```bash update-rc.d zfs-mount start 02 S . stop 06 0 1 6 . ``` ```bash update-rc.d zfs-zed start 07 2 3 4 5 . stop 08 0 1 6 . ``` ```bash update-rc.d zfs-share start 27 2 3 4 5 . stop 05 0 1 6 . ``` -------------------------------- ### Build for Unit Tests with Debugging Source: https://github.com/openzfs/zfs/blob/master/tests/unit/README.md Configure and build the project with options optimized for unit testing, including additional debug symbols. This is recommended for understanding and resolving test issues. ```bash ./configure \ --with-config=user \ --enable-debug --enable-debuginfo \ --disable-sysvinit --disable-systemd --disable-pam --disable-pyzfs make -j$(nproc) ``` -------------------------------- ### Gentoo Init Script Linking Source: https://github.com/openzfs/zfs/blob/master/etc/init.d/README.md Add ZFS init scripts to the system's runlevels on Gentoo using 'rc-update'. ```bash rc-update add zfs-import boot ``` ```bash rc-update add zfs-load-key boot ``` ```bash rc-update add zfs-mount boot ``` ```bash rc-update add zfs-zed default ``` ```bash rc-update add zfs-share default ``` -------------------------------- ### Create ZFS Snapshot and Clone Source: https://github.com/openzfs/zfs/blob/master/tests/zfs-tests/tests/functional/history/i386.orig_history.txt Generate a point-in-time snapshot of a ZFS filesystem with 'zfs snapshot'. A clone can then be created from this snapshot using 'zfs clone', allowing for independent modification. ```bash zfs snapshot history_pool/fs@snap ``` ```bash zfs clone history_pool/fs@snap history_pool/clone ``` -------------------------------- ### RedHat/Fedora/CentOS Init Script Configuration Source: https://github.com/openzfs/zfs/blob/master/etc/init.d/README.md Configure ZFS init scripts using the 'chkconfig' command on RedHat-based systems like Fedora and CentOS. ```bash chkconfig zfs-import ``` ```bash chkconfig zfs-load-key ``` ```bash chkconfig zfs-mount ``` ```bash chkconfig zfs-zed ``` ```bash chkconfig zfs-share ``` -------------------------------- ### Direct Execution of Test Binary Source: https://github.com/openzfs/zfs/blob/master/tests/unit/README.md Run a test binary directly from the command line for debugging purposes. This bypasses the make system and allows for use with debuggers like gdb. ```bash $ ./tests/unit/test_zap Running test suite with seed 0x18e131ac... ... ``` -------------------------------- ### Set ZFS Compression Source: https://github.com/openzfs/zfs/blob/master/tests/zfs-tests/tests/functional/history/sparc.orig_history.txt Use 'zfs set compression=on' to enable compression for a ZFS filesystem. This can save storage space. ```bash zfs set compression=on history_pool/fs ``` -------------------------------- ### Run zpool_influxdb Source: https://github.com/openzfs/zfs/blob/master/cmd/zpool_influxdb/README.md Execute zpool_influxdb to collect and print metrics for all imported pools. Specify a poolname to target a specific pool. ```shell zpool_influxdb [options] [poolname] ``` -------------------------------- ### Run a Specific Unit Test Binary Source: https://github.com/openzfs/zfs/blob/master/tests/unit/README.md Execute a specific unit test binary using the 'make unit T=' command. This allows for focused testing and debugging. ```bash $ make unit T=zap UNITTEST tests/unit/test_zap ... ``` -------------------------------- ### Configure ZFS Filesystem Properties Source: https://github.com/openzfs/zfs/blob/master/tests/zfs-tests/tests/functional/history/i386.orig_history.txt Set properties such as compression and checksum for a ZFS filesystem using 'zfs set'. These settings can optimize storage and data integrity. ```bash zfs set compression=on history_pool/fs ``` ```bash zfs set checksum=on history_pool ``` -------------------------------- ### Create ZFS Filesystem Source: https://github.com/openzfs/zfs/blob/master/tests/zfs-tests/tests/functional/history/sparc.orig_history.txt Use 'zfs create' to create a new ZFS filesystem within an existing pool. This command takes the pool name and the desired filesystem name. ```bash zfs create history_pool/fs ``` -------------------------------- ### Create ZFS Pool Source: https://github.com/openzfs/zfs/blob/master/tests/zfs-tests/tests/functional/history/sparc.orig_history.txt Use 'zpool create' to create a new ZFS storage pool. This command requires a pool name and the devices to be used for the pool. ```bash zpool create history_pool /var/tmp/sparc.migratedpool.DAT ``` -------------------------------- ### Promote ZFS Clone and Filesystem Source: https://github.com/openzfs/zfs/blob/master/tests/zfs-tests/tests/functional/history/i386.orig_history.txt Use 'zfs promote' to elevate a cloned filesystem or an existing filesystem to be a top-level filesystem within its parent. This operation changes the hierarchy. ```bash zfs promote history_pool/clone ``` ```bash zfs promote history_pool/fs ``` -------------------------------- ### ZFS Snapshot BootFS Service Source: https://github.com/openzfs/zfs/blob/master/contrib/dracut/README.md Enable the creation of a ZFS snapshot of the root dataset after pool import but before mounting. Useful for creating bootable snapshots. ```sh bootfs.snapshot ``` ```sh bootfs.snapshot=snapshot-name ``` -------------------------------- ### Apply Patch Command Source: https://github.com/openzfs/zfs/blob/master/contrib/intel_qat/readme.md Use this command to apply a patch to your system. Replace $PATCH with the actual path to the patch file. ```bash patch -p1 < _$PATCH_ ``` -------------------------------- ### Run ZFS Test Suite with Custom Runfile Source: https://github.com/openzfs/zfs/blob/master/tests/README.md Execute the ZFS Test Suite using a custom runfile to specify a subset of tests. The runfile format is detailed in test-runner(1). ```bash /usr/share/zfs/zfs-tests.sh -r my_tests.run ``` -------------------------------- ### Create ZFS Snapshot Source: https://github.com/openzfs/zfs/blob/master/tests/zfs-tests/tests/functional/history/sparc.orig_history.txt Use 'zfs snapshot' to create a read-only point-in-time copy of a ZFS filesystem or volume. Snapshots are useful for backups and rollback. ```bash zfs snapshot history_pool/fs@snap ``` -------------------------------- ### Load ZFS encryption key using b2sum checksum Source: https://github.com/openzfs/zfs/blob/master/contrib/initramfs/README.md This script loads an encryption key for a ZFS root filesystem. It calculates the BLAKE2 checksum of a key file and uses it to unlock the specified ZFS root. Ensure the KEYLOCATION variable is correctly set. ```sh key="$(b2sum "${KEYLOCATION#file://}")" || return printf '%s\n' "${key%% *}" | $ZFS load-key -L prompt "$ENCRYPTIONROOT" ``` -------------------------------- ### Set ZFS Pool BootFS Source: https://github.com/openzfs/zfs/blob/master/contrib/dracut/README.md Specify the default bootable dataset for a ZFS pool. This is an alternative to kernel command-line arguments. ```sh zpool set bootfs=pool/dataset pool ``` -------------------------------- ### Clone ZFS Snapshot Source: https://github.com/openzfs/zfs/blob/master/tests/zfs-tests/tests/functional/history/sparc.orig_history.txt Use 'zfs clone' to create a writable filesystem from a ZFS snapshot. Clones share data with the snapshot until modified, enabling efficient space usage. ```bash zfs clone history_pool/fs@snap history_pool/clone ``` -------------------------------- ### Configure Telegraf execd Input for zpool_influxdb Source: https://github.com/openzfs/zfs/blob/master/cmd/zpool_influxdb/README.md Use this TOML configuration for the Telegraf execd input agent to collect metrics from zpool_influxdb. Ensure the command path is correct and choose an appropriate signal for process management. ```toml # # Read metrics from zpool_influxdb [[inputs.execd]] # ## default installation location for zpool_influxdb command command = ["/usr/libexec/zfs/zpool_influxdb", "--execd"] ## Define how the process is signaled on each collection interval. ## Valid values are: ## "none" : Do not signal anything. (Recommended for service inputs) ## The process must output metrics by itself. ## "STDIN" : Send a newline on STDIN. (Recommended for gather inputs) ## "SIGHUP" : Send a HUP signal. Not available on Windows. (not recommended) ## "SIGUSR1" : Send a USR1 signal. Not available on Windows. ## "SIGUSR2" : Send a USR2 signal. Not available on Windows. signal = "STDIN" ## Delay before the process is restarted after an unexpected termination restart_delay = "10s" ## Data format to consume. ## Each data format has its own unique set of configuration options, read ## more about them here: ## https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_INPUT.md data_format = "influx" ``` -------------------------------- ### ZFS Rollback BootFS Service Source: https://github.com/openzfs/zfs/blob/master/contrib/dracut/README.md Enable the rollback of the root dataset to a specific snapshot after pool import but before mounting. Use with caution due to potential data loss. ```sh bootfs.rollback ``` ```sh bootfs.rollback=snapshot-name ``` -------------------------------- ### Force ZFS Pool Import Source: https://github.com/openzfs/zfs/blob/master/contrib/dracut/README.md Append the `-f` flag to all `zpool import` commands. Use with caution as it can lead to unexpected behavior. ```sh zfs_force ``` ```sh zfs.force ``` ```sh zfsforce ``` -------------------------------- ### Generate HTML Coverage Report Source: https://github.com/openzfs/zfs/blob/master/tests/unit/README.md Generate an interactive HTML code coverage report using 'make unit-coverage-html'. This report, generated by lcov and genhtml, allows for detailed inspection of source line coverage. ```bash $ make unit-coverage-html T=zap UNITTEST tests/unit/test_zap Running test suite with seed 0x485bf2e2... zap.mock_microzap_sanity [ OK ] [ 0.00000935 / 0.00000794 CPU ] zap.mock_fatzap_sanity [ OK ] [ 0.00006050 / 0.00006025 CPU ] ... zap.cursor_release_one type=micro [ OK ] [ 0.00001785 / 0.00001767 CPU ] type=fat [ OK ] [ 0.00005262 / 0.00005250 CPU ] 30 of 30 (100%) tests successful, 0 (0%) test skipped. coverage results: file:///home/robn/code/zfs-unit/tests/unit/tests/unit/test_zap_coverage/index.ht ml ``` -------------------------------- ### Set ZFS Dataset Mountpoint Source: https://github.com/openzfs/zfs/blob/master/contrib/dracut/README.md Configure the mountpoint for a ZFS dataset. This is crucial for compatibility, especially for the root dataset. ```sh zfs set mountpoint=/ pool/dataset ``` -------------------------------- ### ZFS Kernel Command Line with Spaces Source: https://github.com/openzfs/zfs/blob/master/contrib/dracut/README.md Handle spaces within ZFS dataset names on the kernel command line by replacing '+' with spaces. ```sh root=zfs:root+pool/data+set ``` -------------------------------- ### Configure Telegraf exec Input for zpool_influxdb Source: https://github.com/openzfs/zfs/blob/master/cmd/zpool_influxdb/README.md This TOML configuration is for the Telegraf exec input agent, suitable for older Telegraf versions. It specifies the command to run and the data format expected. ```toml # # Read metrics from zpool_influxdb [[inputs.exec]] # ## default installation location for zpool_influxdb command commands = ["/usr/libexec/zfs/zpool_influxdb"] data_format = "influx" ``` -------------------------------- ### ZFS Root Dataset Kernel Command Line Source: https://github.com/openzfs/zfs/blob/master/contrib/dracut/README.md Specify the ZFS root dataset using the `root=` kernel command-line parameter. Supports various formats for dataset identification. ```sh root=zfs:pool/dataset ``` ```sh root=zfs:AUTO ``` ```sh root=zfs: ``` ```sh root=zfs ``` ```sh root=ZFS=pool/dataset ``` -------------------------------- ### ZFS Disk Add Agent Module Source: https://github.com/openzfs/zfs/blob/master/cmd/zed/agents/README.md The Disk Add Agent module, also known as zfs_mod or Sysevent Loadable Module (SLM), handles events for newly added or changed disks. It manages VDEV online, replace, and expand operations using device identifiers. ```c agents/zfs_mod.c ``` -------------------------------- ### Generate Text Coverage Report Source: https://github.com/openzfs/zfs/blob/master/tests/unit/README.md Generate a text-based code coverage report after running tests with the 'unit-coverage' target. This report is suitable for inclusion in log files. ```bash $ make unit-coverage T=zap UNITTEST tests/unit/test_zap Running test suite with seed 0xf51efca9... zap.mock_microzap_sanity [ OK ] [ 0.00000941 / 0.00000834 CPU ] zap.mock_fatzap_sanity [ OK ] [ 0.00005782 / 0.00005766 CPU ] ... zap.cursor_release_one type=micro [ OK ] [ 0.00001705 / 0.00001681 CPU ] type=fat [ OK ] [ 0.00004748 / 0.00004738 CPU ] 30 of 30 (100%) tests successful, 0 (0%) test skipped. Coverage: test_zap | By line | By branch | By function | Rate% Total Hit | Rate% Total Hit | Rate% Total Hit module/zfs/u8_textprep.c | 0.0% 802 0 | 0.0% 510 0 | 0.0% 12 0 module/zfs/zap.c | 33.9% 610 207 | 31.1% 238 74 | 23.0% 74 17 module/zfs/zap_fat.c | 47.1% 665 313 | 29.8% 446 133 | 62.2% 37 23 module/zfs/zap_impl.c | 57.8% 232 134 | 39.7% 146 58 | 72.0% 25 18 module/zfs/zap_leaf.c | 60.9% 466 284 | 41.2% 216 89 | 78.3% 23 18 module/zfs/zap_micro.c | 68.9% 238 164 | 41.5% 142 59 | 92.9% 14 13 ``` -------------------------------- ### ZFS Test Runner Command Source: https://github.com/openzfs/zfs/blob/master/tests/README.md Command used internally by the zfs-tests.sh script to execute tests. It specifies the runfile, test tags, test suite path, and iterations. ```bash /usr/share/zfs/test-runner/bin/test-runner.py -c /usr/share/zfs/runfiles/linux.run \ -T functional -i /usr/share/zfs/zfs-tests -I 1 ``` -------------------------------- ### ZFS Retire Agent Module Source: https://github.com/openzfs/zfs/blob/master/cmd/zed/agents/README.md The Retire Agent module responds to diagnosed faults by isolating faulty VDEVs and managing hot spares. It notifies the ZFS kernel module of VDEV state changes and replaces faulty devices with spares. ```c agents/zfs_retire.c ``` -------------------------------- ### Extract Zstd Source Files Source: https://github.com/openzfs/zfs/blob/master/module/zstd/README.md This command-line script extracts specific Zstd source files required for integration into the ZFS module. Ensure the path to the Zstd source is correct. ```bash grep include [path to zstd]/build/single_file_libs/zstd-in.c | awk '{ print $2 }' ``` -------------------------------- ### Set ZFS Checksum Source: https://github.com/openzfs/zfs/blob/master/tests/zfs-tests/tests/functional/history/sparc.orig_history.txt Use 'zfs set checksum=on' to enable data integrity checking for a ZFS pool. This helps detect and correct data corruption. ```bash zfs set checksum=on history_pool ``` -------------------------------- ### ZFS Diagnosis Engine Module Source: https://github.com/openzfs/zfs/blob/master/cmd/zed/agents/README.md The Diagnosis Engine module is responsible for consuming per-vdev I/O and checksum ereports. It uses the SERD algorithm to generate fault diagnoses based on event frequency within a time window. ```c agents/zfs_diagnosis.c ``` -------------------------------- ### ZFS Disk Monitor Events Source: https://github.com/openzfs/zfs/blob/master/cmd/zed/agents/README.md These events are generated by the disk monitor to signal the addition or status change of a disk. They are consumed by response agents for VDEV management. ```c EC_DEV_ADD ``` ```c EC_DEV_STATUS ``` -------------------------------- ### Patch for Kernel 5.7 Source: https://github.com/openzfs/zfs/blob/master/contrib/intel_qat/readme.md This patch is specifically for kernel version 5.7. ```bash /patch/0001-pci_aer.diff ``` -------------------------------- ### Export ZFS Pool Source: https://github.com/openzfs/zfs/blob/master/tests/zfs-tests/tests/functional/history/sparc.orig_history.txt Use 'zpool export' to detach a ZFS storage pool from the system. This is necessary before moving the pool to another system or performing certain maintenance. ```bash zpool export history_pool ``` -------------------------------- ### Destroy ZFS Filesystem Recursively Source: https://github.com/openzfs/zfs/blob/master/tests/zfs-tests/tests/functional/history/i386.orig_history.txt Remove a ZFS filesystem and all its contents, including snapshots and clones, by using 'zfs destroy -r'. The -R flag ensures a forceful recursive destruction. ```bash zfs destroy -r -R history_pool/fs ``` -------------------------------- ### Patch for Kernel 5.6 Source: https://github.com/openzfs/zfs/blob/master/contrib/intel_qat/readme.md This patch is specifically for kernel version 5.6. ```bash /patch/0001-timespec.diff ``` -------------------------------- ### Export and Upgrade ZFS Pool Source: https://github.com/openzfs/zfs/blob/master/tests/zfs-tests/tests/functional/history/i386.orig_history.txt Export a ZFS storage pool using 'zpool export' to make it unavailable for use, typically before maintenance or moving it. 'zpool upgrade' is used to apply the latest ZFS pool features. ```bash zpool export history_pool ``` ```bash zpool upgrade history_pool ``` -------------------------------- ### ZFS Error Reporting Function Source: https://github.com/openzfs/zfs/blob/master/cmd/zed/agents/README.md This function is used by the ZFS kernel module to post error reports. These reports are crucial for ZED to detect and diagnose VDEV faults. ```c zfs_ereport_post() ``` -------------------------------- ### Patch for Kernel 5.8 Source: https://github.com/openzfs/zfs/blob/master/contrib/intel_qat/readme.md This patch is specifically for kernel version 5.8. ```bash /patch/0001-cryptohash.diff ``` -------------------------------- ### Upgrade ZFS Pool Source: https://github.com/openzfs/zfs/blob/master/tests/zfs-tests/tests/functional/history/sparc.orig_history.txt Use 'zpool upgrade' to upgrade a ZFS storage pool to the latest ZFS version features. This is typically done after a ZFS software update. ```bash zpool upgrade history_pool ``` -------------------------------- ### Clean Local Coverage Data Source: https://github.com/openzfs/zfs/blob/master/tests/unit/README.md Remove generated coverage data to force regeneration on the next coverage report generation. Use 'make unit-clean-local' for this purpose. ```bash make unit-clean-local ``` -------------------------------- ### ZFS Host ID Override Source: https://github.com/openzfs/zfs/blob/master/contrib/dracut/README.md Override the default host ID used by ZFS, typically for the initrd. Useful when the `/etc/hostid` file is not correctly baked in. ```sh spl_hostid ``` -------------------------------- ### FMD Module Garbage Collection in ZED Source: https://github.com/openzfs/zfs/blob/master/cmd/zed/agents/README.md This function is called periodically to perform garbage collection for FMD modules within ZED. Ensure proper module management to avoid resource leaks. ```c fmd_module_gc() ``` -------------------------------- ### InfluxDB Query for Grafana Heatmap Source: https://github.com/openzfs/zfs/blob/master/cmd/zpool_influxdb/README.md This InfluxDB query can be used in Grafana to visualize disk read latency histograms as a heatmap. It processes raw histogram data into a format suitable for heatmap display. ```influxql field(disk_read) last() non_negative_derivative(1s) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.