Do we want a periodic script for a zfs scrub?
Bernd Walter
ticso at cicely7.cicely.de
Wed Jun 9 15:10:30 UTC 2010
On Wed, Jun 09, 2010 at 04:26:27PM +0200, 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?
For me scrub'ing takes several days without having a special big
pool size and starting another scrub restarts everything.
You should at least check if another one is still running.
I think resilvering is also a collision case to check for.
> 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---
--
B.Walter <bernd at bwct.de> http://www.bwct.de
Modbus/TCP Ethernet I/O Baugruppen, ARM basierte FreeBSD Rechner uvm.
More information about the freebsd-fs
mailing list