lkml.org 
[lkml]   [2000]   [Mar]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: Cylinder limits jumper for drives over 32GB
Well, I have it hacked well enough that I can use the drive now.

I can tell you right now that it's not the drive that's preventing you
from accessing past the LBA capacity, it's Linux. Somewhere in the
kernel there is a check to make sure you don't try to access sectors
past the capacity of the drive. Well, when Linux thinks the capacity
of the drive is 66055248 instead of 80041248 then you run into
problems and get tons of IO errors!

So, it seems that like I said earlier, all we need to do is find out
where they are now hiding the LBA capacity and use that. I have a new
patch (last one was stupid, I used the physical CHS values instead of
BIOS) that will multiply BIOS CHS and use that for the drives
capacity. Right now I am doing a dd if=/dev/hda6 of=/dev/null bs=512
to make sure I can read everything on the disk. The e2fsck worked
fine (and it failed miserably with tons of IO errors when the drive
had the incorrect capacity).

So it looks like the drive actually not allowing you to write is a
total myth, it's actually Linux incorrectly generating the error.

Just so you know, my hard-drive has EZ-Drive in the MBR and is
partitioned as follows:
Disk /dev/hda: 255 heads, 63 sectors, 4982 cylinders
Units = sectors of 1 * 512 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 63 32129 16033+ 83 Linux
/dev/hda2 32130 16803989 8385930 c Win95 FAT32 (LBA)
/dev/hda3 16803990 80035829 31615920 f Win95 Ext'd (LBA)
/dev/hda5 16804053 17318069 257008+ 82 Linux swap
/dev/hda6 17318133 80035829 31358848+ 83 Linux

hda1 is my /boot partition and is where I put LILO.
hda2 is my Win98 C: drive (I actually used dd if=/dev/hdb2
of=/dev/hda2 bs=512 to copy my old data, worked like a charm)
hda3 is the extened (obviously)
hda5 is my swap (obviously)
hda6 is where linux will be (currently running on hdb6)

My hdb looks very similar (in fact, identical except that the extended
partition is obviously shorter and the linux partition is obviously
shorter, it's a 27 GB maxtor).

So anyway.. here is the patch that will fix the problem:
--- linux/drivers/block/ide-disk.c.orig Fri Mar 24 04:59:27 2000
+++ linux/drivers/block/ide-disk.c Fri Mar 24 04:25:27 2000
@@ -513,6 +513,11 @@
return drive->removable; /* if removable, always assume it was
changed */
}

+#define EZD_AND_CYLLIMITS(drive) ( \
+(drive->bios_cyl > 4111) && \
+(drive->bios_head = 255) && \
+(drive->bios_sect = 63) && \
+(drive->id->lba_capacity == 66055248) )
/*
* current_capacity() returns the capacity (in sectors) of a drive
* according to its current geometry/LBA settings.
@@ -523,8 +528,13 @@
unsigned long capacity = drive->cyl * drive->head * drive->sect;

drive->select.b.lba = 0;
+ if( EZD_AND_CYLLIMITS(drive) )
+ {
+ capacity = (unsigned long)drive->bios_cyl *
+ drive->bios_head * drive->bios_sect;
+ }
/* Determine capacity, and use LBA if the drive properly supports it
*/
- if (id != NULL && (id->capability & 2) && lba_capacity_is_ok(id)) {
+ else if (id != NULL && (id->capability & 2) &&
lba_capacity_is_ok(id)) { if (id->lba_capacity >= capacity) {
capacity = id->lba_capacity;
drive->select.b.lba = 1;

Again, it's not great, but it works. It has the disadvantage that you
must have EZ-Drive installed, but hey, you'd probably want that any if
you were planning on dual-booting. I have no idea what happens when
CHS is specified as hda=c,h,s. If it puts those values into the
bios_cyl,bios_head,bios_sect variables, then you could specify
geometry and get away with not having EZ-Drive. If it puts those
values somewhere else, maybe you want to change the patch to allow for
that.
Also, it would probably be wise to print a warning message if the
capacity < C*H*S.

As far as finding the real LBA capacity goes, I doubt you'll find it
in the identify file, it looks like it's somewhere else. I assume
that this would be covered in the ATA5 spec, but I'd rather not fork
over the $89 or whatever to find out and make like a 3 line change to
the IDE code.

-Dave

Andries.Brouwer@cwi.nl wrote:

> Andre:
> > I just one of these Draco Drives from Maxtor for evaluation.
>
> It seems that there are four possible states:
> jumper present or not, JUMPON.EXE used or not.
>

Actually, there are only 3. If you have the jumper off and you used
JUMPON I don't think it makes a difference (it is the same as simply
having the jumper off). Also, does having the jumper off once reset
that??? If so then my data could possibly be considered without
running JUMPON since I had been running the computer with the jumper
off, then put it back on and took the data.

>
> David Elliott reports (after running JUMPON.EXE)
> identify data, where the difference between with and without jumper
> is the lba_capacity (66055248 vs 80041248),
> and the last short (f9a5 vs e9a5).
>
> If you did not run JUMPON.EXE, what differences do you see?
> (That is, what do you get from cat /proc/ide/hdX/identify
> without and with jumper?)
>
> 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:57    [W:0.064 / U:24.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site