Bug 124301 - kernel reports odd disk geometry
kernel reports odd disk geometry
Status: CLOSED NEXTRELEASE
Product: Fedora
Classification: Fedora
Component: kernel (Show other bugs)
2
i386 Linux
medium Severity high
: ---
: ---
Assigned To: Dave Jones
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-05-25 11:03 EDT by Louis CARNAPETE
Modified: 2015-01-04 17:06 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-04-16 01:54:28 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Louis CARNAPETE 2004-05-25 11:03:15 EDT
Description of problem:

Since I upgraded my Fedora Core 1 to Fedora Core 2, I am experiencing
some trouble handling disk partitions. Partitionning tools reported
some trouble with disk geometry and was unable to boot Wind*ws XP
properly.
I then used Fedora Core 1 install disk to save, repartition, format
and restore data.
Now all works fine but I noticed some very strange things:

at boot *kernel* reported:
hda: 156301488 sectors (80026 MB) w/2048KiB Cache, CHS=65535/16/63,
UDMA(100)

*hdparm* reported the same buggy geometry:
[root@goldorak linux]# hdparm -g /dev/hda
/dev/hda:
 geometry     = 65535/16/63, sectors = 156301488, start = 0
Version-Release number of selected component (if applicable):

*sfdisk* reported:
[root@goldorak linux]# sfdisk -g /dev/hda
/dev/hda: 155061 cylindres, 16 têtes, 63 secteurs/piste
what means C,H,S=155061,16,63

fdisk reported:
[root@goldorak linux]# fdisk -l /dev/hda
Disque /dev/hda: 80.0 Go, 80026361856 octets
255 têtes, 63 secteurs/piste, 9729 cylindres
Unités = cylindres de 16065 * 512 = 8225280 octets
what means C,H,S=9729,255,63 the pretty good one. Wind*ws
partitionning tools also showed the same one.

I then rebooted the system using Fedora Core 1 disk and kernel 2.4.x
reported C,H,S=9729,255,63 what is right.

Using 2.6.6 kernel from kernel.org reported the same ugly
C,H,S=65535,16,63 as 2.6.5-1.358 did

How reproducible:

allways

Steps to Reproduce:
1. boot using 2.6.x kernel
2. use partition tools: fdisk, sfdisk, parted, hdparm, dmesg to see
disk geometry
3. kernel reports buggy number of cylinders
  
Actual results:

2.6.5-358 kernel reports max number of cylinders set to 65535

Expected results:

kernel reports a valid geometry

Additional info:
Comment 1 Robert MacRae 2004-10-08 17:54:05 EDT
I had this problem too - caught me completely by surprise. In reading 
the drive geometry the kernel appears to be translating the CHS 
numbers so they are in the form C,16,36. Since most large, modern 
drives report C,255,63 this mean multiplying the C value by 
255/16=15.9375. But this is not an integer so it is rounded up or 
down. That makes the drive look like a small drive and the BIOS then 
does not report it using LBA. The linear cylinder index seems not to 
be messed with and the kernel refers only to that in addressing the 
drive, so data isn't lost. However, utilities such as Partition Magic 
find conflicting information and refuse to access the drive. It is a 
mystery to me why the coders for this version reverted to the old CHS 
geometry of obsolete drives - there are very few small drives still 
in use.

Here is the workaround. First boot using the command "linux 
hda=C,H,S" where these are the values reported by your drive. Then 
the Druid will use these in setting up the partition. Next use the 
option "Force LBA32" when it comes up in the install. This will 
prevent the kernel from again translating the correct CHS values to 
C,16,63 and messing things up again.

This isn't really a bug, but it is a really stupid bit of programming.

 
Comment 2 Dave Jones 2005-04-16 01:54:28 EDT
Fedora Core 2 has now reached end of life, and no further updates will be
provided by Red Hat.  The Fedora legacy project will be producing further kernel
updates for security problems only.

If this bug has not been fixed in the latest Fedora Core 2 update kernel, please
try to reproduce it under Fedora Core 3, and reopen if necessary, changing the
product version accordingly.

Thank you.

Note You need to log in before you can comment on or make changes to this bug.