xref: /freebsd/sys/contrib/openzfs/man/man1/zhack.1 (revision 53b70c86)
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 http://www.opensolaris.org/os/licensing.
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.El
98.
99.Sh GLOBAL OPTIONS
100The following can be passed to all
101.Nm
102invocations before any subcommand:
103.Bl -tag -width "-d dir"
104.It Fl c Ar cachefile
105Read
106.Ar pool
107configuration from the
108.Ar cachefile ,
109which is
110.Pa /etc/zfs/zpool.cache
111by default.
112.It Fl d Ar dir
113Search for
114.Ar pool
115members in
116.Ar dir .
117Can be specified more than once.
118.El
119.
120.Sh EXAMPLES
121.Bd -literal
122.No # Nm zhack Cm feature stat Ar tank
123for_read_obj:
124	org.illumos:lz4_compress = 0
125for_write_obj:
126	com.delphix:async_destroy = 0
127	com.delphix:empty_bpobj = 0
128descriptions_obj:
129	com.delphix:async_destroy = Destroy filesystems asynchronously.
130	com.delphix:empty_bpobj = Snapshots use less space.
131	org.illumos:lz4_compress = LZ4 compression algorithm support.
132
133.No # Nm zhack Cm feature enable Fl d No 'Predict future disk failures.' Ar tank com.example:clairvoyance
134.No # Nm zhack Cm feature ref Ar tank com.example:clairvoyance
135.Ed
136.
137.Sh SEE ALSO
138.Xr ztest 1 ,
139.Xr zpool-features 7 ,
140.Xr zfs 8
141