Re: Strange ZFS filesystem corruption

From: Olivier Smedts <olivier_at_gid0.org>
Date: Tue, 4 Oct 2011 18:09:12 +0200
2011/10/3 Paul Mather <paul_at_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 destroying the pool, creating a new one, and restoring from backup?  Is there some way of exporting and re-importing the pool that has the side-effect of doing 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 '_at_'
    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 (-AAA)
        -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 verbose
Default is to dump everything non-verbosely

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

  "Il y a seulement 10 sortes de gens dans le monde :
  ceux qui comprennent le binaire,
  et ceux qui ne le comprennent pas."
Received on Tue Oct 04 2011 - 14:09:13 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:18 UTC