Subject: Re: disklabel
To: Dustin Ebert <dustin@math.umn.edu>
From: Jason Thorpe <thorpej@nas.nasa.gov>
List: port-hp300
Date: 11/05/1995 12:23:51
On Sun, 5 Nov 1995 13:19:07 -0600 (CST)
Dustin Ebert <dustin@math.umn.edu> wrote:
> 3.This returns with the error "open partition woult move
> or shrink"
This is somewhat due to a fundamental stupidity on the part of
disklabel(8). disklabel(8) assumes that:
secs_per_track * tracks_per_cyl * cyls_per_unit = secs_per_unit
...which, especially when dealing with SCSI, is not necessarily the case.
What's likely happening is that those numbers probably don't multiply out
to the total number of sectors that the SCSI inquiry got from the drive,
and hence setdisklabel() (in sys/arch/hp300/hp300/disksubr.c) returns
EBUSY when the slightly smaller number of sectors for the `c' partition
is placed in the disklabel (you have to open `c' to label the disk). On
the other hand, disklabel won't let you specify a larger number of total
sectors (combination of size + offset) than the geometry expands out to.
So, what needs to happen is that disklabel needs to get smarter and allow
alightly larger numbers in the case of RAW_PART (IMHO).
You could avoid this my just adding 1 to the number of cylinders, and
using the number of blocks reported by the SCSI probe (that feature was
added a couple of weeks ago) for the size of `c', assuming offset of 0.
The disk's rigid geometry isn't used if the disk is SCSI, because SCSI
uses all logical block addressing. It's only really meaningful to folks
who a) need to estimate the size of a disk, or b) are fine-tuning striped
disk arrays and need to calculate interleave factors and rotational
offsets for synchronized spindles.
But, before we get too far down that path, what is the source of your
geometry information? NetBSD, by default, assumes a blocksize of 512
bytes. HP-UX assumes 1024 byte blocks. Make sure you've adjusted your
geometry accordingly if HP-UX is the source of your disk info.
--------------------------------------------------------------------------
Jason R. Thorpe thorpej@nas.nasa.gov
NASA Ames Research Center Home: 408.866.1912
NAS: M/S 258-6 Work: 415.604.0935
Moffett Field, CA 94035 Pager: 415.428.6939