Date: Sun, 5 Mar 2000 14:15:20 -0800 From: John-Mark Gurney <gurney_j@efn.org> To: "Matthew N. Dodd" <winter@jurai.net> Cc: Lauri Laupmaa <mauri@inspiral.net>, scsi@FreeBSD.ORG, current@FreeBSD.ORG Subject: Re: plist/glist query & proposal Message-ID: <20000305141520.52809@hydrogen.funkthat.com> In-Reply-To: <Pine.BSF.4.21.0003051646000.690-100000@sasami.jurai.net>; from Matthew N. Dodd on Sun, Mar 05, 2000 at 04:49:16PM -0500 References: <20000305112658.59344@hydrogen.funkthat.com> <Pine.BSF.4.21.0003051646000.690-100000@sasami.jurai.net>
next in thread | previous in thread | raw e-mail | index | archive | help
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: <FUJITSU M2654S-512 010O> Fixed Direct Access SCSI-CCS device
da0: <MICROP 4421-07 0329SJ 0329> Fixed Direct Access SCSI-2 device
da5: <IMPRIMIS 94601-15 4614> Fixed Direct Access SCSI-CCS device
da6: <FUJITSU M2654S-512 010O> Fixed Direct Access SCSI-CCS device
da2: <SAMSUNG WN32162U 0100> Fixed Direct Access SCSI-2 device
da1: <MICROP 4743 S150> Fixed Direct Access SCSI-2 device
da4: <MICROP 4743 S150> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000305141520.52809>
