[lkml]   [1996]   [Jun]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: My SCSI HD has 34 heads, not 255...
On Sun, 16 Jun 1996 wrote:

> Linux will ask the controller about the geometry it has invented
> or invent something itself. There can never be any guarantee
> to be `right'. But when you have several operating systems
> on the same disk, or if you use the same disk on several
> controllers, you may have to invent your own reality and tell
> all systems that differ explicitly about your choice.
> That is why you can give lilo and fdisk explicit CHS information.
> If you have an explicit proposal on how to make fdisk do the right
> thing more often - i.e., look at the partition table and guess
> what disk geometry you would like to go with that - then such
> sugestions are welcome.

The main problem is that the "invented" geometery should correspond to the
values provided by the BIOS, or other OS driver, or there is little point
in having the system call.

What my patch did is access a routine that would scan the partition table
and usually guess right about the disk geometery - since most schemes
would end on cylinder boundaries, the "end" values would have the total
number of sectors and heads as perceived by the BIOS. With those two
values and the total capacity you can determine the total cylinders.
So if a valid partition table already exists (with the tests for the
signature bytes), it could be used to superceed the value of the system

The routine (in linux/drivers/scsi/scsicam.c) could be cloned or adapted
or the function implemented in fdisk (all flavors) and lilo.

I would suggest this technique (use any values from a preexisting
partition table first, call HD_GETGEO second) be used for automatic
determination. ; finger for PGP key

 \ /
  Last update: 2005-03-22 13:37    [W:0.080 / U:3.528 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site