[comp.unix.wizards] A few questions about 4.3BSD partitions and cylinders

nessus@athena.mit.edu (Doug Alan) (01/09/88)

Hi.  I have some questions about partitions and cylinder groups in
4.3BSD that I hope someone might be able to answer.  If you can help
enlighten me, and feel your answer is worth a posting, please also
mail it to me, as I do not always keep up with netnews.

We have some uVaxes here where I work that have Fujitsu M2246E drives
controlled by Sigma SCD-RQD11-EC controllers.  The controller is a
little bit unusual, however, in that it reserves the first track for
its own use, and what you see when talking to the controller as sector
0 of the disk is really sector 35.  Now I believe that 4.3BSD wants
partitions to begin at the beginning cylinders.  What happens if they
do not begin at the beginning of a cylinder?  I know that everything
still works, but is there a big performance loss?  How much?  Clearly
there's not much I can do about the root partition not beginning on a
cylinder boundary with this Sigma controller, but should I adjust the
partition offsets of other partitions so that they begin on cylinder
boundaries?

Moving to a different but related circumstance, where I used to work,
at Project Athena, we had zillions of workstations, and we had an
installation software kit that would set up new workstations which had
just been removed from the box.  The install kit would initialize file
systems on the disk drive of a workstation and load the file systems
up with software.  It was possible for the installation kit to
determine the size of the disk drive (we were using Ultrix which lets
you easily determine the size of a disk drive), but it wasn't easy for
the kit to determine what kind of disk drive the drive was, so when
the installation software ran "newfs", it told "newfs" that the drive
was an RD52 (though it used the "-s" option to adjust the size), no
matter what kind of drive was actually on the workstation.  Thus if
the workstation had an RD53 or RD54 the fine-tuning parameters of the
file systems on the drive were set as if the drive were an RD52.  What
kind of performance loss does this sort of thing cause?

This leads me to ask some more questions that have been bugging me for
a while.  Why is the root partition always 15884 sectors?  Where does
this number come from?  Can you make it bigger or smaller?  Will this
cause any problems?  Why is swap space usually 33440 sectors?  Why is
there often empty space inbetween partitions.  I can understand why
there would be empty space between the root partion and the swap
partition if the root partition has to be 15884 sectors and the swap
partition should begin on a cylinder boundary, but this doesn't
explain why there is empty space between other partitions.  For
example, I'm looking now at the partition table for an RA80.  The E
partition ends at sector 121904 but the F partition doesn't begin
until 121954.  Is there any important reason that 50 sectors have been
left unused?

|>ouglas /\lan
Software/Hardware Analyst
Department of Electrical Engineering and Computer Science
Massachusetts Institute of Technology

     (or nessus@athena.mit.edu
         nessus@mit-eddie.uucp)

rbj@icst-cmr.arpa (Root Boy Jim) (01/15/88)

   From: Doug Alan <nessus@athena.mit.EDU>

   This leads me to ask some more questions that have been bugging me for
   a while.  Why is the root partition always 15884 sectors?  Where does
   this number come from?  Can you make it bigger or smaller?  Will this
   cause any problems?  Why is swap space usually 33440 sectors?  Why is

For hysterical raisins. I think they come from the gee I'm a tree of
the RP06. It just seemed convenient for all root file systems to be
the same size, so they can be dd'ed easily.

The numbers are not sacred. Any partition can be rounded out to the
end of the cylinder easily enuf. For example, an RM03 has is 823 cylinders
of five tracks of 32 sectors, giving 160 sector per cylinder. 15884
sectors fills up 99 cylinders and then a few. Since the swap partition
starts at cylinder 100, I round out the root partition to 16000 sectors
even. This may be done with any and all partitions on SMD disks.

To do this, you must edit the partition table in the kernel, or adb it
if you don't have source. In 4.3BSD, for example, hp.c contains things
like eagle_sizes, rm03_sizes, cdcxxx_sizes, etc, which are arrays of
eight structures, containing two ints (or longs, I don't care because
all we have is VAXen, SUNs, and a Sequent, where they are both the same).
The first int is partition size in sectors, the second is the starting
cylinder. You must also edit /etc/disktab as well.

Sun (as does Ultrix) contains the partition layout in a label on the
disk, so you can do anything you want to with diag (or chpt). Sequent
has moved the partition table into the disk configuration file, so
even if you don't have source, you can edit them easily.

On our Sequent we have two SCSI disks. They seem to have the start
specified in sectors, thus wasting no space, so I left them alone.
In addition, SCSI geometry is not as important as SMD geometry; I think
only formatting programs are supposed to know about it, not ordinary
device drivers.

	(Root Boy) Jim Cottrell	<rbj@icst-cmr.arpa>
	National Bureau of Standards
	Flamer's Hotline: (301) 975-5688
Vote for ME -- I'm well-tapered, half-cocked, ill-conceived and TAX-DEFERRED!

jerry@oliveb.olivetti.com (Jerry Aguirre) (01/21/88)

In article <11271@brl-adm.ARPA> rbj@icst-cmr.arpa (Root Boy Jim) writes:
>
>   From: Doug Alan <nessus@athena.mit.EDU>
>
>   This leads me to ask some more questions that have been bugging me for
>   a while.  Why is the root partition always 15884 sectors?  Where does
>   this number come from?  Can you make it bigger or smaller?  Will this
>   cause any problems?  Why is swap space usually 33440 sectors?  Why is
>
>For hysterical raisins. I think they come from the gee I'm a tree of
>the RP06. It just seemed convenient for all root file systems to be
>the same size, so they can be dd'ed easily.

Except they arn't.  Even though the disktab may specify the same 15884
size, newfs/mkfs is going to create different sizes for different
disks.  Because the number of sectors in a cylinder are different the
number of inodes changes and that also changes the number of free
sectors.  Also the 15884 results in the last cylinder being a partial
one so some of the sectors are "cannot be allocated".  (I spent hours
explaining to one of our guys why an eagle-II had a different size root
from an eagle-I even though they had the same 15884 entry.)

Of course if you dd then it doesn't matter bacause you won't be paying
any attention to cylinder boundries.  Given the level of access to root
files (/bin /etc /lib) this could negate much of the benifits of the
cylinder group concept.  I presume that the only reason that anyone
would dd a root file system would be if they were bootstrapping another
system.  If they were going to get that far into it they could patch the
destination file system while they booted.

Meanwhile I waste over half a meg of my root file system as either
hidden or unusable.  I could use that space to hold all those timezone
files in /etc/zoneinfo.

					Jerry Aguirre
					Systems Administration
					Olivetti ATC

chris@mimsy.UUCP (Chris Torek) (01/22/88)

[Why are all roots the same size (15884 sectors)]
>In article <11271@brl-adm.ARPA> rbj@icst-cmr.arpa (Root Boy Jim) writes:
>>For hysterical raisins. I think they come from the gee I'm a tree of
>>the RP06. It just seemed convenient for all root file systems to be
>>the same size, so they can be dd'ed easily.

In article <13380@oliveb.olivetti.com> jerry@oliveb.olivetti.com
(Jerry Aguirre) writes:
>Except they arn't.  [The geometry is different which makes mkfs
>use different amounts out of those 15884 sectors.]

>Of course if you dd then it doesn't matter bacause you won't be paying
>any attention to cylinder boundries.

Right.

Moreover, the next release has disk labels, stored on sector zero
of each pack.  If you `dd if=/dev/rp06-root of=/dev/rm05-root' you
will relabel your RM05 as an RP06.

*Root file systems should be copied with dd ONLY if the two drives
are identical and (now) partitioned identically.*

>Meanwhile I waste over half a meg of my root file system as either
>hidden or unusable.

I ignore the sizes in the distributions and make up my own.  On
everything except one Microvax, I have 30+ MB roots.  No more
running out of space for the next vmunix. . . . :-)
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain:	chris@mimsy.umd.edu	Path:	uunet!mimsy!chris

grr@cbmvax.UUCP (George Robbins) (01/24/88)

In article <10286@mimsy.UUCP> chris@mimsy.UUCP (Chris Torek) writes:
> 
> >Of course if you dd then it doesn't matter bacause you won't be paying
> >any attention to cylinder boundries.
> 
> Right.
> 
> Moreover, the next release has disk labels, stored on sector zero
> of each pack.  If you `dd if=/dev/rp06-root of=/dev/rm05-root' you
> will relabel your RM05 as an RP06.

Yah, Ultrix already has this interesting characteristic.  I've been
caught a few times when dd'ing the a partitiion between rm05's and
my rp07.  It doesn't become obvious until you go to acess one of the
other partitions that are in different places.  Luckily, a quick shot
of chpt sets things right.
 
> I ignore the sizes in the distributions and make up my own.  On
> everything except one Microvax, I have 30+ MB roots.  No more
> running out of space for the next vmunix. . . . :-)

I think if you have several like drives on a system, it's not a bad idea
to stick with the standard partitions.  It makes things relatively easy
to shuffle about if a drive dies.  I do wish there were a pair of
"standard" "ab" and "gh" overlapping definitions though.

-- 
George Robbins - now working for,	uucp: {uunet|ihnp4|rutgers}!cbmvax!grr
but no way officially representing	arpa: cbmvax!grr@uunet.uu.net
Commodore, Engineering Department	fone: 215-431-9255 (only by moonlite)