1.\" 2.\" CDDL HEADER START 3.\" 4.\" The contents of this file are subject to the terms of the 5.\" Common Development and Distribution License (the "License"). 6.\" You may not use this file except in compliance with the License. 7.\" 8.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9.\" or https://opensource.org/licenses/CDDL-1.0. 10.\" See the License for the specific language governing permissions 11.\" and limitations under the License. 12.\" 13.\" When distributing Covered Code, include this CDDL HEADER in each 14.\" file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15.\" If applicable, add the following below this CDDL HEADER, with the 16.\" fields enclosed by brackets "[]" replaced with your own identifying 17.\" information: Portions Copyright [yyyy] [name of copyright owner] 18.\" 19.\" CDDL HEADER END 20.\" 21.\" Copyright 2013 Darik Horn <dajhorn@vanadac.com>. All rights reserved. 22.\" 23.\" lint-ok: WARNING: sections out of conventional order: Sh SYNOPSIS 24.\" 25.Dd May 26, 2021 26.Dt ZHACK 1 27.Os 28. 29.Sh NAME 30.Nm zhack 31.Nd libzpool debugging tool 32.Sh DESCRIPTION 33This utility pokes configuration changes directly into a ZFS pool, 34which is dangerous and can cause data corruption. 35.Sh SYNOPSIS 36.Bl -tag -width Ds 37.It Xo 38.Nm zhack 39.Cm feature stat 40.Ar pool 41.Xc 42List feature flags. 43. 44.It Xo 45.Nm zhack 46.Cm feature enable 47.Op Fl d Ar description 48.Op Fl r 49.Ar pool 50.Ar guid 51.Xc 52Add a new feature to 53.Ar pool 54that is uniquely identified by 55.Ar guid , 56which is specified in the same form as a 57.Xr zfs 8 58user property. 59.Pp 60The 61.Ar description 62is a short human readable explanation of the new feature. 63.Pp 64The 65.Fl r 66flag indicates that 67.Ar pool 68can be safely opened in read-only mode by a system that does not understand the 69.Ar guid 70feature. 71. 72.It Xo 73.Nm zhack 74.Cm feature ref 75.Op Fl d Ns | Ns Fl m 76.Ar pool 77.Ar guid 78.Xc 79Increment the reference count of the 80.Ar guid 81feature in 82.Ar pool . 83.Pp 84The 85.Fl d 86flag decrements the reference count of the 87.Ar guid 88feature in 89.Ar pool 90instead. 91.Pp 92The 93.Fl m 94flag indicates that the 95.Ar guid 96feature is now required to read the pool MOS. 97. 98.It Xo 99.Nm zhack 100.Cm label repair 101.Ar device 102.Xc 103Repair corrupted labels by rewriting the checksum using the presumed valid contents of the label. 104.El 105. 106.Sh GLOBAL OPTIONS 107The following can be passed to all 108.Nm 109invocations before any subcommand: 110.Bl -tag -width "-d dir" 111.It Fl c Ar cachefile 112Read 113.Ar pool 114configuration from the 115.Ar cachefile , 116which is 117.Pa /etc/zfs/zpool.cache 118by default. 119.It Fl d Ar dir 120Search for 121.Ar pool 122members in 123.Ar dir . 124Can be specified more than once. 125.El 126. 127.Sh EXAMPLES 128.Bd -literal 129.No # Nm zhack Cm feature stat Ar tank 130for_read_obj: 131 org.illumos:lz4_compress = 0 132for_write_obj: 133 com.delphix:async_destroy = 0 134 com.delphix:empty_bpobj = 0 135descriptions_obj: 136 com.delphix:async_destroy = Destroy filesystems asynchronously. 137 com.delphix:empty_bpobj = Snapshots use less space. 138 org.illumos:lz4_compress = LZ4 compression algorithm support. 139 140.No # Nm zhack Cm feature enable Fl d No 'Predict future disk failures.' Ar tank com.example:clairvoyance 141.No # Nm zhack Cm feature ref Ar tank com.example:clairvoyance 142.Ed 143. 144.Sh SEE ALSO 145.Xr ztest 1 , 146.Xr zpool-features 7 , 147.Xr zfs 8 148