Block device/ext2fs filesystem size problems in 2.0.36/2.0.38

From: Kieran (kieran@esperi.demon.co.uk)
Date: Sat Jan 15 2000 - 14:12:10 EST


I have two EIDE hard disks.

The primary master is:

# hdparm -g /dev/hda

/dev/hda:
 geometry = 784/255/63, sectors = 12594960, start = 0

The secondary master is:

# hdparm -g /dev/hdc

/dev/hdc:
 geometry = 1048/255/63, sectors = 16841664, start = 0

I am trying to create a second Linux installation on the second disk.
Unfortunately, when I get to the step involving mke2fs, the partition
size is reported wrongly. Let me show you my partition table (normal
format and expert format)

Command (m for help): p

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

   Device Boot Start End Blocks Id System
/dev/hdc1 * 1 9 72261 83 Linux
/dev/hdc2 10 73 514080 83 Linux
/dev/hdc3 74 583 4096575 5 Extended
/dev/hdc4 584 1048 3735112+ 83 Linux
/dev/hdc5 74 456 3076416 83 Linux
/dev/hdc6 457 482 208813+ 83 Linux
/dev/hdc7 483 508 208813+ 83 Linux
/dev/hdc8 509 525 136521 82 Linux swap
/dev/hdc9 526 583 465853+ 83 Linux

Command (m for help): x

Expert command (m for help): p

Disk /dev/hdc: 255 heads, 63 sectors, 1048 cylinders

Nr AF Hd Sec Cyl Hd Sec Cyl Start Size ID
 1 80 1 1 0 254 63 8 63 144522 83
 2 00 0 1 9 254 63 72 144585 1028160 83
 3 00 0 1 73 254 63 582 1172745 8193150 05
 4 00 0 1 583 254 63 1023 9365895 7470225 83
 5 00 1 1 73 254 63 455 63 6152832 83
 6 00 1 1 456 254 63 481 63 417627 83
 7 00 1 1 482 254 63 507 63 417627 83
 8 00 1 1 508 254 63 524 63 273042 82
 9 00 1 1 525 254 63 582 63 931707 83

Expert command (m for help):

My problem occurs when I try to make a filesystem on a logical partition
on the second disk. Basically, mke2fs tries to make at least one
filesystem of size 700m-800m. It can be the case that the partition is
either much bigger (~3gb) or much smaller (~200mb).

Initially, I had a large logical partition exhibiting this behaviour.
When I made this a primary partition instead, the small partition's size
was "inflated".

I have used the following program versions (among others)

# fdisk -v
fdisk v2.10b
# mke2fs
mke2fs 1.18, 11-Nov-1999 for EXT2 FS 0.5b, 95/08/09
Usage: mke2fs [-c|-t|-l filename] [-b block-size] [-f fragment-size]
        [-i bytes-per-inode] [-N number-of-inodes]
        [-m reserved-blocks-percentage] [-o creator-os] [-g
blocks-per-group]
        [-L volume-label] [-M last-mounted-directory] [-O feature[,...]]
        [-r fs-revision] [-R raid_opts] [-s sparse-super-flag]
        [-qvSV] device [blocks-count]

Any suggestions of what is going on would be most gratefully accepted. I
apologise if this is a known bug.

regards

Kieran

[[ Addendum: (from Nix <nix@esperi.demon.co.uk>)

   This was checked with lib/ext2fs/tst_getsize.c from e2fsprogs-1.18
   and a tiny program doing a similar job of our own devising, both of
   which agree that the problem is due to the BLKGETSIZE ioctl()
   returning the wrong value. It occurs to me that this may be an
   LBA-related screwup in drivers/block/ide.c:current_capacity().

   Do some drives get LBA capacity very wrong? This drive reports itself
   as

# hdparm -I /dev/hdc

/dev/hdc:

 Model=TS8324A0 , FwRev=.370 ,
SerialNo=A70Z8GBJ
 Config={ HardSect NotMFM HdSw>15uSec Fixed DTR>10Mbs RotSpdTol>.5% }
 RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=0
 BuffType=0(?), BuffSize=512kB, MaxMultSect=16, MultSect=?16?
 DblWordIO=no, maxPIO=2(fast), DMA=yes, maxDMA=2(fast)
 CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=16841664
 tDMA={min:120,rec:120}, DMA modes: mword0 mword1 mword2
 IORDY=on/off, tPIO={min:240,w/IORDY:120}, PIO modes: mode3 mode4

   but the kernel thinks it is

# hdparm -i /dev/hdc

/dev/hdc:

 Model=ST38420A, FwRev=3.07, SerialNo=7AZ0G8JB
 Config={ HardSect NotMFM HdSw>15uSec Fixed DTR>10Mbs RotSpdTol>.5% }
 RawCHS=16708/16/63, TrkSize=0, SectSize=0, ECCbytes=0
 BuffType=0(?), BuffSize=512kB, MaxMultSect=16, MultSect=off
 DblWordIO=no, maxPIO=2(fast), DMA=yes, maxDMA=2(fast)
 CurCHS=1048/255/63, CurSects=16841664, LBA=yes, LBAsects=16841664
 tDMA={min:120,rec:120}, DMA modes: mword0 mword1 mword2
 IORDY=on/off, tPIO={min:240,w/IORDY:120}, PIO modes: mode3 mode4

   I note that curCHS is being remapped, but I can't see how this could
   cause any problems. Is this drive known to be screwy with LBA? If so,
   is it possible to turn it off? ]]

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Jan 15 2000 - 21:00:26 EST