[NTLUG:Discuss] Re: grub loader messing with my head -- Buggy BIOSes are the problem

Bryan J. Smith b.j.smith at ieee.org
Thu Sep 16 11:39:34 CDT 2004


On Thu, 2004-09-16 at 11:02, Stuart Johnston wrote:
> SUSE 9.1 uses 2.6 kernel, right?  Does it have the same problem with 
> partition tables and drive geometry that other 2.6 based installers do 
> (FC2 for example)?  In this case you probably didn't make any changes to 
> the main disk's partition table so it shouldn't be a problem but it may 
> be something to keep in mind if the fixmbr doesn't work.  (It really 
> messed me up recently, with Debian.)

It requires:  

A) A non-compliant, pre-1997** Extended Int13h BIOS
(up to 16 heads, no LBA/255 heads support)

B) NT4 SP4 or later with LBA, including NT 5.x (2000, XP, 2003)
(always forces LBA 255 heads)

C) You let parted create your partition table
(most 2.6 distro installers do this now, because parted is powerful)

[**NOTE:  Several OEMs have _failed_ to fix their buggy, post-1997 BIOS
versions *COUGH*IBM*COUGH* and still do _not_ support LBA/255 heads with
compliant Extended Int13h services. ]

The problem stems from the fact that Linux 2.6/parted has to "assume" NT
is using LBA.  Previously, Linux/2.4 did this by default, in total
breakage of ATA/Extended Int13h standards.  So because Linux 2.6 is more
standards compliant it is now an issue.

It's a catch-22.  The old "assume" NT is using LBA approach means it
works with _many_ dual-boots, but it can _break_ newer systems --
especially beyond the 128GiB (133GB) limit.  Furthermore, LBA has a
"hard limit" at 2TiB (2,048GiB).

The funny thing is that dual-booting _any_ MS-DOS (including 95, 98 or
ME) version on the same system would be _impossible_, and different NT
versions _may_ conflict over the geometry when "BIOS/DOS disk labels"
(aka "standard disks" -- i.e., primary/logical).  That's one of the (at
least) four major reasons Microsoft created the "LDM disk label"
("dynamic disks"), so the assumed geometry of any NT 5.x+ installation
can be read by any another NT 5.x+ install.

The "good news" is that the Linux kernel understands the "LDM disk
label," _including_ reading this geometry.  That way it doesn't need to
"assume" LBA is being used when the BIOS implementation is buggy.

For more on the "final workaround" I've suggested, see this summary in
Red Hat bugzilla:  
  https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=115980#c147  

IMHO, anytime you dual-boot NT 5.x and Linux, you should install NT 5.x
first and create a "dynamic disk."  Then reserve space on it for Linux. 
The problem is that you must manually modify the partition table outside
any current distribution's installer (Partition Magic, various tools
from the Linux-LDM/NTFS project, etc...), and then you are forced to use
LILO as your boot-loader as GRUB doesn't understand LDM disk labels yet.

-- Bryan

P.S.  Buggy BIOSes return 240 heads when 255 LBA translation is used. 
It has to do with the bit-wise format.  These BIOSes only support 5-bits
for the number of heads.  16 in 5-bit is 10000.  Extended Int13h
services uses 8-bits for number of heads.  As such, when these buggy
BIOSes go to return 8-bits, they "borrow" the lower 3-bits from the
sectors per cylinder field.  This is a 6-bit value, commonly, 63.  63 in
6-bit is 111111.  So putting the last 3 bits plus the 5-bit for heads
results in 11110000 which is 240.

This is what the buggy BIOS returns to Linux via standard ATA/Extended
Int13h services.  In the old model, Linux 2.4 assumed LBA if it saw it. 
But that can cause issues with larger disks -- and even more so on
non-x86 platforms.  Even different versions of NT may conflict on the
LBA geometry (this is funny to see first hand, which I have for years
now ;-) -- and DOS/Win will completely _refuse_ to boot if the BIOS and
partition table do not match 100% (and typically screws up actual disk
sectors -- Linux 2.6/parted only screws up the partition table ;-).

Again, the workaround is to leverage LDM disk labels.  Microsoft created
them for a damn good reason.  To solve disk geometry/translation
nightmares, so any NT (or even Linux) can read the _exact_ disk geometry
being assumed in a partition table and select partitions.


-- 
     Linux Enthusiasts call me anti-Linux.
   Windows Enthusisats call me anti-Microsoft.
 They both must be correct because I have over a
decade of experience with both in mission critical
environments, resulting in a bigotry dedicated to
 mitigating risk and focusing on technologies ...
           not products or vendors
--------------------------------------------------
Bryan J. Smith, E.I.         b.j.smith at ieee.org





More information about the Discuss mailing list