ZFS: How to fsck or check filesystem integrity with scrub

Contributor Icon Contributed by qmchenry  
Tag Icon Tagged: Solaris system administration  

ZFS will change the way UNIX people think about filesystems. How do you use fsck with a ZFS filesystem? You don’t. ZFS filesystems are always clean so even in the worst case of a power outage bringing a system down, you’ll never be asked to give the root password for system maintenance again. With ZFS, data are always consistent on disk. For you worriers, there is a command you can use to make sure everything is okay with your filesystems.


Unlike of the fsck command which had to be run on an unmounted filesystem (read: downtime), the zpool command has a scrub option which works on a mounted, living filesystem. When run, the command checks all data in the pool for checksum consistency. On redundant systems (raidz or mirror), inconsistencies will be repaired.

To scrub the pool techrx:

zpool scrub techrx

The command creates lots of IO, so use judiciously. Only one scrub session is permitted at a time. To stop scrubbing a pool, use the -s option:

zpool scrub -s techrx

 

1 Comment -


  1. Spamx said on January 5, 2011

    thanks – very useful!

 

RSS feed for comments on this post. TrackBack URL

Leave a comment -