FreeBSD src
Go to file
Olaf Faaland 3c9e0d673e Dump unique configurations and Uberblocks in zdb -lu
For zdb -l, detect when the configuration nvlist in some label l (l>0)
is the same as a configuration already dumped.  If so, do not dump it.

Make a similar check when dumping Uberblocks for zdb -lu.  Check whether
a label already dumped contains an identical Uberblock.  If so, do not
dump the Uberblock.

When dumping a configuration or Uberblock, state which labels it is
found in (0-3), for example: labels = 1 2 3

Detecting redundant uberblocks or configurations is accomplished by
calculating checksums of the uberblocks and the packed nvlists
containing the configuration.

If there is nothing unique to be dumped for a label (ie the
configuration and uberblocks have checksums matching those already
dumped) print nothing for that label.

With additional l's or u's, increase verbosity as follows:

-l      Dump each unique configuration only once.
        Indicate which labels it appears in.
-ll     In addition, dump label space usage stats.
-lll    Dump every configuration, unique or not.

-u      Dump each unique, valid, uberblock only once.
        Indicate which labels it appears in.
-uu     In addition, state which slots are invalid.
-uuu    Dump every uberblock, unique or not.
-uuuu   Dump the uberblock blockpointer (used to be -uuu)

Make exit values conform to the manual page.  Failing to unpack a
configuration nvlist is considered an error, as well as failing to open
or read from the device.

Add three tests, zdb_00{3,4,5}_pos to verify the above functionality.

An example of the output:
	------------------------------------
	LABEL 0
	------------------------------------
	    version: 5000
	    name: 'pool'
	    state: 1
	    txg: 880
	    < ... redacted ... >
	    features_for_read:
		com.delphix:hole_birth
		com.delphix:embedded_data
	    labels = 0
	    Uberblock[0]
		magic = 0000000000bab10c
		version = 5000
		txg = 0
		guid_sum = 3038694082047428541
		timestamp = 1487715500 UTC = Tue Feb 21 14:18:20 2017
		labels = 0 1 2 3
	    Uberblock[4]
		magic = 0000000000bab10c
		version = 5000
		txg = 772
		guid_sum = 9045970794941528051
		timestamp = 1487727291 UTC = Tue Feb 21 17:34:51 2017
		labels = 0
	    < ... redacted ... >
	------------------------------------
	LABEL 1
	------------------------------------
	    version: 5000
	    name: 'pool'
	    state: 1
	    txg: 14
	    < ... redacted ... >
		com.delphix:embedded_data
	    labels = 1 2 3
	    Uberblock[4]
		magic = 0000000000bab10c
		version = 5000
		txg = 4
		guid_sum = 7793930272573252584
		timestamp = 1487727521 UTC = Tue Feb 21 17:38:41 2017
		labels = 1 2 3
	    < ... redacted ... >

Reviewed-by: Tim Chase <tim@chase2k.com>
Reviewed-by: Don Brady <don.brady@intel.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Olaf Faaland <faaland1@llnl.gov>
Closes #5738
2017-03-06 16:01:45 -08:00
.github Further work on Github usability (issue templates) 2017-01-03 15:01:48 -06:00
cmd Dump unique configurations and Uberblocks in zdb -lu 2017-03-06 16:01:45 -08:00
config Fix loop device becomes read-only 2017-03-06 09:20:20 -08:00
contrib Fix initramfs hook for merged /usr/lib and /lib 2017-02-27 12:03:23 -08:00
etc Fix zfs-mount.service failure on boot 2017-02-08 10:17:29 -08:00
include Linux 4.11 compat: avoid refcount_t name conflict 2017-02-28 16:10:18 -08:00
lib Fix powerpc build 2017-03-06 09:17:24 -08:00
man Dump unique configurations and Uberblocks in zdb -lu 2017-03-06 16:01:45 -08:00
module Fix loop device becomes read-only 2017-03-06 09:20:20 -08:00
rpm Fix powerpc build 2017-03-06 09:17:24 -08:00
scripts Bug fixes for single test runs in zfs-tests 2017-02-28 18:02:48 -08:00
tests Dump unique configurations and Uberblocks in zdb -lu 2017-03-06 16:01:45 -08:00
udev Fix spelling 2017-01-03 11:31:18 -06:00
.gitignore Update .gitignore 2016-10-19 14:29:33 -07:00
.gitmodules Add zimport.sh compatibility test script 2014-02-21 12:10:31 -08:00
AUTHORS Add a missing > to AUTHORS 2014-09-02 14:18:53 -07:00
autogen.sh build: do not call boilerplate ourself 2013-04-02 10:55:20 -07:00
configure.ac Add auto-online test for ZED/FMA as part of the ZTS 2017-02-28 16:25:39 -08:00
copy-builtin Illumos Crypto Port module added to enable native encryption in zfs 2016-07-20 10:43:30 -07:00
COPYRIGHT Update ZED copyright boilerplate 2015-05-11 15:07:00 -07:00
DISCLAIMER Fix minor typos and update marketing copy. 2013-03-21 12:51:06 -07:00
Makefile.am Use cstyle -cpP in make cstyle check 2016-12-12 10:46:26 -08:00
META Tag 0.7.0-rc3 2017-01-20 10:18:28 -08:00
OPENSOLARIS.LICENSE Add CDDL license file 2008-12-01 14:49:34 -08:00
README.markdown Add CONTRIBUTING information and templates 2016-12-09 12:48:12 -07:00
TEST Move ziltest.sh to the ZTS framework 2017-02-08 17:28:22 -08:00
zfs-script-config.sh.in Add auto-online test for ZED/FMA as part of the ZTS 2017-02-28 16:25:39 -08:00
zfs.release.in Move zfs.release generation to configure step 2012-07-12 12:22:51 -07:00

ZFS is an advanced file system and volume manager which was originally developed for Solaris and is now maintained by the Illumos community.

ZFS on Linux, which is also known as ZoL, is currently feature complete. It includes fully functional and stable SPA, DMU, ZVOL, and ZPL layers. And it's native!

Official Resources

Installation

Full documentation for installing ZoL on your favorite Linux distribution can be found at our site.

Contribute & Develop

We have a separate document with contribution guidelines.