2048 patch for 2.0.x confuses fdisk

Marc Merlin (marc_merlin@magic.metawire.com)
Sun, 19 Apr 1998 20:06:33 -0700


Hi,

I have one of those weird hard drives (actually two):
MICROP 1991-27 (614X) 9gigs.
The weird part is the 2K sector size.

So, I got the 2K sector patch from
http://wwwcip.informatik.uni-erlangen.de/~orschaer/mo/
(it seemed more complete than the one at
http://liniere.t.u-tokyo.ac.jp/2048.html, and also because it was the one
merged into 2.1.32)

Anyway, I merged the patch into 2.0.33, linux recognizes the disk, I was
able to create a couple of partitions, put data on them, yadada, yadada.

But:

> moremagic:~$ df
> Filesystem 1024-blocks Used Available Capacity Mounted on
> (...)
> /dev/sdd1 2031040 1636190 373880 81% /backup
> /dev/sdd2 4061952 3229450 790560 80% /backup/mnt

(Note that one is a 2gig partition and the other one a 4gig one)

But fdisk says:

> Disk /dev/sdd: 64 heads, 32 sectors, 9350 cylinders
> Units = cylinders of 2048 * 512 bytes
>
> Device Boot Begin Start End Blocks Id System
> /dev/sdd1 1 1 512 524272 83 Linux native
> /dev/sdd2 513 513 1536 1048576 83 Linux native

fdisk is confused about the cylinder count (it's multiplied by four).
However, obviously each cylinder countains 4Megs and not 1Meg (like fdisk
thinks).

moremagic:~# scsiinfo -g /dev/sdd

Data from Rigid Disk Drive Geometry Page
----------------------------------------
(...)
Number of cylinders 4476
Number of heads 27

But then, I suppose it's not too relevant, only what the SCSI card says
(after the translation) matters

moremagic:~# fdisk -v
fdisk v2.1 (>4GB)

No big deal really, once you know it.

However, the problem happened when I tried to create the third partition:
> Command (m for help): n
> Command action
> e extended
> p primary partition (1-4)
> p
> Partition number (1-4): 3
> First cylinder (1537-9350): 1537
> Last cylinder or +size or +sizeM or +sizeK ([1537]-9350): 2337
>
> Command (m for help): p
>
> Disk /dev/sdd: 64 heads, 32 sectors, 9350 cylinders
> Units = cylinders of 2048 * 512 bytes
>
> Device Boot Begin Start End Blocks Id System
> /dev/sdd1 1 1 512 524272 83 Linux native
> /dev/sdd2 513 513 1536 1048576 83 Linux native
> /dev/sdd3 1024 1537 2337 820224 83 Linux native
^^^^

The problem as you see is that the partition begins in the middle of the
other one (begin field), while the start field has the value I wanted. Is
the start field = begin field + offset (as shown in the partition table)?

Am I correct in assuming that if I write the partition table and create a
filesystem on sdd3, it will start at cylinder 1024, and ruin my second
partition?

If so, is there anything I can do to convince fdisk to do the right thing,
or at least to create a third partition with the remaining space on the
disk?

Thanks,
Marc

-- 
Home page: http://magic.metawire.com/~merlin/ (browser friendly)
Finger merlin@magic.metawire.com for PGP key (key id 763BE901)
***** "God is real, unless declared integer." *****

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu