[comp.sys.next] SR2.0 BuildDisk vs SR2.1BuildDisk

citdem@UAVAX0.CCIT.ARIZONA.EDU (04/15/91)

History: When I got 2.0 a couple of months ago, I installed it via BuildDisk.
         To my surprize, the post-build "available" space on my HD was 635MB
         instead of the 662MB I expected.  Having never checked "available"
         space, I assumed BuildDisk walloped my HD.  However, the real
         problem was that I had a HP hard disk (635MB) not a Maxtor (662MB).
         NeXT replaced the HD and the replacement had 662MB "available".

Now: Because I got SR2.1 on OD, I had to rebuild my HD once again.  And once
     again, a surprize.  Instead of the expected 662MB, I have 653MB
     "available".  I noticed that NeXT has changed the number of cylinders
     per cylinder group from 32 to 16.  I noticed most other numbers halved
     or doubled - except the "i/g" number which is reduced by about 1/4.
     If "i/g" means i-nodes per (cylinder) group, does this mean that I now
     have more inodes and, hence, more space is devoted to "administrative
     overhead"?  BTW, I think NeXT changed the number of cylinders per group
     so that one i-node would fit on a page of memory.  (In SR2.0 NeXT
     wanted 4096 bytes per i-node; but BuildDisk changed that to 5000+ bytes.)

This is just speculation on my part.  I am new to NeXT and Unix.  Anyone got
better info - the REAL explanation.  Should I get any better I/O times?  Is
more memory now available for use?  (BTW, reloading SR2.0 yields the original
662MB.)

Don McCollam  (citdem@uavax0.ccit.arizona.edu)

eps@toaster.SFSU.EDU (Eric P. Scott) (04/23/91)

NeXT cleaned out /etc/disktab in 2.1--all the SCSI disks that
were listed in 2.0 are GONE.  Only the OD description remains.

The "disk" utility is supposed to be able to figure out what the
disk geometry is, and create a maximally-sized partition.  The -p
option (new with 2.1) causes two partitions to be created, with
-p's argument being the number of blocks to allocate to the root
(a) partition; the remainder will be assigned to the clients (b)
partition.  No, this does not appear on the man page.  Another
annoyance: unless you use a disktab entry, the disk will be
marked for automount=yes, which may provoke a serious security
problem later (guess how we found THAT out).

As for the original question, part of the mystery surrounds this
comment in the 1.0 disktab:

# NOTE: Drives that use "cylinder-oriented sparing" do not have
# simple values for sectors and tracks, since not all tracks have
# the same number of available sectors.  Therefore, the tracks and
# sectors in these entries don't match the physical device, but are
# chosen so that their product exactly matches the number of USABLE
# sectors per cylinder.  The slight lie about physical sectors/track
# is covered up by tuning the file system rotational latency parameter
# appropriately.

Here's a "real-world" example:

We purchased a Fujitsu M2266SA (it should have been a M2266SB,
but we let ourselves be talked into it because our supplier was
able to get us this more quickly, and we reformatted it to 1024
byte sectors--if you're thinking of getting one of these drives,
by all means order the SB version instead!).

Here's what scsimodes displays:

SCSI information for /dev/rsd1a
Drive type: FUJITSU M2266S-1024
1024 bytes per sector
45 sectors per track
15 tracks per cylinder
1658 cylinder per volume (including spare cylinders)
3 spare sectors per cylinder
15 alternate tracks per volume
1113503 usable sectors on volume

So the "raw" geometry is
  1658 cylinders * (45 sectors/track * 15 tracks/cylinder)
= 1658 cylinders * 675 sectors/cylinder
= 1119150 sectors

But that doesn't agree with The Bottom Line.  Let's take a closer
look at those numbers.  The 15 alternate tracks at 15 tracks per
cylinder add up to one complete cylinder, so there are only 1657
usable cylinders.  With 3 spare sectors per cylinder, there are
only 672 sectors left--what's 1657*672?  1113504.  Why does
scsimodes show one less?  I think it's an error; if you do
scsimodes -v  that number turns up as "last logical block"--*not*
the number of blocks (which does show as 1113504).  So how many
blocks are available for filesystem use?  1113344.  You have to
figure in the 160 blocks for the front porch too.

I'll leave the rest of the math as an exercise for the reader.


We purchased a NeXTstation with internal 400MB drive for use as a
NetBoot server (per NeXT's recommendation, it has 32MB of parity
RAM, and yes, it really needs it).  400MB is *barely* enough for
what needs to be on the root (including swap space!)--so /clients
and /Users both need to be on the external Fujitsu.  Here's the
partitioning:

+-------------+-----------------+
| front porch |(pad to full cyl)|
+-------------+-----------------+
| (a) /clients  190MB available |
+-------------------------------+
| (b) /Users    763MB available |
+-------------------------------+

And here's the disktab entry:

# FUJITSU M2266S with 3 spare sectors/cyl and 1024 byte sectors
#
# 'a' partition on M2266S is intended for NetBoot client private trees
# If not supporting NetBoot clients, it may be mounted as desired.
M2266S-1024|FUJITSU M2266S-1024|FUJITSU M2266S-1024 w/1024 byte sectors:\
	:ty=fixed_rw_scsi:nc#1657:nt#16:ns#42:ss#1024:rm#3600:\
	:fp#160:bp#0:ng#0:gs#0:ga#0:ao#0:\
	:os=sdmach:z0#32:z1#96:ro=b:\
	:pa#512:sa#219744:ba#8192:fa#1024:ca#20:da#8192:ra#10:oa=time:\
		:ia:ta=4.3BSD:\
	:pb#220256:sb#893088:bb#8192:fb#1024:cb#15:db#4096:rb#10:ob=time:\
		:ib:tb=4.3BSD:

The numbers were chosen to roughly parallel what a Maxtor
XT-8760S-1024 would deliver in a "traditional" cube
configuration.  mkfs complained when we didn't make things
an integral number of cylinders.

					-=EPS=-

bennett@mp.cs.niu.edu (Scott Bennett) (04/24/91)

In article <1490@toaster.SFSU.EDU> eps@cs.SFSU.EDU (Eric P. Scott) writes:
>NeXT cleaned out /etc/disktab in 2.1--all the SCSI disks that
>were listed in 2.0 are GONE.  Only the OD description remains.
>
>  [text deleted  --SJB]

     Thanks a *bundle* for the warnings!  If I ever manage to get my
hands on 2.1, I'll remember to save /etc/disktab somewhere.
>
>Here's what scsimodes displays:
>
>SCSI information for /dev/rsd1a
>Drive type: FUJITSU M2266S-1024
>1024 bytes per sector
>45 sectors per track
>15 tracks per cylinder
>1658 cylinder per volume (including spare cylinders)
>3 spare sectors per cylinder
>15 alternate tracks per volume
>1113503 usable sectors on volume
>
>So the "raw" geometry is
>  1658 cylinders * (45 sectors/track * 15 tracks/cylinder)
>= 1658 cylinders * 675 sectors/cylinder
>= 1119150 sectors
>
>But that doesn't agree with The Bottom Line.  Let's take a closer
>look at those numbers.  The 15 alternate tracks at 15 tracks per
>cylinder add up to one complete cylinder, so there are only 1657
>usable cylinders.  With 3 spare sectors per cylinder, there are
>only 672 sectors left--what's 1657*672?  1113504.  Why does
>scsimodes show one less?  I think it's an error; if you do
>scsimodes -v  that number turns up as "last logical block"--*not*
>the number of blocks (which does show as 1113504).  So how many
>blocks are available for filesystem use?  1113344.  You have to
>figure in the 160 blocks for the front porch too.
>
     My guess is that the missing track is assumed to be the
boot blocks.  I don't know what exactly you mean by "front porch,"
but I'm assuming that it is stuff that is operating system-dependent,
e.g. disk volume label, partition map, bad sector/track information,
available alternate track locations, etc.  All operating systems
can be expected to need some sort of boot program and the computer
will always need to be able to find it in the same place (e.g. track 0),
but the rest of the stuff could vary according to the software.

> [remainder of text deleted  --SJB]
>
>
>					-=EPS=-


                                  Scott Bennett, Comm. ASMELG, CFIAG
                                  Systems Programming
                                  Northern Illinois University
                                  DeKalb, Illinois 60115
**********************************************************************
* Internet:       bennett@cs.niu.edu                                 *
* BITNET:         A01SJB1@NIU                                        *
*--------------------------------------------------------------------*
*  "Spent a little time on the mountain, Spent a little time on the  *
*   Hill, The things that went down you don't understand, But I      *
*   think in time you will."  Oakland, 19 Feb. 1991, first time      *
*  since 25 Sept. 1970!!!  Yippee!!!!  Wondering what's NeXT... :-)  *
**********************************************************************

eps@toaster.SFSU.EDU (Eric P. Scott) (04/25/91)

In article <1991Apr24.023556.24667@mp.cs.niu.edu>
	bennett@mp.cs.niu.edu (Scott Bennett) writes:
>              I don't know what exactly you mean by "front porch,"
>but I'm assuming that it is stuff that is operating system-dependent,

No other UNIX system I've checked has anything like it, so I
assume it's something NeXT made up.

There's a brief mention in NextAnswers' sysadmin.435

					-=EPS=-