lkml.org 
[lkml]   [1996]   [Jun]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectMy SCSI HD has 34 heads, not 255...
Date
Hi,

I'm slightly puzzled by some recent changes to the AHA152X SCSI driver
which seem to have broken fdisk and hdparm's idea of what my SCSI HD
looks like (though everything else works).

I got my SCSI HD when Linux was at 1.3.91. All worked fine: SCSI
stuff compiled as modules, "Automatic Disk Geometry determination
(CONFIG_SCSI_AUTO_BIOSP)" set on and aha152x selected. Partitioned my
drive as follows:
--------------------------------------------------------------------
Disk /dev/sda: 34 heads, 61 sectors, 1017 cylinders
Units = cylinders of 2074 * 512 bytes

Device Boot Begin Start End Blocks Id System
/dev/sda1 1 1 247 256108+ 7 OS/2 HPFS
/dev/sda2 248 248 346 102663 83 Linux native
/dev/sda3 347 347 379 34221 82 Linux swap
/dev/sda4 380 380 1017 661606 83 Linux native
--------------------------------------------------------------------
hdparm reports:
/dev/sda:
geometry = 1017/34/61, sectors = 2109840, start = 0

Now, with 1.99.9 (pre2.0.9), I get:
--------------------------------------------------------------------
Disk /dev/sda: 255 heads, 63 sectors, 131 cylinders
Units = cylinders of 16065 * 512 bytes

Device Boot Begin Start End Blocks Id System
/dev/sda1 1 1 32 256108+ 7 OS/2 HPFS
Partition 1 has different physical/logical beginnings (non-Linux?):
phys=(0, 1, 1) logical=(0, 0, 62)
Partition 1 has different physical/logical endings:
phys=(246, 33, 61) logical=(31, 226, 25)
Partition 1 does not end on cylinder boundary:
phys=(246, 33, 61) should be (246, 254, 63)
/dev/sda2 248 32 45 102663 83 Linux native
Partition 2 has different physical/logical beginnings (non-Linux?):
phys=(247, 0, 1) logical=(31, 226, 26)
Partition 2 has different physical/logical endings:
phys=(345, 33, 61) logical=(44, 170, 34)
Partition 2 does not end on cylinder boundary:
phys=(345, 33, 61) should be (345, 254, 63)
/dev/sda3 347 45 49 34221 82 Linux swap
Partition 3 has different physical/logical beginnings (non-Linux?):
phys=(346, 0, 1) logical=(44, 170, 35)
Partition 3 has different physical/logical endings:
phys=(378, 33, 61) logical=(48, 236, 58)
Partition 3 does not end on cylinder boundary:
phys=(378, 33, 61) should be (378, 254, 63)
/dev/sda4 380 49 132 661606 83 Linux native
Partition 4 has different physical/logical beginnings (non-Linux?):
phys=(379, 0, 1) logical=(48, 236, 59)
Partition 4 has different physical/logical endings:
phys=(1016, 33, 61) logical=(131, 75, 18)
Partition 4 does not end on cylinder boundary:
phys=(1016, 33, 61) should be (1016, 254, 63)
--------------------------------------------------------------------
... and hdparm reports:
/dev/sda:
geometry = 131/255/63, sectors = 2109840, start = 0

In 1.3.92, the CONFIG_SCSI_AUTO_BIOSP option was removed and the
autodetect code shifted slightly (only execed if something or other is
NULL).

In 1.3.98 and 1.3.100, changes were made to aha152x.c so that now
(1.99.9 - I don't think there wer any changes bet. 1.3.100 and 1.99.9
that are relevant), aha152x_biosparam() looks like this:
--------------------------------------------------------------------
/*
* Return the "logical geometry"
*/
int aha152x_biosparam(Scsi_Disk * disk, kdev_t dev, int *info_array)
{
#if defined(DEBUG_BIOSPARAM)
if(HOSTDATA(shpnt)->debug & debug_biosparam)
printk("aha152x_biosparam: dev=%s, size=%d, ",
kdevname(dev), disk->capacity);
#endif

if(disk->capacity<=1024*64*32) {
info_array[0]=64;
info_array[1]=32;
info_array[2]=disk->capacity / (64 * 32);
} else {
info_array[0] = 255;
info_array[1] = 63;
info_array[2] = disk->capacity / (255 * 63);
if(info_array[2] > 1023)
info_array[2]=1023;
}

#if defined(DEBUG_BIOSPARAM)
if(HOSTDATA(shpnt)->debug & debug_biosparam)
{
printk("bios geometry: head=%d, sec=%d, cyl=%d\n",
info_array[0], info_array[1], info_array[2]);
printk("WARNING: check, if the bios geometry is correct.\n");
}
#endif

return 0;
}
--------------------------------------------------------------------

This piece of code seems to be the culprit: if I correct the figures
in the "else" block above to:
info_array[0] = 34;
info_array[1] = 61;
info_array[2] = disk->capacity / (61 * 34);
... everything is fine ounce again. I think the hardwired values
being used aren't right for everyone - at least not me.

... or have I done something wrong in my setup?

... or do I need updated versions of hdparm (v2.7) and/or fdisk (v2.0d
(> 2GB)).

Thanks for your help, :E
--
Eric S. Mountain - eric@minouche.demon.co.uk

On a clear disk you can seek forever.


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