Date: Wed, 09 Jun 2010 11:07:22 -0400 From: jhell <jhell@dataix.net> To: Alexander Leidinger <Alexander@Leidinger.net> Cc: fs@freebsd.org Subject: Re: Do we want a periodic script for a zfs scrub? Message-ID: <4C0FAE2A.7050103@dataix.net> In-Reply-To: <20100609162627.11355zjzwnf7nj8k@webmail.leidinger.net> References: <20100609162627.11355zjzwnf7nj8k@webmail.leidinger.net>
next in thread | previous in thread | raw e-mail | index | archive | help
On 06/09/2010 10: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.
>
Please add a check to see if any resilerving is being done on the pool
that the scub is being executed on. (Just in case), I would hope that
the scrub would fail silently in this case.
Please also check whether a scrub is already running on one of the pools
and if so & another pool exists start a background loop to wait for the
first scrub to finish or die silently.
I had a scrub fully restart from calling scrub a second time after being
more than 50% complete, its frustrating.
Thanks!,
--
jhell
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4C0FAE2A.7050103>
