xref: /freebsd/sys/contrib/openzfs/man/man1/zhack.1 (revision e639e0d27cc863ba1b8de20e861e6b5d9b922a8e)
1eda14cbcSMatt Macy.\"
2eda14cbcSMatt Macy.\" CDDL HEADER START
3eda14cbcSMatt Macy.\"
4eda14cbcSMatt Macy.\" The contents of this file are subject to the terms of the
5eda14cbcSMatt Macy.\" Common Development and Distribution License (the "License").
6eda14cbcSMatt Macy.\" You may not use this file except in compliance with the License.
7eda14cbcSMatt Macy.\"
8eda14cbcSMatt Macy.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9271171e0SMartin Matuska.\" or https://opensource.org/licenses/CDDL-1.0.
10eda14cbcSMatt Macy.\" See the License for the specific language governing permissions
11eda14cbcSMatt Macy.\" and limitations under the License.
12eda14cbcSMatt Macy.\"
13eda14cbcSMatt Macy.\" When distributing Covered Code, include this CDDL HEADER in each
14eda14cbcSMatt Macy.\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15eda14cbcSMatt Macy.\" If applicable, add the following below this CDDL HEADER, with the
16eda14cbcSMatt Macy.\" fields enclosed by brackets "[]" replaced with your own identifying
17eda14cbcSMatt Macy.\" information: Portions Copyright [yyyy] [name of copyright owner]
18eda14cbcSMatt Macy.\"
19eda14cbcSMatt Macy.\" CDDL HEADER END
20eda14cbcSMatt Macy.\"
21eda14cbcSMatt Macy.\" Copyright 2013 Darik Horn <dajhorn@vanadac.com>. All rights reserved.
22eda14cbcSMatt Macy.\"
2316038816SMartin Matuska.\" lint-ok: WARNING: sections out of conventional order: Sh SYNOPSIS
2416038816SMartin Matuska.\"
2516038816SMartin Matuska.Dd May 26, 2021
2616038816SMartin Matuska.Dt ZHACK 1
2716038816SMartin Matuska.Os
2816038816SMartin Matuska.
2916038816SMartin Matuska.Sh NAME
3016038816SMartin Matuska.Nm zhack
3116038816SMartin Matuska.Nd libzpool debugging tool
3216038816SMartin Matuska.Sh DESCRIPTION
33eda14cbcSMatt MacyThis utility pokes configuration changes directly into a ZFS pool,
34eda14cbcSMatt Macywhich is dangerous and can cause data corruption.
3516038816SMartin Matuska.Sh SYNOPSIS
3616038816SMartin Matuska.Bl -tag -width Ds
3716038816SMartin Matuska.It Xo
3816038816SMartin Matuska.Nm zhack
3916038816SMartin Matuska.Cm feature stat
4016038816SMartin Matuska.Ar pool
4116038816SMartin Matuska.Xc
42eda14cbcSMatt MacyList feature flags.
4316038816SMartin Matuska.
4416038816SMartin Matuska.It Xo
4516038816SMartin Matuska.Nm zhack
4616038816SMartin Matuska.Cm feature enable
4716038816SMartin Matuska.Op Fl d Ar description
4816038816SMartin Matuska.Op Fl r
4916038816SMartin Matuska.Ar pool
5016038816SMartin Matuska.Ar guid
5116038816SMartin Matuska.Xc
5216038816SMartin MatuskaAdd a new feature to
5316038816SMartin Matuska.Ar pool
5416038816SMartin Matuskathat is uniquely identified by
5516038816SMartin Matuska.Ar guid ,
5616038816SMartin Matuskawhich is specified in the same form as a
5716038816SMartin Matuska.Xr zfs 8
5816038816SMartin Matuskauser property.
5916038816SMartin Matuska.Pp
6016038816SMartin MatuskaThe
6116038816SMartin Matuska.Ar description
6216038816SMartin Matuskais a short human readable explanation of the new feature.
6316038816SMartin Matuska.Pp
6416038816SMartin MatuskaThe
6516038816SMartin Matuska.Fl r
6616038816SMartin Matuskaflag indicates that
6716038816SMartin Matuska.Ar pool
6816038816SMartin Matuskacan be safely opened in read-only mode by a system that does not understand the
6916038816SMartin Matuska.Ar guid
70eda14cbcSMatt Macyfeature.
7116038816SMartin Matuska.
7216038816SMartin Matuska.It Xo
7316038816SMartin Matuska.Nm zhack
7416038816SMartin Matuska.Cm feature ref
7516038816SMartin Matuska.Op Fl d Ns | Ns Fl m
7616038816SMartin Matuska.Ar pool
7716038816SMartin Matuska.Ar guid
7816038816SMartin Matuska.Xc
7916038816SMartin MatuskaIncrement the reference count of the
8016038816SMartin Matuska.Ar guid
8116038816SMartin Matuskafeature in
8216038816SMartin Matuska.Ar pool .
8316038816SMartin Matuska.Pp
8416038816SMartin MatuskaThe
8516038816SMartin Matuska.Fl d
8616038816SMartin Matuskaflag decrements the reference count of the
8716038816SMartin Matuska.Ar guid
8816038816SMartin Matuskafeature in
8916038816SMartin Matuska.Ar pool
9016038816SMartin Matuskainstead.
9116038816SMartin Matuska.Pp
9216038816SMartin MatuskaThe
9316038816SMartin Matuska.Fl m
9416038816SMartin Matuskaflag indicates that the
9516038816SMartin Matuska.Ar guid
9616038816SMartin Matuskafeature is now required to read the pool MOS.
97dae17134SMartin Matuska.
98dae17134SMartin Matuska.It Xo
99dae17134SMartin Matuska.Nm zhack
100dae17134SMartin Matuska.Cm label repair
101*e639e0d2SMartin Matuska.Op Fl cu
102dae17134SMartin Matuska.Ar device
103dae17134SMartin Matuska.Xc
104*e639e0d2SMartin MatuskaRepair labels of a specified
105*e639e0d2SMartin Matuska.Ar device
106*e639e0d2SMartin Matuskaaccording to options.
107*e639e0d2SMartin Matuska.Pp
108*e639e0d2SMartin MatuskaFlags may be combined to do their functions simultaneously.
109*e639e0d2SMartin Matuska.
110*e639e0d2SMartin Matuska.Pp
111*e639e0d2SMartin MatuskaThe
112*e639e0d2SMartin Matuska.Fl c
113*e639e0d2SMartin Matuskaflag repairs corrupted label checksums
114*e639e0d2SMartin Matuska.
115*e639e0d2SMartin Matuska.Pp
116*e639e0d2SMartin MatuskaThe
117*e639e0d2SMartin Matuska.Fl u
118*e639e0d2SMartin Matuskaflag restores the label on a detached device
119*e639e0d2SMartin Matuska.Pp
120*e639e0d2SMartin MatuskaExample:
121*e639e0d2SMartin Matuska.Nm zhack Cm label repair Fl cu Ar device
122*e639e0d2SMartin Matuska  Fix checksums and undetach a device
123*e639e0d2SMartin Matuska.
12416038816SMartin Matuska.El
12516038816SMartin Matuska.
12616038816SMartin Matuska.Sh GLOBAL OPTIONS
12716038816SMartin MatuskaThe following can be passed to all
12816038816SMartin Matuska.Nm
12916038816SMartin Matuskainvocations before any subcommand:
13016038816SMartin Matuska.Bl -tag -width "-d dir"
13116038816SMartin Matuska.It Fl c Ar cachefile
13216038816SMartin MatuskaRead
13316038816SMartin Matuska.Ar pool
13416038816SMartin Matuskaconfiguration from the
13516038816SMartin Matuska.Ar cachefile ,
13616038816SMartin Matuskawhich is
13716038816SMartin Matuska.Pa /etc/zfs/zpool.cache
13816038816SMartin Matuskaby default.
13916038816SMartin Matuska.It Fl d Ar dir
14016038816SMartin MatuskaSearch for
14116038816SMartin Matuska.Ar pool
14216038816SMartin Matuskamembers in
14316038816SMartin Matuska.Ar dir .
14416038816SMartin MatuskaCan be specified more than once.
14516038816SMartin Matuska.El
14616038816SMartin Matuska.
14716038816SMartin Matuska.Sh EXAMPLES
14816038816SMartin Matuska.Bd -literal
1493ff01b23SMartin Matuska.No # Nm zhack Cm feature stat Ar tank
150eda14cbcSMatt Macyfor_read_obj:
151eda14cbcSMatt Macy	org.illumos:lz4_compress = 0
152eda14cbcSMatt Macyfor_write_obj:
153eda14cbcSMatt Macy	com.delphix:async_destroy = 0
154eda14cbcSMatt Macy	com.delphix:empty_bpobj = 0
155eda14cbcSMatt Macydescriptions_obj:
156eda14cbcSMatt Macy	com.delphix:async_destroy = Destroy filesystems asynchronously.
157eda14cbcSMatt Macy	com.delphix:empty_bpobj = Snapshots use less space.
158eda14cbcSMatt Macy	org.illumos:lz4_compress = LZ4 compression algorithm support.
15916038816SMartin Matuska
1603ff01b23SMartin Matuska.No # Nm zhack Cm feature enable Fl d No 'Predict future disk failures.' Ar tank com.example:clairvoyance
1613ff01b23SMartin Matuska.No # Nm zhack Cm feature ref Ar tank com.example:clairvoyance
16216038816SMartin Matuska.Ed
16316038816SMartin Matuska.
16416038816SMartin Matuska.Sh SEE ALSO
16516038816SMartin Matuska.Xr ztest 1 ,
1663ff01b23SMartin Matuska.Xr zpool-features 7 ,
16716038816SMartin Matuska.Xr zfs 8
168