Add zdb -r <dataset> <object-id | file> <output>

While you can use zdb -R poolname vdev:offset:[<lsize>/]<psize>[:flags] 
to extract individual DVAs from a vdev, it would be handy for be able 
copy an entire file out of the pool.

Given a file or object number, add support to copy the contents to a 
file. Useful for debugging and recovery.

Reviewed-by: Jorgen Lundman <lundman@lundman.net>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Allan Jude <allan@klarasystems.com>
Closes #11027
This commit is contained in:
Allan Jude
2021-01-28 00:36:01 -05:00
committed by GitHub
parent b2c5904a78
commit 393e69241e
7 changed files with 240 additions and 15 deletions
+17 -1
View File
@@ -15,7 +15,7 @@
.\" Copyright (c) 2017 Lawrence Livermore National Security, LLC.
.\" Copyright (c) 2017 Intel Corporation.
.\"
.Dd April 14, 2019
.Dd October 7, 2020
.Dt ZDB 8 SMM
.Os
.Sh NAME
@@ -60,6 +60,9 @@
.Fl O
.Ar dataset path
.Nm
.Fl r
.Ar dataset path destination
.Nm
.Fl R
.Op Fl A
.Op Fl e Oo Fl V Oc Op Fl p Ar path ...
@@ -274,6 +277,19 @@ must be relative to the root of
This option can be combined with
.Fl v
for increasing verbosity.
.It Fl r Ar dataset path destination
Copy the specified
.Ar path
inside of the
.Ar dataset
to the specified destination.
Specified
.Ar path
must be relative to the root of
.Ar dataset .
This option can be combined with
.Fl v
for increasing verbosity.
.It Xo
.Fl R Ar poolname vdev Ns \&: Ns Ar offset Ns \&: Ns Ar [<lsize>/]<psize> Ns Op : Ns Ar flags
.Xc