[ltp] Is the "large IDE drive geometry problem" purely a ThinkPad thing?

Rob Mayoff linux-thinkpad@www.bm-soft.com
Thu, 6 Jan 2000 10:37:42 -0600 (CST)


| Over that last several months, there have been numerous posts on this list
| from users who need to work around IDE drive geometry problems for drives
| that exceed a particular size. I am not referring to the new problem that
| was introduced when we released a new 600E BIOS in November ("INVALID
| GEOMETRY: 0 PHYSICAL HEADS?"), but rather the one in which drives over a
| particular size (8gig) are not detected properly. I had been assuming that
| it was simply a Linux IDE device driver problem, rather than a ThinkPad
| problem. Is that a correct assumption, or is the problem really a
| ThinkPad-specific, possibly due to a BIOS problem?

The problem that I have studied, which came up more frequently before
the 770 series was discontinued, is with the 14.1 GB drive but I believe
at least one other IBM notebook drive (the 10GB drive?) has it.

An IDE drive reports its size to the operating system in two ways:
"geometry", meaning cylinders/heads/sectors (CHS), and a sector count
for use with linear block addressing (LBA).  CHS numbers only allow a
drive of up to 7919493120 bytes, or about 8 GB.  LBA allows much larger
capacities.

The Linux IDE driver doesn't trust the LBA sector count unless it has
to. (I assume that older drives reported incorrect LBA sector counts.)
It knows it has to use the LBA sector count if the drive reports a magic
CHS geometry: 16383/16/63, the maximum. (I know 16383*16*63*512 is not
7919493120. Don't ask.)  Every drive larger than 8GB reports this magic
geometry, and reports its true size using the LBA sector count...

... except one or two from IBM. The problem is that the 14GB drive
reports the wrong geometry: 16383/15/63. The Linux IDE driver doesn't
recognize this as magic, so it trusts the geometry and ignores the LBA
sector count. That means you can only access just under 8GB of the
drive.

I assume this is a problem with the drive firmware and not the BIOS.

Mandrake 6.0, and probably later versions, include a patch so the IDE
driver recognizes 16383/15/63 as magic. (The function that needs to be
changed is lba_capacity_is_ok in drivers/block/ide-disk.c.) A comment in
the patch blames "a TLA VBC". Redhat does not include this patch.

The correct solution to this problem is for IBM to stop making drives
with broken firmware, and to release a firmware upgrade for existing
drives. I'm not holding my breath.

| I've never studied the Linux IDE driver. I guess now is the time. Is the
| kernel mailing list the correct forum for discussing/debugging this
| problem?

You might be better off getting on the linux-kernel mailing list.


----- The Linux ThinkPad mailing list -----
The linux-thinkpad mailing list home page is at:
http://www.bm-soft.com/~bm/tp_mailing.html