Subject: Re: Disklabels, Booting, and Overlap, Oh My!
To: None <port-hp300@netbsd.org>
From: Justin Tripp <justin@ee.byu.edu>
List: port-hp300
Date: 07/20/2000 19:32:46
There are several errors in your disklabel.
I am assuming that your sectors/track and track/cylinder are correct. 

Okay, first you definitely have more than 1 cylinder.  Having one just
does not make sense.  You can only find this info out from the
manufacturer of the drive (or from a working machine with an SCSI
programming API).

Now it looks like you might have 3217 Cylinders.  But that is also not
correct.

2059140 / 640 = 3217.40625  

And this really should be an even division.  There are no partial sectors
or tracks.

If we use 3217 then your calculations for the sizes of the partions seem
to be incorrect.  It should be something like

a: 1854080      640 4.2BSD 1024 8192 16 # (Cyl.    1 - 2897)
b:  204160  1854720 swap   1024         # (Cyl. 2898 - 3216)
c: 2058880        0 boot                # (Cyl.    0 - 3216)

If you have 3217 cylinders the cylinders are numbered 0 to 3216.  So, to
find out how many sectors that is 3217 * 640 = 2058880.  This value is
used in the boot partition c.  Everything else can also be
calculated.  For example the partition a is calculated as follows:

The offset of cylinder 0 is : 1 * 640 = 640.
Now the partition is 1 to 2897 which is 2897 cylinders (2897 - 1 +
1).  You must add one partition to include the partition on the
bottom.  

So the size is : 2897 * 640 = 1854080

etc.

Without knowing exactly what the specifications are of your disk, it is
hard to tell you exactly what you should put.  Be sure to make your
partitions on cylinder boundaries.  It makes things easier in the end.

			.justin.


On Thu, 20 Jul 2000, Secret Asian Man wrote:

;)Hi, I'm installing on a 380 here, just got it the other day; Wrote this disklabel:
;)
;)hagel# disklabel sd0
;)# /dev/rsd0c:
;)type: SCSI
;)disk: 
;)label: 
;)flags:
;)bytes/sector: 512
;)sectors/track: 32
;)tracks/cylinder: 20
;)sectors/cylinder: 640
;)cylinders: 1
;)total sectors: 2059140
;)rpm: 3600
;)interleave: 1
;)trackskew: 0
;)cylinderskew: 0
;)headswitch: 0           # milliseconds
;)track-to-track seek: 0  # milliseconds
;)drivedata: 0 
;)
;)3 partitions:
;)#        size   offset     fstype   [fsize bsize   cpg]
;)  a:  1853226     1024     4.2BSD     1024  8192     0   # (Cyl.    1*- 2897*)
;)  b:   204890  1854250       swap                        # (Cyl. 2897*- 3217*)
;)  c:  2059140        0       boot                        # (Cyl.    0 - 3217*)
;)
;)And then I ran disklabel -B sd0
;)
;)hagel# disklabel -B sd0
;)disklabel: boot overlaps used partition a
;)disklabel: boot overlaps used partition c
;)disklabel: cannot install boot program
;)
;)I've tried making the offset bigger on a, to no avail; This is the recommended procedure in the install document, but no workie for me...
;)
;)Any ideas?
;)
;)cc
;)
;)-- 
;)Christopher Kyin-hwa Chen <cchen@nougat.org>
;)<http://www.nougat.org/~cchen/>
;)"Surfactant smiles keeps their grades afloat."
;)-- Daydream on 17 April 1999
;)

------------------------------------------------------------------------
Justin Leonard Tripp                                   justin@ee.byu.edu
Configurable Computing Laboratory Research Assistant      CB 461 x8-7206
Electrical and Computer Engineering Department  Brigham Young University