From owner-freebsd-fs@FreeBSD.ORG Thu Jun 10 09:32:49 2010 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A591B1065673 for ; Thu, 10 Jun 2010 09:32:49 +0000 (UTC) (envelope-from admin@kkip.pl) Received: from mainframe.kkip.pl (kkip.pl [87.105.164.78]) by mx1.freebsd.org (Postfix) with ESMTP id 15E898FC16 for ; Thu, 10 Jun 2010 09:32:48 +0000 (UTC) Received: from static-78-8-144-74.ssp.dialog.net.pl ([78.8.144.74] helo=[192.168.0.2]) by mainframe.kkip.pl with esmtpsa (TLSv1:CAMELLIA256-SHA:256) (Exim 4.71 (FreeBSD)) (envelope-from ) id 1OMe7s-000Kho-9n for freebsd-fs@freebsd.org; Thu, 10 Jun 2010 11:32:47 +0200 Message-ID: <4C10B136.3030404@kkip.pl> Date: Thu, 10 Jun 2010 11:32:38 +0200 From: Bartosz Stec User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1.9) Gecko/20100406 Shredder/3.0.4 MIME-Version: 1.0 To: freebsd-fs@freebsd.org References: <20100609162627.11355zjzwnf7nj8k@webmail.leidinger.net> In-Reply-To: <20100609162627.11355zjzwnf7nj8k@webmail.leidinger.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Authenticated-User: admin@kkip.pl X-Authenticator: plain X-Sender-Verify: SUCCEEDED (sender exists & accepts mail) X-Spam-Score: -8.1 X-Spam-Score-Int: -80 X-Exim-Version: 4.71 (build at 02-Feb-2010 20:10:28) X-Date: 2010-06-10 11:32:47 X-Connected-IP: 78.8.144.74:63299 X-Message-Linecount: 58 X-Body-Linecount: 46 X-Message-Size: 1943 X-Body-Size: 1400 X-Received-Count: 1 X-Recipient-Count: 1 X-Local-Recipient-Count: 1 X-Local-Recipient-Defer-Count: 0 X-Local-Recipient-Fail-Count: 0 Subject: Re: Do we want a periodic script for a zfs scrub? X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2010 09:32:49 -0000 On 2010-06-09 16:26, Alexander Leidinger wrote: > Hi, > > I noticed that we do not have an automatism to scrub a ZFS pool > periodically. Is there interest in something like this, or shall I > keep it local? > > Here's the main part of the monthly periodic script I quickly created: > ---snip--- > case "$monthly_scrub_zfs_enable" in > [Yy][Ee][Ss]) > echo > echo 'Scrubbing of zfs pools:' > > if [ -z "${monthly_scrub_zfs_pools}" ]; then > monthly_scrub_zfs_pools="$(zpool list -H -o name)" > fi > > for pool in ${monthly_scrub_zfs_pools}; do > # successful only if there is at least one pool to scrub > rc=0 > > echo " starting scrubbing of pool '${pool}'" > zpool scrub ${pool} > echo " consult 'zpool status ${pool}' for the > result" > echo " or wait for the daily_status_zfs mail, if > enabled" > done > ;; > ---snip--- > > Bye, > Alexander. > Ross-at-neces-dot-com already did what you're searching for. I'm using his periodic scripts for some months now, check here: http://www.neces.com/blog/technology/integrating-freebsd-zfs-and-periodic-snapshots-and-scrubs. They're doing all necessary stuff, like checking for scrub in progress too. Hope you'll find them helpful. Cheers :) -- Bartosz Stec