On Tue, 6 Jul 2010, Roy Sigurd Karlsbakk wrote:

Hi all

With several messages in here about troublesome zpools, would there be a good reason to be able to fsck a pool? As in, check the whole thing instead of having to boot into live CDs and whatnot?

You can do this with "zpool scrub". It visits every allocated block and verifies that everything is correct. It's not the same as fsck in that scrub can detect and repair problems with the pool still online and all datasets mounted, whereas fsck cannot handle mounted filesystems.

If you really want to use it on an exported pool, you can use zdb, although it might take some time. Here's an example on a small empty pool:

# zpool create -f mypool raidz c4t1d0s0 c4t2d0s0 c4t3d0s0 c4t4d0s0 c4t5d0s0
# zpool list mypool
NAME     SIZE  ALLOC   FREE    CAP  DEDUP  HEALTH  ALTROOT
mypool   484M   280K   484M     0%  1.00x  ONLINE  -
# zpool export mypool
# zdb -ebcc mypool

Traversing all blocks to verify checksums and verify nothing leaked ...

        No leaks (block sum matches space maps exactly)

        bp count:              48
        bp logical:        378368      avg:   7882
        bp physical:        39424      avg:    821     compression:   9.60
        bp allocated:      185344      avg:   3861     compression:   2.04
        bp deduped:             0    ref>1:      0   deduplication:   1.00
        SPA allocated:     185344     used:  0.04%

#
_______________________________________________
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss

Reply via email to