Bug 57892 - fdisk gets wrong geometry of parallel port IDE disk
fdisk gets wrong geometry of parallel port IDE disk
Status: CLOSED DUPLICATE of bug 56638
Product: Red Hat Linux
Classification: Retired
Component: util-linux (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Elliot Lee
Ben Levenson
Depends On:
  Show dependency treegraph
Reported: 2001-12-30 22:56 EST by David Wilson
Modified: 2007-04-18 12:38 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2001-12-30 22:56:14 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description David Wilson 2001-12-30 22:56:10 EST
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)

Description of problem:
fdisk appears (from a quick strace) to use the HDIO_GETGEO_BIG ioctl to 
get the geometry of drives. The pd driver does not implement this ioctl 
but does implement HDIO_GETGEO so fdisk should fall back if the _BIG 
version fails.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. attach a parallel port hard disk drive
2. modprobe epat (my enclosure uses this chipset)
3. modprobe pd
4. fdisk -l
5. fdisk /dev/pda (same geometry errors as fdisk -l)

Actual Results:  Disk /dev/pda: 1 heads, 4224528 sectors, 1 cylinders
Units = cylinders of 4224528 * 512 bytes

   Device Boot    Start       End    Blocks   Id  System
/dev/pda1             1         1   2096608+   6  FAT16
Partition 1 has different physical/logical beginnings (non-Linux?):
     phys=(0, 1, 1) logical=(0, 0, 64)
Partition 1 has different physical/logical endings:
     phys=(519, 127, 63) logical=(0, 0, 4193280)
Partition 1 does not end on cylinder boundary:
     phys=(519, 127, 63) should be (519, 0, 4224528)

Disk /dev/hda: 255 heads, 63 sectors, 2432 cylinders
Units = cylinders of 16065 * 512 bytes

   Device Boot    Start       End    Blocks   Id  System
/dev/hda1   *         1         6     48163+  83  Linux
/dev/hda2             7      1024   8177085    5  Extended
/dev/hda5             7        72    530113+  82  Linux swap
/dev/hda6            73       327   2048256   83  Linux

Expected Results:  Disk /dev/pda: 16 heads, 63 sectors, 4191 cylinders
Units = cylinders of 1008 * 512 bytes

etc etc

Additional info:

Note that this drive was actually partitioned with 523/128/63 as its 
geometry as this is what the DOS device driver uses. As pd.c does not do 
the same fixups on the partition table that ide.c does fdisk will always 
get this wrong (unless I can get the pd.c maintainer to add PTBL fixups to 
pd.c). None the less, fdisk should be fixed so that ioctl failures are 
detected and worked around (or at least reported to the user).
Comment 1 David Wilson 2002-01-01 18:46:37 EST
Looks like this is the same problem as bug 56638 (fdisk problem with cpqarray).
cpqarray does not have HDIO_GETGEO_BIG ioctl either.

Building a standard fdisk from util-linux-2.11n.tar.gz results in working fdisk 

*** This bug has been marked as a duplicate of 56638 ***

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