[comp.sys.sun] Wren VI format.dat query

dma@gandalf.berkeley.edu (D. Mark Abrahams) (02/14/90)

Apparently there are different possible ways to format SCSI disks such as
the Wren V and Wren VI.  Perhaps something to do with "logical sectoring"
vs. "hard sectoring" -- I'm unclear on this.

In any case, different vendors quoted me different formatted sizes (total
number of sectors in the `c' partition) for these disks, all under SunOS.
Quotes ranged from 600 to 622Mb for the Wren V and from 650 to 690Mb for
the Wren VI.  For the Wren V, the vendor who quoted 622Mb said, in effect,
"we have clever format.dat parameters which get a bit more space out of
the disk".  Another vendor said "the format.dat parameters are not
engraved in stone; you can choose your own".

- Are there indeed different ways to format these disks for SunOS?
- If yes, what are they, and what are the issues and tradeoffs? 
	(access speed vs. maximum space?)
- Where do I find out more?

I'm particularly interested in the Wren VI (on the SS1, if it matters) as
this is the disk I plan to purchase.  (The vendor choice was made on
overall price including hardware maintenance price, not claimed Mb).  Here
is the format.dat entry this vendor uses.

disk_type = "CDC WrenVI 94196-766" \
	: ctlr = MD21 : fmt_time = 3 \
	: trks_zone = 15 : asect = 6 \
	: ncyl = 1626 : acyl = 2 : pcyl = 1632 : nhead = 15 : nsect = 53 \
	: rpm = 3600 : bpt = 30170

This gives ncyl*head*nsect = 1626*15*53 = 1292670 sectors = "only" 646Mb.
Can this be improved?  If you are using a Wren VI, what is your format.dat
entry and how did you arrive at it?

Tips, pointers, references, and RTFMs are all welcome.  (Which FM, and
where?).  Please e-mail me.  I'll summarize if requested.  Thanks!

Mark Abrahams		dma@stat.berkeley.edu
Statistics		dma@ucbstat.bitnet
UC Berkeley		ucbvax!stat!dma

geof@aurora.com (Geoffrey H. Cooper) (02/15/90)

In article <4967@brazos.Rice.edu> dma@gandalf.berkeley.edu (D. Mark Abrahams) writes:
>X-Sun-Spots-Digest: Volume 9, Issue 39, message 12
>
>I'm particularly interested in the Wren VI (on the SS1, if it matters) as
>this is the disk I plan to purchase.  (The vendor choice was made on
>overall price including hardware maintenance price, not claimed Mb).  Here
>is the format.dat entry this vendor uses.
>
>disk_type = "CDC WrenVI 94196-766" \
>	: ctlr = MD21 : fmt_time = 3 \
>	: trks_zone = 15 : asect = 6 \
>	: ncyl = 1626 : acyl = 2 : pcyl = 1632 : nhead = 15 : nsect = 53 \
>	: rpm = 3600 : bpt = 30170
>
>This gives ncyl*head*nsect = 1626*15*53 = 1292670 sectors = "only" 646Mb.
>Can this be improved?  If you are using a Wren VI, what is your format.dat
>entry and how did you arrive at it?

I had a lot of trouble figuring out what to use for our Wren VI's on
SS1's.  After a few calls around (note: Seagate has a nice 900 number for
answering questions on this, I came up with the following:

sd3: <CDC Wren VI 94191-766 (1632x52x512) cyl 1630 alt 2 hd 15 sec 52>

i.e., 512 bytes/cyl, 1632 cyl total, 2 spare cyl's, 52 sectors/track.  (15
heads, but that isn't negotiable).   My experience was the 53 sectors
didn't work (maybe I should try the above), and that 54 died immediately.
This despite Seagates quoting of 54 512-byte sectors per track.  I have
presumed that sun format steals 2 sectors per track for the bad block
list, but don't know this to be correct.

I believe that disk utilization would be somewhat higher with 1024 byte
sectors, since less room is allocated to inter-sector gaps and labelling.
I was surprised to find that this doesn't appear to be supported anywhere
(and wasted a morning improperly formatting my disk).

Actually, the REAL trick would be to figure out what format.dat
corresponds to the formatting that CDC already puts on the drive, or
create some program to make that work right.  To get Sun to accept the bad
sector list, I had to re-format (2+ hours).  This is a pain when the disk
comes formatted from CDC, and really only needs a label and an analysis
pass.

That is my experience.  I'll be eager to find out if there is another
technique that works better.

BTW, is the format of the /etc/format.dat hiding in the SysAdmin manual
somewhere?  I can't find a man page that describes it.

Now: how long before I have to buy a Wren VII to be able to keep all this
PD stuff on line at once...

geof@aurora.com / aurora!geof@decwrl.dec.com / geof%aurora.com@decwrl.dec.com

chris@com2serv.c2s.mn.org (Chris Johnson) (02/16/90)

In article <4967@brazos.Rice.edu> dma@gandalf.berkeley.edu (D. Mark Abrahams) writes:
>X-Sun-Spots-Digest: Volume 9, Issue 39, message 12
>
>Apparently there are different possible ways to format SCSI disks such as
>the Wren V and Wren VI.  Perhaps something to do with "logical sectoring"
>vs. "hard sectoring" -- I'm unclear on this.
>
>the Wren VI.  For the Wren V, the vendor who quoted 622Mb said, in effect,
>"we have clever format.dat parameters which get a bit more space out of
>the disk".  Another vendor said "the format.dat parameters are not
>engraved in stone; you can choose your own".
>
>- Are there indeed different ways to format these disks for SunOS?
>- If yes, what are they, and what are the issues and tradeoffs? 
>	(access speed vs. maximum space?)
>- Where do I find out more?
>
>overall price including hardware maintenance price, not claimed Mb).  Here
>is the format.dat entry this vendor uses.
>
>disk_type = "CDC WrenVI 94196-766" \
>	: ctlr = MD21 : fmt_time = 3 \
>	: trks_zone = 15 : asect = 6 \
>	: ncyl = 1626 : acyl = 2 : pcyl = 1632 : nhead = 15 : nsect = 53 \
>	: rpm = 3600 : bpt = 30170
>
>This gives ncyl*head*nsect = 1626*15*53 = 1292670 sectors = "only" 646Mb.
>Can this be improved?  If you are using a Wren VI, what is your format.dat
>entry and how did you arrive at it?

There are several issues here.

First, all hard disks that I'm familiar with have a low level format
based on the index pulse or marker as the platters rotate.  If you've
ever configured an SMD drive or controller, you know what I'm talking
about.  Essentially each track is divided up into a certain number of
sectors, each with its own ID, preamble, postamble, gaps, etc.  Often,
based on the sector size, you may end up with some left over bytes, or a
Runt sector at the end of the track.

With most SCSI disks, this low level format is something you will never
change.  It's been set by the designers of the embedded SCSI to disk
controller, nowadays usually built right into the drive package.  This is
perhaps what the above writer heard as being referred to as "hard
sectoring".  There are a few SCSI drives out there that will let you make
some changes to this, using the Format Parameter Page of an extended Mode
Select command (see below).

The way the SCSI read/writes work, however, is that one always deals
with transfers of logical blocks from a Direct Access device, such as a
hard disk drive.  Some drive manufacturers will let you reformat, using
the SCSI Format command, or by using SCSI Common Command Set Page Code
extensions to the Mode Select command for disk geometry and format, to
produce different logical block sizes.  Some manufacturers only allow
block sizes like 512 and 1024, pick between the two.  Others allow any
size you want between some minimum and maximum, and others allow any size
between a minimum and maximum that is a multiple of 128 or 256.

Chances are the best values for a logical block size are when the value
is both an even multiple of the low level sector size, and an even
multiple of the filesystem block size.

As far as I know, all Wren drives have a low level sector size of 512
data bytes.  Thus, with Unix System V.2, where the filesystem block size
is usually (yuck!) a hybrid between 512 and 1024 (some parts of the
software think the disk sectors are 512, and the cache buffers are 1024,
how convenient), the high level format probably ought to choose a block
size of 512 or 1024.  In fact, you might have to, unless you have a
device driver that can do blocking/deblocking.

Also, the latest model SCSI interface Wrens allow you to choose different
logical block sizes with Mode Select followed by Format Unit, and
different low level sectors/track average (they use Zone Bit Recording,
so there exists no single value for sectors per track -- this really
makes Sun's format.dat file even more useless, see below) values.
Earlier model SCSI Wrens only allowed a choice between 512 and 1024, or
another set of values for logical block sizes, again chosen by Mode
Select followed by Format Unit.

Maxtor and Micropolis had similar restrictions and conventions for block
sizes on their SCSI drives.

The second major issue is what Sun's device drivers and format programs
can do and will do with SCSI drives and information available from the
format.dat file.

Since a SCSI drive is really viewed from the outside world as just
randomly accessible set of identically sized logical blocks, a lot of the
"physical characteristics" entries in format.dat are largely irrelevant
for attached SCSI disks.  At best, my guess (without having seen all of
the source code) is that they use those numbers for estimating where
cylinder boundaries are, and for optimizing cylinder groups and so forth
for filesystems.

With a Wren drive using Zone Bit Recording (and Wren V, VI, VII's all use
it), chances of getting the logical partition boundaries to line up
ideally with real live cylinder boundaries are pretty slim.  Sun's
partitioning scheme has always depended in a way on this ideal.  Each
partition starts on track 0 of the appropriate cylinder, and continues
for some number of blocks.  To get maximum use out of the disk, that
number of blocks should be exactly the number of blocks in the next N
cylinders, where the next partition begins N cylinders away from the
previous (current) one.  Otherwise, you end up wasting some tracks or
more.

From perusing my format.dat, it's apparent that the actual situation is
worse, in that some of the supplied examples are just plain wrong,
usually only to the extent that a lot of available disk space is wasted.

I'm also suspicious of the MD-21 entry, and of Sun's disk driver in
general.  I've seen a skeleton of an earlier revision, and it doesn't
have a whole lot of smarts in the self-configuration department.  As a
result, I doubt that it can match itself very well to various SCSI
drives, even if all the correct format.dat parameters are supplied.

This is not to say you shouldn't or don't have to get them all relatively
correct!  There might some uses of the various numbers going on of which
I'm not aware that could result in poor or non- functionality.

In general, make sure you get the product specification for the disk
drive you want to configure into your system, and don't be put off by any
technical descriptions you don't understand.  Find out the exact numbers
for everything, like number of heads, number of cylinders, bytes per
track and so forth.

Then make your calculations as best as possible.  Your task will be
complicated by different spare sectoring schemes possible:  maybe the
drive is formatted for one spare sector per track, or maybe one track per
cylinder, or maybe 2 cylinders per zone (usually the zone will be the
entire disk, but doesn't have to be).

Because of some goofy internal assumptions Sun must make, you will have a
hard time using every last block on your disk.  I used the SCSI command
Read Capacity to find exactly how many logical blocks were available on
my drive.  Despite several attempts, I could never convince Sun's format
program to use all of them.

Or get some good numbers from someone else who either knows how to do all
this jumping through hoops, or has a good, working example connected to
his or her system.

I don't have a Wren VI manual at hand, or I'd give you the numbers to use
to figure out your own partitions.  I do have a Wren VII manual, and I
have set one up on my SPARCstation 1.  It worked great, and I do highly
recommend Wren drives.  Their only drawbacks would have to be they cost
more (but are worth it) and they take a lot of start-up current (4.5 amps
at +12 voltes).  They are fast, large, reliable, and bullet-proof.  (we
dropped one on the floor once -- it still worked after words)

I hope this long winded post has helped some people.  I'd be happy to
take my best shot at more specific questions regarding SCSI devices, so
feel free to send mail.


Chris Johnson                  DOMAIN:  chris@c2s.mn.org
Com Squared Systems, Inc.         ATT:  +1 612 452 9522
Mendota Heights, MN  USA          FAX:  +1 612 452 3607

X-Subject: Re: Wren VI format.dat query (addendum to previous post)

Minor correction and addendum to my previous (in the time dimension :-)
follow-up to this subject:

Wren III SCSI models (94161 and 94211) allow the user to reformat using
any integer data block size (logical block, not low level sector size)
between 256 and 2048 bytes.

Wren IV, V, VI, VII SCSI models (94171, 94181, 94221, 94191, 94241, and
94601) allow the user to reformat using any integer data block size
between 256 and 4096.

All Wren drives are formatted to 512 byte data block size at the factory,
with capacity dependent on the number of data heads.

Chris Johnson                  DOMAIN:  chris@c2s.mn.org
Com Squared Systems, Inc.         ATT:  +1 612 452 9522
Mendota Heights, MN  USA          FAX:  +1 612 452 3607