Hello,
The code that causes the "reset" of the sector-size is in
'drivers/block/genhd.c'
/*
* The Linux code now honours the rules the MO people set and
* is 'DOS compatible' - sizes are scaled by the media block
* size not 512 bytes. The following is a backwards
* compatibility check. If a 1k or greater sectorsize disk
* (1024, 2048, etc) was created under a pre 2.2 kernel,
* the partition table wrongly used units of 512 instead of
* units of sectorsize (1024, 2048, etc.) The below check attempts
* to detect a partition table created under the older kernel, and
* if so detected, it will reset the a sector scale factor to 1 (i.e.
* no scaling).
*/
disk_number_of_sects = NR_SECTS((&hd->part[MINOR(dev)]));
for (i = 0; i < 4; i++) {
char buf[MAX_DISKNAME_LEN];
struct partition *q = &p[i];
printk(" %s: -bmg- first_sector= %d\n",
disk_name(hd, MINOR(dev), buf), first_sector);
printk(" %s: -bmg- start_sector= %d\n",
disk_name(hd, MINOR(dev), buf), START_SECT(q));
printk(" %s: -bmg- nr_sector= %d\n",
disk_name(hd, MINOR(dev), buf), NR_SECTS(q));
printk(" %s: -bmg- sector_size= %d\n",
disk_name(hd, MINOR(dev), buf), sector_size);
printk(" %s: -bmg- disk_number_of_sects=%d\n",
disk_name(hd, MINOR(dev), buf), disk_number_of_sects);
if (NR_SECTS(q)) {
if (((first_sector+(START_SECT(q)+NR_SECTS(q))*sector_size) >
(disk_number_of_sects+1)) &&
((first_sector+(START_SECT(q)+NR_SECTS(q)) <=
disk_number_of_sects))) {
printk(" %s: RESETTINGING SECTOR SCALE from %d to 1",
disk_name(hd, MINOR(dev), buf), sector_size);
sector_size=1;
break;
}
}
}
(the printk's with '-bmg-' are from me) It gives this output if I try
to mount a MO:
sda: -bmg- first_sector= 0
sda: -bmg- start_sector= 1
sda: -bmg- nr_sector= 1241087
sda: -bmg- sector_size= 4
sda: -bmg- disk_number_of_sects=1241408
sda: RESETTINGING SECTOR SCALE from 4 to 1 sda1
'nr_sector' and 'disk_number_of_sects' seems to be in 512 bytes
blocks, while the MO is 2048 bytes hardsectored, which corresponds
with the 'sector_size' of 4.
MfG
bmg
--
"Des is v�llig wurscht, was heut beschlos- | M G Berberich
sen wird: I bin sowieso dagegn!" | [EMAIL PROTECTED]
(SPD-Stadtrat Kurt Schindler; Regensburg) | www.fmi.uni-passau.de/~berberic
PGP signature