lkml.org 
[lkml]   [1999]   [Dec]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: over 5Gb missing from a 13.5Gb disk
On Sun, Dec 05, 1999 at 04:59:58PM +0100, Wichert Akkerman wrote:
>
> I'm having a problem with a new IBM IDE disk I just bought. It is
> a 13.5Gb disk, but I can't access more then somewhat less then 8Gb
> from it..
>
> This is what the kernel reports:
>
> ide0: BM-DMA at 0x1440-0x1447, BIOS settings: hda:DMA, hdb:pio
> hda: IBM-DJNA-371350, ATA DISK drive
> hda: IBM-DJNA-371350, 12949MB w/1966kB Cache, CHS=40681/247/228, UDMA
>
> hdparm seems to disagree with those numbers:
>
> /dev/hda:
>
> Model=IBM-DJNA-371350, FwRev=J76OA30K, SerialNo=GM0GM088910
> Config={ HardSect NotMFM HdSw>15uSec Fixed DTR>10Mbs }
> RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=34
> BuffType=3(DualPortCache), BuffSize=1966kB, MaxMultSect=16, MultSect=off
> DblWordIO=no, OldPIO=2, DMA=yes, OldDMA=2
> CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=26520480
> tDMA={min:120,rec:120}, DMA modes: mword0 mword1 mword2
> IORDY=on/off, tPIO={min:240,w/IORDY:120}, PIO modes: mode3 mode4
> UDMA modes: mode0 mode1 *mode2 mode3 mode4

Progress. Your complaint reached me via all kinds of detours
each time with different fragments of information. Here you
forget the kernel version (I seem to recall that you mentioned
2.2.14pre11 elsewhere) but otherwise this is precisely what we need.

> The cylinder/heads/sector count and the number of LBA sectors
> corresponds to what is printed on the disk label. Since the kernel
> gets the sizes wrong I have to enter them manually in fdisk.. no
> big problem.

No, you shouldnt.

If there is a strange bug in the kernel then the kernel must be fixed.
And there really is something very strange... CHS=40681/247/228.
The number of sectors per track cannot be larger than 63 since it is
a 6-bit number. Moreover, the numbers of heads and of cylinders are
strange as well. So, this sounds as if your BIOS is totally confused
and reports ridiculous values to the kernel.
(Or, the kernel is broken and uses random data for CHS.)
Let us add a check that what comes from the BIOS is reasonable.

Alan, it may be a good idea to apply this to 2.2.14pre*:

--- ide-probe.c.orig Wed Dec 8 05:28:39 1999
+++ ide-probe.c Wed Dec 8 05:34:29 1999
@@ -386,12 +386,20 @@
/* Extract drive geometry from CMOS+BIOS if not already setup */
for (unit = 0; unit < MAX_DRIVES; ++unit) {
ide_drive_t *drive = &hwif->drives[unit];
- if ((cmos_disks & (0xf0 >> (unit*4))) && !drive->present && !drive->nobios) {
- drive->cyl = drive->bios_cyl = *(unsigned short *)BIOS;
- drive->head = drive->bios_head = *(BIOS+2);
- drive->sect = drive->bios_sect = *(BIOS+14);
- drive->ctl = *(BIOS+8);
- drive->present = 1;
+ if ((cmos_disks & (0xf0 >> (unit*4)))
+ && !drive->present && !drive->nobios) {
+ unsigned short cyl = *(unsigned short *)BIOS;
+ unsigned char head = *(BIOS+2);
+ unsigned char sect = *(BIOS+14);
+ if (cyl > 0 && head > 0 && sect > 0 && sect < 64) {
+ drive->cyl = drive->bios_cyl = cyl;
+ drive->head = drive->bios_head = head;
+ drive->sect = drive->bios_sect = sect;
+ drive->ctl = *(BIOS+8);
+ drive->present = 1;
+ } else
+ printk("hd%d: C/H/S=%d/%d/%d from BIOS ignored\n",
+ unit, cyl, head, sect);
}
BIOS += 16;
}
(pasted from another window - tabs will have become spaces).

Wichert - if you apply this (to linux/drivers/block/ide-probe.c),
does it make any difference? If not, we'll have to find the source
of your strange number of sectors elsewhere.
You can also try both versions: with disk in BIOS and not in BIOS.
Do you also have SCSI disks? Do you boot from SCSI?

Andries




-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

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