Print this page
    
10592 misc. metaslab and vdev related ZoL bug fixes
Portions contributed by: Jerry Jelinek <jerry.jelinek@joyent.com>
Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed by: Giuseppe Di Natale <guss80@gmail.com>
Reviewed by: George Melikov <mail@gmelikov.ru>
Reviewed by: Paul Dagnelie <pcd@delphix.com>
Reviewed by: Matt Ahrens <mahrens@delphix.com>
Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Reviewed by: Tony Hutter <hutter2@llnl.gov>
Reviewed by: Kody Kantor <kody.kantor@joyent.com>
Approved by: Dan McDonald <danmcd@joyent.com>
    
      
        | Split | 
	Close | 
      
      | Expand all | 
      | Collapse all | 
    
    
          --- old/usr/src/man/man1m/zdb.1m
          +++ new/usr/src/man/man1m/zdb.1m
   1    1  .\"
   2    2  .\" This file and its contents are supplied under the terms of the
  
    | 
      ↓ open down ↓ | 
    2 lines elided | 
    
      ↑ open up ↑ | 
  
   3    3  .\" Common Development and Distribution License ("CDDL"), version 1.0.
   4    4  .\" You may only use this file in accordance with the terms of version
   5    5  .\" 1.0 of the CDDL.
   6    6  .\"
   7    7  .\" A full copy of the text of the CDDL should have accompanied this
   8    8  .\" source.  A copy of the CDDL is also available via the Internet at
   9    9  .\" http://www.illumos.org/license/CDDL.
  10   10  .\"
  11   11  .\"
  12   12  .\" Copyright 2012, Richard Lowe.
  13      -.\" Copyright (c) 2012, 2017 by Delphix. All rights reserved.
       13 +.\" Copyright (c) 2012, 2018 by Delphix. All rights reserved.
  14   14  .\" Copyright 2017 Nexenta Systems, Inc.
  15   15  .\"
  16   16  .Dd April 14, 2017
  17   17  .Dt ZDB 1M
  18   18  .Os
  19   19  .Sh NAME
  20   20  .Nm zdb
  21   21  .Nd display zpool debugging and consistency information
  22   22  .Sh SYNOPSIS
  23   23  .Nm
  24   24  .Op Fl AbcdDFGhikLMPsvX
  25   25  .Op Fl e Oo Fl V Oc Op Fl p Ar path ...
  26   26  .Op Fl I Ar inflight I/Os
  27   27  .Oo Fl o Ar var Ns = Ns Ar value Oc Ns ...
  28   28  .Op Fl t Ar txg
  29   29  .Op Fl U Ar cache
  30   30  .Op Fl x Ar dumpdir
  31   31  .Op Ar poolname Op Ar object ...
  32   32  .Nm
  33   33  .Op Fl AdiPv
  34   34  .Op Fl e Oo Fl V Oc Op Fl p Ar path ...
  35   35  .Op Fl U Ar cache
  36   36  .Ar dataset Op Ar object ...
  37   37  .Nm
  38   38  .Fl C
  39   39  .Op Fl A
  40   40  .Op Fl U Ar cache
  41   41  .Nm
  42   42  .Fl E
  43   43  .Op Fl A
  44   44  .Ar word0 Ns \&: Ns Ar word1 Ns :...: Ns Ar word15
  45   45  .Nm
  46   46  .Fl l
  47   47  .Op Fl Aqu
  48   48  .Ar device
  49   49  .Nm
  50   50  .Fl m
  51   51  .Op Fl AFLPX
  52   52  .Op Fl e Oo Fl V Oc Op Fl p Ar path ...
  53   53  .Op Fl t Ar txg
  54   54  .Op Fl U Ar cache
  55   55  .Ar poolname Op Ar vdev Op Ar metaslab ...
  56   56  .Nm
  57   57  .Fl O
  58   58  .Ar dataset path
  59   59  .Nm
  60   60  .Fl R
  61   61  .Op Fl A
  62   62  .Op Fl e Oo Fl V Oc Op Fl p Ar path ...
  63   63  .Op Fl U Ar cache
  64   64  .Ar poolname vdev Ns \&: Ns Ar offset Ns \&: Ns Ar size Ns Op : Ns Ar flags
  65   65  .Nm
  66   66  .Fl S
  67   67  .Op Fl AP
  68   68  .Op Fl e Oo Fl V Oc Op Fl p Ar path ...
  69   69  .Op Fl U Ar cache
  70   70  .Ar poolname
  71   71  .Sh DESCRIPTION
  72   72  The
  73   73  .Nm
  74   74  utility displays information about a ZFS pool useful for debugging and performs
  75   75  some amount of consistency checking.
  76   76  It is a not a general purpose tool and options
  77   77  .Pq and facilities
  78   78  may change.
  79   79  This is neither a
  80   80  .Xr fsck 1M
  81   81  nor an
  82   82  .Xr fsdb 1M
  83   83  utility.
  84   84  .Pp
  85   85  The output of this command in general reflects the on-disk structure of a ZFS
  86   86  pool, and is inherently unstable.
  87   87  The precise output of most invocations is not documented, a knowledge of ZFS
  88   88  internals is assumed.
  89   89  .Pp
  90   90  If the
  91   91  .Ar dataset
  92   92  argument does not contain any
  93   93  .Qq Sy /
  94   94  or
  95   95  .Qq Sy @
  96   96  characters, it is interpreted as a pool name.
  97   97  The root dataset can be specified as
  98   98  .Ar pool Ns /
  99   99  .Pq pool name followed by a slash .
 100  100  .Pp
 101  101  When operating on an imported and active pool it is possible, though unlikely,
 102  102  that zdb may interpret inconsistent pool data and behave erratically.
 103  103  .Sh OPTIONS
 104  104  Display options:
 105  105  .Bl -tag -width Ds
 106  106  .It Fl b
 107  107  Display statistics regarding the number, size
 108  108  .Pq logical, physical and allocated
 109  109  and deduplication of blocks.
 110  110  .It Fl c
 111  111  Verify the checksum of all metadata blocks while printing block statistics
 112  112  .Po see
 113  113  .Fl b
 114  114  .Pc .
 115  115  .Pp
 116  116  If specified multiple times, verify the checksums of all blocks.
 117  117  .It Fl C
 118  118  Display information about the configuration.
 119  119  If specified with no other options, instead display information about the cache
 120  120  file
 121  121  .Pq Pa /etc/zfs/zpool.cache .
 122  122  To specify the cache file to display, see
 123  123  .Fl U .
 124  124  .Pp
 125  125  If specified multiple times, and a pool name is also specified display both the
 126  126  cached configuration and the on-disk configuration.
 127  127  If specified multiple times with
 128  128  .Fl e
 129  129  also display the configuration that would be used were the pool to be imported.
 130  130  .It Fl d
 131  131  Display information about datasets.
 132  132  Specified once, displays basic dataset information: ID, create transaction,
 133  133  size, and object count.
 134  134  .Pp
 135  135  If specified multiple times provides greater and greater verbosity.
 136  136  .Pp
 137  137  If object IDs are specified, display information about those specific objects
 138  138  only.
 139  139  .It Fl D
 140  140  Display deduplication statistics, including the deduplication ratio
 141  141  .Pq Sy dedup ,
 142  142  compression ratio
 143  143  .Pq Sy compress ,
 144  144  inflation due to the zfs copies property
 145  145  .Pq Sy copies ,
 146  146  and an overall effective ratio
 147  147  .Pq Sy dedup No * Sy compress No / Sy copies .
 148  148  .It Fl DD
 149  149  Display a histogram of deduplication statistics, showing the allocated
 150  150  .Pq physically present on disk
 151  151  and referenced
 152  152  .Pq logically referenced in the pool
 153  153  block counts and sizes by reference count.
 154  154  .It Fl DDD
 155  155  Display the statistics independently for each deduplication table.
 156  156  .It Fl DDDD
 157  157  Dump the contents of the deduplication tables describing duplicate blocks.
 158  158  .It Fl DDDDD
 159  159  Also dump the contents of the deduplication tables describing unique blocks.
 160  160  .It Fl E Ar word0 Ns \&: Ns Ar word1 Ns :...: Ns Ar word15
 161  161  Decode and display block from an embedded block pointer specified by the
 162  162  .Ar word
 163  163  arguments.
 164  164  .It Fl h
 165  165  Display pool history similar to
 166  166  .Nm zpool Cm history ,
 167  167  but include internal changes, transaction, and dataset information.
 168  168  .It Fl i
 169  169  Display information about intent log
 170  170  .Pq ZIL
 171  171  entries relating to each dataset.
 172  172  If specified multiple times, display counts of each intent log transaction type.
 173  173  .It Fl k
 174  174  Examine the checkpointed state of the pool.
 175  175  Note, the on disk format of the pool is not reverted to the checkpointed state.
 176  176  .It Fl l Ar device
 177  177  Read the vdev labels from the specified device.
 178  178  .Nm Fl l
 179  179  will return 0 if valid label was found, 1 if error occurred, and 2 if no valid
  
    | 
      ↓ open down ↓ | 
    156 lines elided | 
    
      ↑ open up ↑ | 
  
 180  180  labels were found.
 181  181  .Pp
 182  182  If the
 183  183  .Fl q
 184  184  option is also specified, don't print the labels.
 185  185  .Pp
 186  186  If the
 187  187  .Fl u
 188  188  option is also specified, also display the uberblocks on this device.
 189  189  .It Fl L
 190      -Disable leak tracing and the loading of space maps.
      190 +Disable leak detection and the loading of space maps.
 191  191  By default,
 192  192  .Nm
 193  193  verifies that all non-free blocks are referenced, which can be very expensive.
 194  194  .It Fl m
 195  195  Display the offset, spacemap, and free space of each metaslab.
 196  196  .It Fl mm
 197  197  Also display information about the on-disk free space histogram associated with
 198  198  each metaslab.
 199  199  .It Fl mmm
 200  200  Display the maximum contiguous free space, the in-core free space histogram, and
 201  201  the percentage of free space in each space map.
 202  202  .It Fl mmmm
 203  203  Display every spacemap record.
 204  204  .It Fl M
 205  205  Display the offset, spacemap, and free space of each metaslab.
 206  206  .It Fl MM
 207  207  Also display information about the maximum contiguous free space and the
 208  208  percentage of free space in each space map.
 209  209  .It Fl MMM
 210  210  Display every spacemap record.
 211  211  .It Fl O Ar dataset path
 212  212  Look up the specified
 213  213  .Ar path
 214  214  inside of the
 215  215  .Ar dataset
 216  216  and display its metadata and indirect blocks.
 217  217  Specified
 218  218  .Ar path
 219  219  must be relative to the root of
 220  220  .Ar dataset .
 221  221  This option can be combined with
 222  222  .Fl v
 223  223  for increasing verbosity.
 224  224  .It Xo
 225  225  .Fl R Ar poolname vdev Ns \&: Ns Ar offset Ns \&: Ns Ar size Ns Op : Ns Ar flags
 226  226  .Xc
 227  227  Read and display a block from the specified device.
 228  228  By default the block is displayed as a hex dump, but see the description of the
 229  229  .Sy r
 230  230  flag, below.
 231  231  .Pp
 232  232  The block is specified in terms of a colon-separated tuple
 233  233  .Ar vdev
 234  234  .Pq an integer vdev identifier
 235  235  .Ar offset
 236  236  .Pq the offset within the vdev
 237  237  .Ar size
 238  238  .Pq the size of the block to read
 239  239  and, optionally,
 240  240  .Ar flags
 241  241  .Pq a set of flags, described below .
 242  242  .Pp
 243  243  .Bl -tag -compact -width "b offset"
 244  244  .It Sy b Ar offset
 245  245  Print block pointer
 246  246  .It Sy d
 247  247  Decompress the block
 248  248  .It Sy e
 249  249  Byte swap the block
 250  250  .It Sy g
 251  251  Dump gang block header
 252  252  .It Sy i
 253  253  Dump indirect block
 254  254  .It Sy r
 255  255  Dump raw uninterpreted block data
 256  256  .El
 257  257  .It Fl s
 258  258  Report statistics on
 259  259  .Nm zdb
 260  260  I/O.
 261  261  Display operation counts, bandwidth, and error counts of I/O to the pool from
 262  262  .Nm .
 263  263  .It Fl S
 264  264  Simulate the effects of deduplication, constructing a DDT and then display
 265  265  that DDT as with
 266  266  .Fl DD .
 267  267  .It Fl u
 268  268  Display the current uberblock.
 269  269  .El
 270  270  .Pp
 271  271  Other options:
 272  272  .Bl -tag -width Ds
 273  273  .It Fl A
 274  274  Do not abort should any assertion fail.
 275  275  .It Fl AA
 276  276  Enable panic recovery, certain errors which would otherwise be fatal are
 277  277  demoted to warnings.
 278  278  .It Fl AAA
 279  279  Do not abort if asserts fail and also enable panic recovery.
 280  280  .It Fl e Op Fl p Ar path ...
 281  281  Operate on an exported pool, not present in
 282  282  .Pa /etc/zfs/zpool.cache .
 283  283  The
 284  284  .Fl p
 285  285  flag specifies the path under which devices are to be searched.
 286  286  .It Fl x Ar dumpdir
 287  287  All blocks accessed will be copied to files in the specified directory.
 288  288  The blocks will be placed in sparse files whose name is the same as
 289  289  that of the file or device read.
 290  290  .Nm
 291  291  can be then run on the generated files.
 292  292  Note that the
 293  293  .Fl bbc
 294  294  flags are sufficient to access
 295  295  .Pq and thus copy
 296  296  all metadata on the pool.
 297  297  .It Fl F
 298  298  Attempt to make an unreadable pool readable by trying progressively older
 299  299  transactions.
 300  300  .It Fl G
 301  301  Dump the contents of the zfs_dbgmsg buffer before exiting
 302  302  .Nm .
 303  303  zfs_dbgmsg is a buffer used by ZFS to dump advanced debug information.
 304  304  .It Fl I Ar inflight I/Os
 305  305  Limit the number of outstanding checksum I/Os to the specified value.
 306  306  The default value is 200.
 307  307  This option affects the performance of the
 308  308  .Fl c
 309  309  option.
 310  310  .It Fl o Ar var Ns = Ns Ar value ...
 311  311  Set the given global libzpool variable to the provided value.
 312  312  The value must be an unsigned 32-bit integer.
 313  313  Currently only little-endian systems are supported to avoid accidentally setting
 314  314  the high 32 bits of 64-bit variables.
 315  315  .It Fl P
 316  316  Print numbers in an unscaled form more amenable to parsing, eg. 1000000 rather
 317  317  than 1M.
 318  318  .It Fl t Ar transaction
 319  319  Specify the highest transaction to use when searching for uberblocks.
 320  320  See also the
 321  321  .Fl u
 322  322  and
 323  323  .Fl l
 324  324  options for a means to see the available uberblocks and their associated
 325  325  transaction numbers.
 326  326  .It Fl U Ar cachefile
 327  327  Use a cache file other than
 328  328  .Pa /etc/zfs/zpool.cache .
 329  329  .It Fl v
 330  330  Enable verbosity.
 331  331  Specify multiple times for increased verbosity.
 332  332  .It Fl V
 333  333  Attempt verbatim import.
 334  334  This mimics the behavior of the kernel when loading a pool from a cachefile.
 335  335  Only usable with
 336  336  .Fl e .
 337  337  .It Fl X
 338  338  Attempt
 339  339  .Qq extreme
 340  340  transaction rewind, that is attempt the same recovery as
 341  341  .Fl F
 342  342  but read transactions otherwise deemed too old.
 343  343  .El
 344  344  .Pp
 345  345  Specifying a display option more than once enables verbosity for only that
 346  346  option, with more occurrences enabling more verbosity.
 347  347  .Pp
 348  348  If no options are specified, all information about the named pool will be
 349  349  displayed at default verbosity.
 350  350  .Sh EXAMPLES
 351  351  .Bl -tag -width Ds
 352  352  .It Xo
 353  353  .Sy Example 1
 354  354  Display the configuration of imported pool
 355  355  .Pa rpool
 356  356  .Xc
 357  357  .Bd -literal
 358  358  # zdb -C rpool
 359  359  
 360  360  MOS Configuration:
 361  361          version: 28
 362  362          name: 'rpool'
 363  363   ...
 364  364  .Ed
 365  365  .It Xo
 366  366  .Sy Example 2
 367  367  Display basic dataset information about
 368  368  .Pa rpool
 369  369  .Xc
 370  370  .Bd -literal
 371  371  # zdb -d rpool
 372  372  Dataset mos [META], ID 0, cr_txg 4, 26.9M, 1051 objects
 373  373  Dataset rpool/swap [ZVOL], ID 59, cr_txg 356, 486M, 2 objects
 374  374   ...
 375  375  .Ed
 376  376  .It Xo
 377  377  .Sy Example 3
 378  378  Display basic information about object 0 in
 379  379  .Pa rpool/export/home
 380  380  .Xc
 381  381  .Bd -literal
 382  382  # zdb -d rpool/export/home 0
 383  383  Dataset rpool/export/home [ZPL], ID 137, cr_txg 1546, 32K, 8 objects
 384  384  
 385  385      Object  lvl   iblk   dblk  dsize  lsize   %full  type
 386  386           0    7    16K    16K  15.0K    16K   25.00  DMU dnode
 387  387  .Ed
 388  388  .It Xo
 389  389  .Sy Example 4
 390  390  Display the predicted effect of enabling deduplication on
 391  391  .Pa rpool
 392  392  .Xc
 393  393  .Bd -literal
 394  394  # zdb -S rpool
 395  395  Simulated DDT histogram:
 396  396  
 397  397  bucket              allocated                       referenced
 398  398  ______   ______________________________   ______________________________
 399  399  refcnt   blocks   LSIZE   PSIZE   DSIZE   blocks   LSIZE   PSIZE   DSIZE
 400  400  ------   ------   -----   -----   -----   ------   -----   -----   -----
 401  401       1     694K   27.1G   15.0G   15.0G     694K   27.1G   15.0G   15.0G
 402  402       2    35.0K   1.33G    699M    699M    74.7K   2.79G   1.45G   1.45G
 403  403   ...
 404  404  dedup = 1.11, compress = 1.80, copies = 1.00, dedup * compress / copies = 2.00
 405  405  .Ed
 406  406  .El
 407  407  .Sh SEE ALSO
 408  408  .Xr zfs 1M ,
 409  409  .Xr zpool 1M
  
    | 
      ↓ open down ↓ | 
    209 lines elided | 
    
      ↑ open up ↑ | 
  
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX