Subject: Re: how to add a partition beyond BIOS cylinder 1024
To: None <netbsd-help@netbsd.org>
From: Russell McManus <russell_mcmanus@yahoo.com>
List: netbsd-help
Date: 06/15/2003 23:35:41
david@l8s.co.uk (David Laight) writes:

> > fdisk won't let me add the dos partition: when I specify where the dos
> > partition should be, fdisk thinks that these locations are off the
> > disk, and resets the values so that they live inside the 1024
> > cynlinder boundary.
> > 
> > I guess that since the partition I want to add is past the first 1024
> > cylinders, no go.
> 
> That really shouldn't be a problem.
> Which version of fdisk are you running? (objdump -j .ident -s /sbin/fdisk)

It appears to be fdisk.c 1.55

mingus:/root [2] # objdump -j .ident -s /sbin/fdisk

/sbin/fdisk:     file format elf32-i386

Contents of section .ident:
 0000 244e6574 4253443a 20637274 302e632c  $NetBSD: crt0.c,
 0010 7620312e 31322032 3030312f 31322f33  v 1.12 2001/12/3
 0020 30203233 3a32333a 33382074 686f7270  0 23:23:38 thorp
 0030 656a2045 78702024 00244e65 74425344  ej Exp $.$NetBSD
 0040 3a206664 69736b2e 632c7620 312e3535  : fdisk.c,v 1.55
 0050 20323030 322f3039 2f323720 32333a31   2002/09/27 23:1
 0060 393a3536 2064626a 20457870 202400    9:56 dbj Exp $. 

> What does sysctl machdep.diskinfo report?

I get no output from "sysctl machdep.diskinfo"

> What is the output of 'fdisk wd0'?

mingus:/root [10] # fdisk wd0
Disk: /dev/rwd0d
NetBSD disklabel disk geometry:
cylinders: 16383 heads: 16 sectors/track: 63 (1008 sectors/cylinder)

BIOS disk geometry:
cylinders: 1023 heads: 240 sectors/track: 63 (15120 sectors/cylinder)

Partition table:
0: sysid 7 (OS/2 HPFS or NTFS or QNX2 or Advanced UNIX)
    start 63, size 8179857 (3994 MB), flag 0x0
        beg: cylinder    0, head   1, sector  1
        end: cylinder  540, head 239, sector 63
1: sysid 169 (NetBSD)
    start 8179920, size 20480544 (10000 MB), flag 0x80
        beg: cylinder  541, head   0, sector  1
        end: cylinder 1022, head 239, sector 63
2: <UNUSED>
3: <UNUSED>


> > Now that I started looking at this stuff, I noticed that the disklabel
> > and fdisk information does not appear to match, either.  Not only does
> > fdisk not allow me to add the dos partition, but it is also convinced
> > that the netbsd partition is partially off the disk.
> 
> The disklabel and fdisk are largely independant of each other.
> The disklabel is stored at the beginning of the netbsd fdisk partition,
> but otherwise is independant of it.
> fdisk doesn't depend on the contents of the disklabel in any way.
> 
> >   "Do you want to change our idea of what BIOS thinks? [n]"
> > 
> > But I've never had to do this before however, so I'm wondering if I'm
> > doing something simple wrong.  Thanks for any ideas.
> 
> It is very doubtful that any answers to that question will have any
> effect except that they may make the disk unbootable.

I did not know that disklabel and fdisk were largely independent.

-russ