second hard disk trouble

Rob Mayoff linux-thinkpad@www.bm-soft.com
Tue, 15 Jun 1999 10:01:50 -0500 (CDT)


| PIIX4: IDE controller on PCI bus 00 dev 39
| PIIX4: not 100% native mode: will probe irqs later
|     ide0: BM-DMA at 0xfcf0-0xfcf7, BIOS settings: hda:DMA, hdb:pio
|     ide1: BM-DMA at 0xfcf8-0xfcff, BIOS settings: hdc:DMA, hdd:pio
| hda: IBM-DYLA-28100, ATA DISK drive
| hdc: IBM-DCYA-214000, ATA DISK drive
| ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
| ide1 at 0x170-0x177,0x376 on irq 15
| hda: IBM-DYLA-28100, 7815MB w/459kB Cache, CHS=1058/240/63, UDMA
| hdc: IBM-DCYA-214000, 7559MB w/420kB Cache, CHS=16383/15/63, UDMA
| 
| I'm not sure if the CHS values are correct, but the size certainly isn't
| - its smaller than the 8GB drive on the primary! I'm worried that the
| Heads value is so low - this looks more like the actual value rather
| than the 'large' value that should maybe be there.

None of the CHS numbers mean anything about the actual disk geometry
these days.  The drive hides its true geometry.

| fdisk (under linux)
| seems happy to partition it to 7.5GB, but I didn't write it back. Any
| ideas what I'll need to do to fix this?

The easiest way by far is simply to use Partition Magic (4.0) to
partition the disk.  It sees the actual disk geometry.  The Linux kernel
doesn't care about the purported CHS numbers; it pays attention to the
partition table.

If you want to do it the hard way:

WARNING: I haven't tried this.  I used PM.  However, from reading the
Large Disk HOWTO and /usr/src/linux/Documentation/ide.txt, I gather that
this may work.

Run "hdparm -i /dev/hdc" (as root).  Look for LBAsects.  That should be
27609120, which is the actual number of sectors on the disk.  (Each
sector is 512 bytes; that works out to 14135869440 bytes = ~14.1GB.)

27609120 sectors / 63 sectors per head = 438240 heads
438240 heads / 240 heads per cylinder = 1826 cylinders

So you want your disk geometry to be 1826/240/63.  Add this to the
kernel command line:

	hdc=1826,240,63

One slight problem.  I don't know what will happen if you have the CDROM
(DVDROM) drive installed at boot.

The 16383/15/63 numbers are reported by the drive to mean "really big".
Unfortunately, looking at ide.c in my 2.0.36 kernel, I see that Linux
only recognizes 16383/16/63 as "really big". (Note: 15 != 16.) I don't
know why the drive reports 16383/15/63 instead. But because of that, and
because the actual drive size (LBAsects) is more than 10% larger than
the CHS indicates, Linux assumes that LBAsects is wrong and uses the
reported CHS.

I'll probably play with this a bit more after my next full backup.