Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 4 Oct 2011 18:09:12 +0200
From:      Olivier Smedts <olivier@gid0.org>
To:        Paul Mather <paul@gromit.dlib.vt.edu>
Cc:        freebsd-current@freebsd.org
Subject:   Re: Strange ZFS filesystem corruption
Message-ID:  <CABzXLYOsXWxR8u2RvuVekQ4%2BgwPQKT6C1dSasQoAUdGY0VBMjQ@mail.gmail.com>
In-Reply-To: <8B59D754-9062-4499-9873-7C2167622032@gromit.dlib.vt.edu>
References:  <8B59D754-9062-4499-9873-7C2167622032@gromit.dlib.vt.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
2011/10/3 Paul Mather <paul@gromit.dlib.vt.edu>:
> I know ZFS does not have a fsck utility ("because it doesn't need one":),=
 but does anyone know of any way of fixing this corruption short of destroy=
ing the pool, creating a new one, and restoring from backup? =A0Is there so=
me way of exporting and re-importing the pool that has the side-effect of d=
oing some kind of fsck-like repairing of subtle corruption like this?

But there is the ZFS debugger, "zdb" !

I can't really help you with that because I never had a corrupted
zpool, but if you search on the lists for up to a year or so, you'll
find some useful commands to inspect and destroy corrupted objects.


Usage: zdb [-CumdibcsDvhL] poolname [object...]
       zdb [-div] dataset [object...]
       zdb -m [-L] poolname [vdev [metaslab...]]
       zdb -R poolname vdev:offset:size[:flags]
       zdb -S poolname
       zdb -l [-u] device
       zdb -C

    Dataset name must include at least one separator character '/' or '@'
    If dataset name is specified, only that dataset is dumped
    If object numbers are specified, only those objects are dumped

    Options to control amount of output:
        -u uberblock
        -d dataset(s)
        -i intent logs
        -C config (or cachefile if alone)
        -h pool history
        -b block statistics
        -m metaslabs
        -c checksum all metadata (twice for all data) blocks
        -s report stats on zdb's I/O
        -D dedup statistics
        -S simulate dedup to measure effect
        -v verbose (applies to all others)
        -l dump label contents
        -L disable leak tracking (do not load spacemaps)
        -R read and display block from a device

    Below options are intended for use with other options (except -l):
        -A ignore assertions (-A), enable panic recovery (-AA) or both (-AA=
A)
        -F attempt automatic rewind within safe range of transaction groups
        -U <cachefile_path> -- use alternate cachefile
        -X attempt extreme rewind (does not work with dataset)
        -e pool is exported/destroyed/has altroot/not in a cachefile
        -p <path> -- use one or more with -e to specify path to vdev dir
        -P print numbers parsable
        -t <txg> -- highest txg to use when searching for uberblocks
Specify an option more than once (e.g. -bb) to make only that option verbos=
e
Default is to dump everything non-verbosely

--=20
Olivier Smedts=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=A0 _
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 ASCII ribbon campaign ( )
e-mail: olivier@gid0.org=A0 =A0 =A0 =A0 - against HTML email & vCards=A0 X
www: http://www.gid0.org=A0 =A0 - against proprietary attachments / \

=A0 "Il y a seulement 10 sortes de gens dans le monde :
=A0 ceux qui comprennent le binaire,
=A0 et ceux qui ne le comprennent pas."



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CABzXLYOsXWxR8u2RvuVekQ4%2BgwPQKT6C1dSasQoAUdGY0VBMjQ>