From owner-freebsd-scsi Sun Mar 5 13:49:34 2000 Delivered-To: freebsd-scsi@freebsd.org Received: from sasami.jurai.net (sasami.jurai.net [63.67.141.99]) by hub.freebsd.org (Postfix) with ESMTP id 7590F37BB8C; Sun, 5 Mar 2000 13:49:27 -0800 (PST) (envelope-from winter@jurai.net) Received: from localhost (winter@localhost) by sasami.jurai.net (8.9.3/8.8.7) with ESMTP id QAA87475; Sun, 5 Mar 2000 16:49:16 -0500 (EST) Date: Sun, 5 Mar 2000 16:49:16 -0500 (EST) From: "Matthew N. Dodd" To: John-Mark Gurney Cc: Lauri Laupmaa , scsi@FreeBSD.ORG, current@FreeBSD.ORG Subject: Re: plist/glist query & proposal In-Reply-To: <20000305112658.59344@hydrogen.funkthat.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-scsi@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org On Sun, 5 Mar 2000, John-Mark Gurney wrote: > Doug White forwarded this message to me.... I actually have done this > but I have not cleaned the code up for committing to the tree... > > I have been running this code for over a half year now... > > if people want, I can comitte this as is, but I'm using old daily > routines on my box, not the newer ones... I like it, though you may want to have an /etc/glist.conf and let the user add stuff with a script that tests to make sure a drive supports the format. A script to test and populate this file wouldn't be difficult. # # /etc/glist.conf # # Drive name Format (block, bfi, phys) da0 phys da1 block ... > bak=/var/backups > echo "" > echo "" > echo "checking disks for defects:" > for i in `camcontrol devlist | awk '/(da|sd)/ { if (match($0, "(da|sd)[[:digit:]]+") != 0) { diskname = substr($0, RSTART, RLENGTH); match(diskname, "[[:digit:]]+"); print substr(diskname, RSTART, RLENGTH) } }' | sort -u`; do > if [ -f ${bak}/da${i}.glist ]; then > mv ${bak}/da${i}.glist ${bak}/da${i}.glist.bak > fi > echo -n "da${i}: " > camcontrol defects -u $i -f phys -G 2>&1 > ${bak}/da${i}.glist > if [ -f ${bak}/da${i}.glist.bak ]; then > if ! cmp -s ${bak}/da${i}.glist ${bak}/da${i}.glist.bak; then > diff ${bak}/da${i}.glist.bak ${bak}/da${i}.glist > fi > fi > done > > -- | Matthew N. Dodd | '78 Datsun 280Z | '75 Volvo 164E | FreeBSD/NetBSD | | winter@jurai.net | 2 x '84 Volvo 245DL | ix86,sparc,pmax | | http://www.jurai.net/~winter | This Space For Rent | ISO8802.5 4ever | To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-scsi" in the body of the message