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