From owner-freebsd-scsi Mon Sep 13 20:13:38 1999 Delivered-To: freebsd-scsi@freebsd.org Received: from allegro.lemis.com (allegro.lemis.com [192.109.197.134]) by hub.freebsd.org (Postfix) with ESMTP id B82CF14D5D for ; Mon, 13 Sep 1999 20:13:31 -0700 (PDT) (envelope-from grog@freebie.lemis.com) Received: from freebie.lemis.com (freebie.lemis.com [192.109.197.137]) by allegro.lemis.com (8.9.1/8.9.0) with ESMTP id MAA18016; Tue, 14 Sep 1999 12:43:32 +0930 (CST) Received: (from grog@localhost) by freebie.lemis.com (8.9.3/8.9.0) id MAA26341; Tue, 14 Sep 1999 12:43:27 +0930 (CST) Date: Tue, 14 Sep 1999 12:43:27 +0930 From: Greg Lehey To: "Kenneth D. Merry" Cc: Kris Kirby , scsi@FreeBSD.ORG Subject: Re: Reformatting a 520-byte-per-sector drive Message-ID: <19990914124327.E10106@freebie.lemis.com> References: <37D5DF0B.FFF98713@airnet.net> <199909080534.XAA48516@panzer.kdm.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.4i In-Reply-To: <199909080534.XAA48516@panzer.kdm.org>; from Kenneth D. Merry on Tue, Sep 07, 1999 at 11:34:08PM -0600 WWW-Home-Page: http://www.lemis.com/~grog X-PGP-Fingerprint: 6B 7B C3 8C 61 CD 54 AF 13 24 52 F8 6D A4 95 EF Organization: LEMIS, PO Box 460, Echunga SA 5153, Australia Phone: +61-8-8388-8286 Fax: +61-8-8388-8725 Mobile: +61-41-739-7062 Sender: owner-freebsd-scsi@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org On Tuesday, 7 September 1999 at 23:34:08 -0600, Kenneth D. Merry wrote: > Kris Kirby wrote... >> da3 at ahc0 bus 0 target 0 lun 0 >> da3: Fixed Direct Access SCSI-2 device >> da3: 5.000MB/s transfers (5.000MHz, offset 12), Tagged Queueing Enabled >> da3: 957MB (1931265 520 byte sectors: 64H 32S/T 943C) >> >> I want this to be 512 bytes/sector. >> >> I've tried to edit the modepage, but it comes up blank in vi. I'm going >> to guess that that means I can't change any of those parameters. :-) >> IBM's webpage >> on the >> drive says that I can change the number of blocks and the block size >> ("Block descriptor"). However, I don't seem to find anything in >> camcontrol's manpage to indicate how to go about changing it. Make no >> mistake about it, I can read the bytes/sector from modepage 0x03, but I >> can't change them. > > Hmm. Well, there's no option from the camcontrol modepage command to edit > things in the block descriptor. If you want to do that, you'll probably > have to do it with a manual command. (i.e. camcontrol cmd) > > Here's how you can display the mode page header and block descriptor: > > # camcontrol cmd da1 -v -c "1A 0 3 0 c 0" -i 0xc "i1 i1 i1 i1 i1 i3 i1 i3" > 35 0 16 8 1 1052654 0 512 > > The last 3-byte integer is the block size. So, in theory, I suppose you > could change the blocksize by doing something like this: > > # camcontrol cmd da1 -v -c "15 10 0 0 c 0" -o 0xc "b 0 0 8 0 0:i3 0 v:i3" 512 > [ of course you'd substitute "da3" for "da1" above ] > > Hmm, that's remarkably similar to something Greg Lehey told me he had to do > to get a Seagate drive of his to format to a different sector size. Here's > a quote from Greg: > > ======================================================================== > Yup, there's some other way to change it. Set the current values, > then immediately issue a format command: > > # camcontrol cmd da1 -v -c "15 10 0 0 v:i1 0" 12 -o 12 "0 0 0 8 0 0:i3 0 v:i3" 512 > # camcontrol cmd -n da -u 1 -v -t 7200 -c "4 0 0 0 0 0" > # camcontrol modepage da1 -m 3 > Tracks per Zone: 19 > Alternate Sectors per Zone: 12 > Alternate Tracks per Zone: 0 > Alternate Tracks per Logical Unit: 38 > Sectors per Track: 84 > Data Bytes per Physical Sector: 512 > Interleave: 1 > Track Skew Factor: 13 > Cylinder Skew Factor: 22 > SSEC: 0 > HSEC: 1 > RMB: 0 > SURF: 0 > > > ======================================================================== > > Hmm, well, if this works (either Greg's command or my command, followed > *immediately* by a format), an example of this might be a good thing to > stick in the camcontrol man page. Kris, did this work for you? >> I know that Seagate has a few drives that can change bytes/sector. I'm >> currently perusing a manual from Seagate about SCSI-II/III but if >> someone else comes up with an answer sooner... > > Well, I think with most IBM disks you can change the blocksize from mode > page 3, but apparantly with this one you have to do it from the block > descriptor. It sounds similar to the Seagate disk that Greg used the above > command on. > > Since you've got to format your disk anyway, you might want to try out my > format patches to camcontrol. They've been sitting around for months in my > tree, and as far as I know, no one (except me) has tried them. Here they > are: > > http://www.freebsd.org/~ken/camcontrol.format.061799 I tried them. They seemed to work OK, but I had some library dependency problems. > I think the patches should apply okay to -current or -stable, but if they > don't it shouldn't be too hard to get them to apply. > > One warning, though -- in your situation, you'll probably want to use the > -q option to camcontrol format. The reason is, without "quiet" turned on, > camcontrol will do an inquiry on your disk, which may nullify any block > setting you just made, if your disk behaves anything like Greg's Seagate. Are you planning to commit these patches? I'd think it's worth it. Greg -- See complete headers for address, home page and phone numbers finger grog@lemis.com for PGP public key To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-scsi" in the body of the message