ZFS: How to fsck or check filesystem integrity with scrub

Home -> UNIX -> Solaris -> System administration

8297 views

From the computer of: qmchenry (339 recipes)
Created: Jun 03, 2006


Add a comment

Add to:
Add to stumbleuponAdd to del.icio.usDigg itAdd to FURL

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

Subscribe to the Tech-Recipes Newsletter

You can get tips like this delivered in your email every week!

Enter your Email

We will never, ever sell your email address or spam you.





Related recipes:

  Automatically answer yes to all fsck questions
  Check filesystem integrity
  Solaris: Mount filesystem with UFS logging enabled
  Solaris: unmounting a filesystem with umount
  Solaris: disk usage of all users on a filesystem
  ZFS: Set or change the mount point of a filesystem
  ZFS: Ten reasons to reformat your hard drives
  ZFS: Destroy or remove one or more filesystems
  ZFS: Create a writable clone of a filesystem
  ZFS: Enable filesystem compression

 

Sponsored links

 

Login

Nickname

Password

Don't have an account yet? You can create one. As a registered user you have some advantages like theme manager, comments configuration and post comments with your name.