Messages in this thread Patch in this message | | | From | "Russell Coker - mailing lists account" <> | Date | Wed, 16 Jul 97 19:18:40 +1100 | Subject | Re: fdisk -l finds CD-ROM |
| |
>I don't know whether this is a kernel issue; anyway: >When I start "fdisk -l" my CD-ROM drive spins up and then fdisk reports >the same geometry for /dev/hdd (CD) as for /dev/hda (disk), but no >partition table. Is the CD-ROM drive broken, the kernel, or fdisk?
From hdparm -i /dev/hdd I get:
>Model=TOSHIBA CD-ROM XM-5602B, FwRev=1796, SerialNo=61517072 >Config={ SpinMotCtl Removable DTR<=5Mbs DTR >10Mbs nonMagnetic } >RawCHS=0/0/0, TrkSize=0, SectSize=0, ECCbytes=0 >BuffType=0(?), BuffSize=256kB, MaxMultSect=0 >...
>The kernel (2.0.29) recognizes the drive as ><4>hdd: TOSHIBA CD-ROM XM-5602B, ATAPI CDROM drive
This is a bug in the fdisk program, if the HDIO_GETGEO ioctl call fails then it takes the values from the previous successful call. Here is a patch for fdisk to solve this:
--- fdisk.c.old Wed Jul 16 18:29:48 1997 +++ fdisk.c Wed Jul 16 19:16:22 1997 @@ -476,7 +476,13 @@ sector_offset = sectors; warn_cylinders(); } - else update_units(); + else + { + heads = 0; + sectors = 0; + cylinders = 0; + update_units(); + } warn_geometry();
for (i = 0; i < 4; i++)
That patch will cause your CD to be identified as having 0 heads, 0 cylinders, and 0 sectors (which IMHO is better than returning spurious data).
Russell Coker
| |