Monday, September 12, 2011

nexenta / zfs volume scrub

saw that the auto-scrub service on the lab-storage Nexenta box came across some corruption on the syspool volume and wanted to verify it by running the scrub process again. You can do this through the GUI, but that's no fun. Jump to the bash shell and run "zpool scrub [-s] pool ..."

From the man page:
zpool scrub [-s] pool ...

Begins a scrub. The scrub examines all data in the specified pools to verify that it checksums correctly.
For replicated (mirror or raidz) devices, ZFS automatically repairs any damage discovered during the
scrub. The "zpool status" command reports the progress of the scrub and summarizes the results of the
scrub upon completion.

Scrubbing and resilvering are very similar operations. The difference is that resilvering only examines
data that ZFS knows to be out of date (for example, when attaching a new device to a mirror or replacing
an existing device), whereas scrubbing examines all data to discover silent errors due to hardware faults
or disk failure.

Because scrubbing and resilvering are I/O-intensive operations, ZFS only allows one at a time. If a scrub
is already in progress, the "zpool scrub" command terminates it and starts a new scrub. If a resilver is
in progress, ZFS does not allow a scrub to be started until the resilver completes.

-s Stop scrubbing.

zpool status [-xv] [pool] ...

Displays the detailed health status for the given pools. If no pool is specified, then the status of each
pool in the system is displayed. For more information on pool and device health, see the "Device Failure
and Recovery" section.

If a scrub or resilver is in progress, this command reports the percentage done and the estimated time to
completion. Both of these are only approximate, because the amount of data in the pool and the other work-
loads on the system can change.

-x Only display status for pools that are exhibiting errors or are otherwise unavailable.

-v Displays verbose data error information, printing out a complete list of all data errors since the
last complete pool scrub.


Output of the commands:

root@lab-storage:/volumes/volume01/vlab# zpool scrub syspool
root@lab-storage:/volumes/volume01/vlab# zpool status syspool
pool: syspool
state: ONLINE
status: One or more devices has experienced an error resulting in data
corruption. Applications may be affected.
action: Restore the file in question if possible. Otherwise restore the
entire pool from backup.
see: http://www.sun.com/msg/ZFS-8000-8A
scan: scrub in progress since Mon Sep 12 07:04:33 2011
515M scanned out of 4.36G at 51.5M/s, 0h1m to go
0 repaired, 11.52% done
config:

NAME STATE READ WRITE CKSUM
syspool ONLINE 0 0 0
c0t0d0s0 ONLINE 0 0 0

errors: 3 data errors, use '-v' for a list

No comments:

Post a Comment