From owner-freebsd-scsi Sun Mar 5 14:15:47 2000 Delivered-To: freebsd-scsi@freebsd.org Received: from funkthat.com (adsl-63-195-54-213.dsl.snfc21.pacbell.net [63.195.54.213]) by hub.freebsd.org (Postfix) with ESMTP id CBE7637BB2D; Sun, 5 Mar 2000 14:15:41 -0800 (PST) (envelope-from gurney_j@efn.org) Received: (from jmg@localhost) by funkthat.com (8.9.3/8.8.7) id OAA56560; Sun, 5 Mar 2000 14:15:20 -0800 (PST) Message-ID: <20000305141520.52809@hydrogen.funkthat.com> Date: Sun, 5 Mar 2000 14:15:20 -0800 From: John-Mark Gurney To: "Matthew N. Dodd" Cc: Lauri Laupmaa , scsi@FreeBSD.ORG, current@FreeBSD.ORG Subject: Re: plist/glist query & proposal References: <20000305112658.59344@hydrogen.funkthat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.69 In-Reply-To: ; from Matthew N. Dodd on Sun, Mar 05, 2000 at 04:49:16PM -0500 Reply-To: John-Mark Gurney Organization: Cu Networking X-Operating-System: FreeBSD 3.4-RELEASE i386 X-PGP-Fingerprint: B7 EC EF F8 AE ED A7 31 96 7A 22 B3 D8 56 36 F4 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ Sender: owner-freebsd-scsi@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org make sure to keep me on the cc list, I'm not on -current or -scsi Matthew N. Dodd scribbled this message on Mar 5: > 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. yeh, I originally was using block for a while, and ONE of my drives didn't support it, then I switched to phys, and haven't had a problem.. and I have quite a range of drives: hydrogen,ttyq3,~,502$grep 'Direct Access' /var/run/dmesg.boot da3: Fixed Direct Access SCSI-CCS device da0: Fixed Direct Access SCSI-2 device da5: Fixed Direct Access SCSI-CCS device da6: Fixed Direct Access SCSI-CCS device da2: Fixed Direct Access SCSI-2 device da1: Fixed Direct Access SCSI-2 device da4: Fixed Direct Access SCSI-2 device which is a selection of scsi-1 (scsi-ccs), fast scsi, and ultra scsi drives... I'm sure that just using phys will keep all drives usable.. and if the user wants a different format, they can manually run camcontrol... bad disk blocks SHOULDN'T appear that often... :) > # > # /etc/glist.conf > # > # Drive name Format (block, bfi, phys) > da0 phys > da1 block > ... something like: `awk '$1 ~ /(da|sd)'"${i}"'/ { type = $2 } END { if (type == "" ) echo "phys"; else echo type; }'` should do perfectly fine... :) > > 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 -- John-Mark Gurney Voice: +1 408 975 9651 Cu Networking "The soul contains in itself the event that shall presently befall it. The event is only the actualizing of its thought." -- Ralph Waldo Emerson To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-scsi" in the body of the message