[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Detected hard disk geometry changed after installing FC2T2



shrek-m gmx de wrote:

Hervé Pagès wrote:

[...] 2. DURING install of FC2T2, I get the following warning :

   "Unable to align partition properly. This probably means that another
    partioning tool generated an incorrect partition table, because it
    didn't have the correct BIOS geometry. It is safe to ignore,
    but ignoring may cause (fixable) problems with some boot loaders".

After that DiskDruid displays a strange partition tables containing
some small free spaces (< 1 cyl. each) beetween my partitions.
[...] 4. With "Access Mode" set to "Auto", Windows XP (/dev/hda1) doesn't
boot anymore. (It did boot before installing FC2T2).
With "Access Mode" set to "LBA", it does boot again. [...]

http://www.redhat.com/archives/fedora-test-list/2004-April/msg00138.html [...] Mandrake faced with some thing similar with Linux 2.6



http://qa.mandrakesoft.com/show_bug.cgi?id=7959#c21
####snip####
------- /Additional Comment #21 <http://qa.mandrakesoft.com/show_bug.cgi?id=7959#c21> From Pascal Rigaux <mailto:pixel mandrakesoft com> 2004-03-18 00:50 / -------


At last someone here reproduced the bug which is now fully explored.

Part of the reason I could not understand the bug, is that I could not
believe windows XP was still using the error prone int13 function 2
(CHS based) instead of the (available everywhere for some time) int13
function 0x42. Under linux, grub and lilo only use function 2 when
function 0x42 fails (they don't even ask the BIOS if it manages 0x42
since some BIOS don't report correctly having this functionality, cf
FORCE_LBA in grub)

The other reason is that I thought BIOS faking heads number (the
so-called LBA mode) was a choice independant of the content of the
drive. This is wrong, the BIOS tries to adapt its mode based on the
partition table [1]

So here is what happened:
- kernel 2.6 doesn't try to give the logical geometry, and gives the
 physical geometry instead [2]
- diskdrake uses the physical geometry to generate the CHS information
 (which is a broken duplicate of the linear sector number)
- the BIOS sees the partition table uses a different CHS geometry, and
 adapt to it
- ... and Windows computes the CHS to read its stage1.5 based on the
 previous geometry that it keeps in its boot sector. Alas the CHS
 doesn't get the same sector and Windows's boot dies (with very bad
 error detection) [3]


Bug occurence: the pb only occurs when you modify the partition table, since otherwise diskdrake won't write it.


Code fix description: inspired by the way new fdisk and parted detects the logical geometry based on the partition table [4]. parted code is especially quite robust. The fix is now included in cooker (DrakX #1.912), so:

 I still would like to access the BIOS geometry, esp. for empty
 partition tables. But kernel 2.6 doesn't give us this
 (/sys/firmware/edd/int13_dev80/default_heads is plain wrong on a box
 here)


Known workaround: forcing LBA mode in the BIOS



Fixing partition table: with diskdrake from drakxtools-10-24mdk do % diskdrake --change-geometry=hda=255,63 where - you replace hda with your drive device - if Windows still fails, try adapting 255,63 to your drive LBA emulation. For this, see what is the geometry your BIOS gives when forcing LBA emulation

[1] http://www.ussg.iu.edu/hypermail/linux/kernel/0311.3/1142.html
[2] http://www.ussg.iu.edu/hypermail/linux/kernel/0311.3/0898.html
[3] http://www.ussg.iu.edu/hypermail/linux/kernel/0311.3/1029.html
[4] http://www.ussg.iu.edu/hypermail/linux/kernel/0311.3/1164.html

####snap####


-- shrek-m



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]