diff options
author | buzzingwires <[email protected]> | 2023-05-03 12:03:57 -0400 |
---|---|---|
committer | GitHub <[email protected]> | 2023-05-03 09:03:57 -0700 |
commit | a46001adb9b143eebf43cd7ca4b508c044f80f00 (patch) | |
tree | 0629951afbd2503d7f4f337d3250f645b3e7cf45 /man | |
parent | 9de5300c7fc0ff944e02d5d1a1ae5742234930e0 (diff) |
Allow zhack label repair to restore detached devices.
This commit expands on the zhack label repair command in d04b5c9 by
adding the -u option to undetach a device by regenerating uberblocks,
in addition to the existing functionality of fixing checksums, now
represented by -c. Previous behavior is retained in the case of no
options.
The changes are heavily inspired by Jeff Bonwick's labelfix
utility, as archived at:
https://gist.github.com/jjwhitney/baaa63144da89726e482
Additionally, it is now capable of properly determining the size of
block devices and other media, as well as handling sizes which are
not divisible by 2^18. This should make it viable for use on physical
devices and partitions, in addition to files.
These changes should make it possible to import zpools that have had
their uberblocks erased, such as in the case of pools rendered
inaccessible by erroneous detach commands.
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: buzzingwires <[email protected]>
Closes #14773
Diffstat (limited to 'man')
-rw-r--r-- | man/man1/zhack.1 | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/man/man1/zhack.1 b/man/man1/zhack.1 index 26b8156b4..937f1e916 100644 --- a/man/man1/zhack.1 +++ b/man/man1/zhack.1 @@ -98,10 +98,29 @@ feature is now required to read the pool MOS. .It Xo .Nm zhack .Cm label repair +.Op Fl cu .Ar device .Xc -Repair corrupted labels by rewriting the checksum using the presumed valid -contents of the label. +Repair labels of a specified +.Ar device +according to options. +.Pp +Flags may be combined to do their functions simultaneously. +. +.Pp +The +.Fl c +flag repairs corrupted label checksums +. +.Pp +The +.Fl u +flag restores the label on a detached device +.Pp +Example: +.Nm zhack Cm label repair Fl cu Ar device + Fix checksums and undetach a device +. .El . .Sh GLOBAL OPTIONS |