Subject: 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 00:30:14
I've got an 18GB disk in my thinkpad 600X running 1.6I.  The machine
also boots windows2000.  I've got windows2000 in a 4GB partition at
the front of the disk, and then i've got netbsd in a 10GB partition
after that.  My plan is to fill up the rest of the disk with a dos
partition.

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.

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.

I guess that since disklabel has the right values, the system is OK.
aI wonder whether the solution to this problem somehow involves
affirmatively answering this question posed by fdisk -u:

  "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.

-russ


Here is the fdisk output:

mingus:/root [13] # 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>



Here is the disklabel output:

mingus:/root [17] # disklabel wd0
# /dev/rwd0d:
type: unknown
disk: mydisk
label: 
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 16
sectors/cylinder: 1008
cylinders: 16383
total sectors: 39070080
rpm: 3600
interleave: 1
trackskew: 0
cylinderskew: 0
headswitch: 0           # microseconds
track-to-track seek: 0  # microseconds
drivedata: 0 

8 partitions:
#        size    offset     fstype  [fsize bsize cpg/sgs]
 a:    567504   8179920     4.2BSD   1024  8192    16   # (Cyl. 8115 - 8677)
 b:   1050336   8747424       swap                      # (Cyl. 8678 - 9719)
 c:  20480544   8179920     unused      0     0         # (Cyl. 8115 - 28432)
 d:  39070080         0     unused      0     0         # (Cyl.    0 - 38759)
 e:  10670688   9797760     4.2BSD   1024  8192    16   # (Cyl. 9720 - 20305)
 f:   4095504  20468448     4.2BSD   1024  8192    16   # (Cyl. 20306 - 24368)
 g:   4096512  24563952     4.2BSD   1024  8192    16   # (Cyl. 24369 - 28432)

here is the dmesg output:

mingus:/root [21] # dmesg |grep wd
wd0 at pciide0 channel 0 drive 0: <IBM-DJSA-220>
wd0: drive supports 16-sector PIO transfers, LBA addressing
wd0: 19077 MB, 16383 cyl, 16 head, 63 sec, 512 bytes/sect x 39070080 sectors
wd0: 32-bit data port
wd0: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 4 (Ultra/66)
wd0(pciide0:0:0): using PIO mode 4, Ultra-DMA mode 2 (Ultra/33) (using DMA data transfers)
boot device: wd0
root on wd0a dumps on wd0b