# Re: How to calculate partition table information (SUMMARY)

From: Andrew Patrick (andrew%rick@dgbt.crc.dnd.ca)
Date: Fri Mar 02 1990 - 14:04:20 CST

Since some people also requested the information, here is a summary to
my question on how you calculate the disk partition information.

Earlier today I wrote:

| Either:
| 1) I am not reading the right manual (System Administraton: Chapter
| 10 - Managing disks with format).
| 2) I have the right manual, but it is very vague.
| 3) It's been a long week.
|
| Anyway, my question is: how do you go about calculating the partition
| table information?
...

I have received a number of replies explaining how the calculations
are done. Here is one of the best explanations (others were equally
good):

| From: Tom Leach <leach@oce.orst.edu>
|
| ... to get the partition info, you need to do the following:
| Figure out how many partitions you want: (you said 3)
| Figure out how large each partition should be: (you said equal)
|
| So, to find out how many total sectors you have, you need to multiply
| ncyl * nhead * nsect == 1,292,670
| divide that into 3 equal partitions == 430,890
| (The partition should be on a cylinder boundry, but I went to the sector level
| to show you how to do it when a partition doesn't fill a cylinder.)
|
| Divide each partition size by nhead*nsect to get the number of cylinders for
| each partition (again, you could have just initially divided 1626 by 3 and
| arrived at the same answer). In your case, you get 3 partitions each with
| 542 cylinders (each cylinder contains nhead*nsect*'size of sectors, normally
| 512 or 1024').
|
| The layout of the partitions isn't a sacred as it used to be, but what has
| normally been done in that past is: a == small partition or root partition,
| b == swap space, c == entire disk, d,e,f == c-(b+a) or h,g == c-(b+a).
|
| In your case I would use partitions d, e, and f just to stick with history.
| so, starting with the D partition:
| D:
| it starts at the beginning of the disk (cyl 0) and contains 542 cyls.
| 542 cyls contain 430,890 sectors (from above), thus its entry would be:
| d = 0, 430890
| E:
| E starts at cylinder 542 and contains 542 cyls so it would be:
| e = 542, 430890
| F:
| F starts at cylinder 1084 and contains 542 cyls so it would be:
| f = 1084, 430890
|
| Overall the partition table would be as follows:
|
| partition = "CDC WrenVI 94196-766" \
| : disk = "CDC WrenVI 94196-766" : ctrl = MD21 \
| : a = 0, 0 : b = 0, 0 : c = 0, 1292670 : d = 0, 430890 \
| : e = 542, 430890 : f = 1084, 430890
|
|
| The question I had is a slightly nit-picky one, but the normal way that
| you get ncyl is: ncyl = pcyl - acyl (number of data cylinders is equal to
| the number of physical cylinders (given in the manual) minus the number of
| alternate cylinders used for bad block sparing). Your entry does not account
| for 4 cylinders. It's only a matter of a couple of Meg, but you may want to
| increase either ncyl or acyl to equal pcyl.

The reason for the missing 4 cylinders is described on pg. 188 of the
System Administration Procedures Manual (Chapter 10 -- Maintaining disks
with format). This document describes that the MD21 requires these 4
cylinders for "internal controller use".

But, Tom Leach wrote again:

| the part in the manuals about the MD21 is true. But doesn't the Wren VI
| have an on-board (on-disk?) controller and not an MD21? I set my format
| entry for the Wren V to exactally ncyl+acyl =pcyl with no problems. I
| don't think that many disk subsystems use the external SCSI controllers
| anymore but I may be mistaken.

Does anyone have an answer for this question? Do 4 cylinders have to
be set aside for "internal use"?

Also, edguer@curie.ces.cwru.edu (Aydin Edguer) writes:

| Sun and Dec are also in the peripherals game. They have no big desire
| to make it easier for you to buy third party peripherals. Berkeley
| on the other hand is not a hardware company. They have a program
| which will calculate default partition sizes for you. It is available
| for anonymous ftp from uunet.uu.net. The program is called diskpart
| and is stored in the file diskpart.tar.Z in the directory
| /bsd-sources/src/etc.

This program might be worth checking out. I plan to get it.

Thanks to all who responded.

```--
Andrew Patrick, Ph.D.         |  andrew@dgbt.crc.dnd.ca
(613) 990-4675              |  ...utzoo!lsuc!nrcaer!dgbt!andrew
Communications Canada, Ottawa |  andrew@doccrc.BITNET
"Who are you really and what were you before and what did you
do and what did you think."
```

This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:05:56 CDT