From owner-freebsd-questions Sat Jan 12 4:27:25 2002 Delivered-To: freebsd-questions@freebsd.org Received: from guru.mired.org (okc-65-31-201-166.mmcable.com [65.31.201.166]) by hub.freebsd.org (Postfix) with SMTP id F31A737B416 for ; Sat, 12 Jan 2002 04:27:21 -0800 (PST) Received: (qmail 62684 invoked by uid 100); 12 Jan 2002 12:27:21 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15424.11176.884166.718970@guru.mired.org> Date: Sat, 12 Jan 2002 06:27:20 -0600 To: Giuseppe Pagnoni Cc: questions@freebsd.org Subject: Re: how to disable write cache? In-Reply-To: <97955644@toto.iv> X-Mailer: VM 6.90 under 21.1 (patch 14) "Cuyahoga Valley" XEmacs Lucid X-face: "5Mnwy%?j>IIV\)A=):rjWL~NB2aH[}Yq8Z=u~vJ`"(,&SiLvbbz2W`;h9L,Yg`+vb1>RG% *h+%X^n0EZd>TM8_IB;a8F?(Fb"lw'IgCoyM.[Lg#r\ From: "Mike Meyer" X-Delivery-Agent: TMDA/0.43 (Python 2.2; freebsd-4.4-STABLE-i386) Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Giuseppe Pagnoni types: > Hi > > I have erratic problems with a Seagate SCSI driver and browsing through > the lists I came to understand that this might be related to the write > caching turned on or a bad firmware. I was unable to find a new firmware > from the seagate site and I couldn't find a way to turn off write > caching via the SCSI controller setup either(no related options there). > I found this alternative suggestion on the list: > > > Run this: > > > > EDITOR="/usr/bin/perl -i -pe 's/1/0/g if /^WCE/'" \ > > camcontrol modepage da0 -P 3 -m 8 > > > > do this for all your drives which have bad firmware. > > but... clearly EDITOR is not a command, so i guess i am missing > something here. Actually, EDITOR is a command - complete with arguments. But the camcontrol command is missing a "-e" argument to cause it to invoke the editor. > Could somebody explain me (in simpler terms) how can i disable write > caching for my two SCSI disks (da0 and da1) permanently in FreeBSD 4.4R? Just run the "camcontrol modepage da0 -P 3 -m 8 -e" as root. It should dump you into an editor with a bunch of lines that look like "name: value". Find the one that has the name "WCE:". If it's 0, write caching is already off. If it's 1, change it to 0, save the file and exit. The command given above sets the EDITOR environment variable to a perl script that would automate the search and change process. http://www.mired.org/home/mwm/ Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message