Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 7 Sep 1999 23:34:08 -0600 (MDT)
From:      "Kenneth D. Merry" <ken@kdm.org>
To:        kris@airnet.net (Kris Kirby)
Cc:        scsi@FreeBSD.ORG
Subject:   Re: Reformatting a 520-byte-per-sector drive
Message-ID:  <199909080534.XAA48516@panzer.kdm.org>
In-Reply-To: <37D5DF0B.FFF98713@airnet.net> from Kris Kirby at "Sep 7, 1999 10:59:07 pm"

next in thread | previous in thread | raw e-mail | index | archive | help
Kris Kirby wrote...
> da3 at ahc0 bus 0 target 0 lun 0
> da3: <IBM 0663 s> 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
> <http://www.storage.ibm.com/techsup/hddtech/0663x/0663xmso.htm>; 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


========================================================================

I wasn't paying a whole lot of attention at the time, so I thought he
actually ended up setting the current parameters in mode page 3.  In
actuality, he was setting them in the block descriptor.

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.

> 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 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.

Ken
-- 
Kenneth Merry
ken@kdm.org


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?199909080534.XAA48516>