Subject: Partition troubles
To: 'NetBSD/i386 list' <port-i386@NetBSD.ORG>
From: Gunnar Helliesen <gunnar@bitcon.no>
List: port-i386
Date: 05/26/1998 04:35:13
I'm trying to update the partition ID on my disk to the new ID after
upgrading to -current. I'm having some problems figuring out how to do
this without messing up the disk. I have built a new biosboot.sym and
installed it with installboot(8).

Matthias Drochner wrote a while back:

> -with "fdisk -u", change the partition ID from 165 to 169

When I run fdisk(8) it seems to have a weird notion of my partition
layout:


# fdisk
******* Working on device /dev/rwd0d *******
Warning: BIOS sector numbering starts with sector 1
parameters extracted from in-core disklabel are:
cylinders=2482 heads=16 sectors/track=63 (1008 sectors/cylinder)

Figures below won't work with BIOS for partitions not in cylinder 1
parameters to be used for BIOS calculations are:
cylinders=2482 heads=16 sectors/track=63 (1008 sectors/cylinder)

Information from DOS bootblock is:
0: <UNUSED>
1: <UNUSED>
2: <UNUSED>
3: sysid 169 (NetBSD)
    start 0, size 50000 (24 MB), flag 0x80
        beg: cylinder    0, head   0, sector  1
        end: cylinder 1023, head 255, sector 63


I don't have a 24 MB partition and the kernel still reports "WARNING:
old BSD partition ID!".

disklabel(8) sez:


# disklabel -r wd0
disklabel: warning, DOS partition table with no valid NetBSD partition
# /dev/rwd0d:
type: ST506
disk: mywd
label: 
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 16
sectors/cylinder: 1008
cylinders: 2482
total sectors: 2501856
rpm: 3600
interleave: 1
trackskew: 0
cylinderskew: 0
headswitch: 0           # milliseconds
track-to-track seek: 0  # milliseconds
drivedata: 0 

5 partitions:
#        size   offset    fstype   [fsize bsize   cpg]
  a:   131040        0      4.2BSD     1024  8192    16   # (Cyl.    0 -
129)
  b:   262080   131040        swap                        # (Cyl.  130 -
389)
  c:  2501856        0      unused        0     0         # (Cyl.    0 -
2481)
  d:  2501856        0      unused        0     0         # (Cyl.    0 -
2481)
  e:  2108736   393120      4.2BSD     1024  8192    16   # (Cyl.  390 -
2481)


The disk is not autoconfigured by the BIOS but set up with LBA
translation off. The BIOS summary screen reports the disk as 2482/16/63
LBA OFF, even so the kernel reports:


wd0 at wdc0 drive 0: <Seagate Technology 1275MB - ST31276A>
wd0: using 16-sector 16-bit pio transfers, lba mode
wd0: 1221MB, 2502308 sec, 512 bytes/sec


Is this the cause of my problems?

There is nothing but NetBSD on the disk and the DOS partition layout was
created for me by the install script when I first installed NetBSD
(version 1.2? Can't remember). The system still boots just fine and all
my NetBSD ffs partitions are there. I'd like to keep it that way (no
backup... :-( )

Now what?

I'm sorry if this is just me being stupid, but all this partition and
geometry translation stuff is giving me a headache. I'd rather not have
to deal with this DOS partition mess, I want to use my machines for
NetBSD and nothing else. Why does NetBSD/i386 have to mess with DOS
partitions at all? If someone wants to install both Messy-DOG/Winlose
and NetBSD on the same disk let them deal with DOS partitions, leave
them out for the rest of us. A disk should be a disk from sector 0 to
sector n, just like on the other ports. Or is this some BIOS limitation
that we need to have DOS partitions in the boot blocks? I can live with
keeping NetBSD partition "a" under cylinder 1024, but do we really need
to mess with DOS partitions?

OK, I'm grumpy, I need some sleep. ;-)

Gunnar

--
Gunnar Helliesen   | Bergen IT Consult AS  | NetBSD/VAX on a uVAX II
Systems Consultant | Bergen, Norway        | '86 Jaguar Sovereign 4.2
gunnar@bitcon.no   | http://www.bitcon.no/ | '73 Mercedes 280 (240D)