Subject: partitioning MS-DOS problems -- aargh!
To: None <current-users@NetBSD.ORG, port-i386@NetBSD.ORG>
From: Ian Fitchet <I.D.Fitchet@fulcrum.co.uk>
List: current-users
Date: 10/19/1994 20:09:22
Hi,

	Sorry this is so long, but I hope it contains enough
information.

	Having solved my vnode and mouse problems (it seems I should
declare my PS/2 mouse as a BusMouse...) we now have problems with my
colleague's machine in partitioning his disk.  This affects me as well
as I'd like to use the wasted space on my second drive (300MB or so).

	We have the following MS-DOS "truths":

using a WD2540, (1048cyl) (btw, NetBSD probes this quite happily on booting)

before partitioning:

FIPS version 1.1, Copyright (C) 1993/94 Arno Schaefer

[...fips legend...]

Partition Table:

     |        |     Start      |      |      End       | Start  |Number of|
Part.|bootable|Head Cyl. Sector|System|Head Cyl. Sector| Sector |Sectors  |  MB
-----+--------+----------------+------+----------------+--------+---------+----
1    |    yes |   1    0      1|   06h|  31  522     63|      63|  1054305| 514
2    |     no |   0    0      0|   00h|   0    0      0|       0|        0|   0
3    |     no |   0    0      0|   00h|   0    0      0|       0|        0|   0
4    |     no |   0    0      0|   00h|   0    0      0|       0|        0|   0

[...]


and after partioning:

Partition Table:

     |        |     Start      |      |      End       | Start  |Number of|
Part.|bootable|Head Cyl. Sector|System|Head Cyl. Sector| Sector |Sectors  |  MB
-----+--------+----------------+------+----------------+--------+---------+----
1    |     no |   0    0      0|   00h|   0    0      0|       0|        0|   0
2    |     no |   0    0      0|   00h|   0    0      0|       0|        0|   0
3    |    yes |   1    0      1|   06h|  31  217     63|      63|   439425| 214
4    |     no |   0  218      1|   A5h|  31  522     63|  439488|   614880| 300


	MS-DOS can see the second partition and will use it quite happily.

	(the system type `0xa5' had to be munged in by hand --
pointers to .exes to do it for you, gratefully received)


	before you howl wildly at me, the procedure fails whether the
NetBSD portion is bootable or not.



	Using the new floppies (ftp'd - he didn't trust mine, hmph)
the bootstrap procedure runs fine, info passed in is:

IDE, wd0, mywd, 512 b/sect, 1048 cyl, 16 heads, 63 sect/track, 614880
sectors for NetBSD, offset at sect 439488, 40000 sects for root and
swap, and 534880 sect (the rest) on /usr

	then, at the `LAST CHANCE' prompt, on typing `yes' we get:

labelling disk wd0...wd0: wdcontrol: geometry failed: status 0 error 0
wd0: wdcontrol: geometry failed: status 0 error 0
wd0: wdcontrol: geometry failed: status 0 error 0
wd0: wdcontrol: geometry failed: status 0 error 0
wd0: wdcontrol: geometry failed: status 0 error 0
wd0d: hard error reading fsbn 0 (wd0 bn 0; cn 0 tn 0 sn 0)wd0: cannot
find label (dos partition I/O error)
wd0: wdcontrol: geometry failed: status 0 error 0
wd0: wdcontrol: geometry failed: status 0 error 0
wd0: wdcontrol: geometry failed: status 0 error 0
wd0: wdcontrol: geometry failed: status 0 error 0
wd0: wdcontrol: geometry failed: status 0 error 0done

Initializing root filesystem, and mounting
[...mkfs output...]

[...]

#


	NB, if you interrupt this or try the installation again
(without resetting the partition table), after the `LAST CHANCE'
prompt you get:

labelling disk wd0...overwriting disk with DOS partition label (n):

	which if you respond with `y' goes immediately to the mkfs
stage.



	Now, oddly enough, NetBSD has trashed the partition table,
fips says (including the Error):

Partition Table:

     |        |     Start      |      |      End       | Start  |Number of|
Part.|bootable|Head Cyl. Sector|System|Head Cyl. Sector| Sector |Sectors  |  MB
-----+--------+----------------+------+----------------+--------+---------+----
1    |     no |   0    0      0|   00h|   0    0      0|       0|        0|   0
2    |     no |   0    0      0|   00h|   0    0      0|       0|        0|   0
3    |     no |   0    0      0|   00h|   0    0      0|       0|        0|   0
4    |    yes |   0    0      1|   A5h| 255 1023     63|       0|    50000|  24

Error: Invalid End Head: partition 4: 255



	Just to keep you happy, problems that *I* see with NetBSD and
MS-DOS drives (fortunately I have two WD2540s :-) )

 I can mount /dev/fd0a as a msdos device and copy stuff from it (hence
the output from fips) but disklabel says:

disklabel: ioctl DIOCGDINFO: Invalid argument

 I can't mount /dev/wd1?, mount says:

msdos: mount: Invalid argument

 but disklabel (only for wd1 or wd1d -- presumably for the
inconsistent reasons currently being discussed) says:

Warning, DOS partition table with no valid NetBSD partition
# /dev/rwd1d:
type: ST506
disk: 
label: 
flags:
bytes/sector: 512
sectors/track: 17
tracks/cylinder: 8
sectors/cylinder: 136
cylinders: 1024
rpm: 0
interleave: 0
trackskew: 0
cylinderskew: 0
headswitch: 0           # milliseconds
track-to-track seek: 0  # milliseconds
drivedata: 0 

4 partitions:
#        size   offset    fstype   [fsize bsize   cpg]
  d: 536870911        0    unused        0     0        # (Cyl.    0 - 3947580*)
Warning, revolutions/minute 0

boot block size 0
super block size 0
partition d: partition extends past end of unit


 For comparision my NetBSD drive has:

# /dev/rwd0d:
type: ST506
disk: my-wd
label: 
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 16
sectors/cylinder: 1008
cylinders: 1048
rpm: 4500
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:    40000        0    4.2BSD     1024  8192    16   # (Cyl.    0 - 39*)
  b:    38000    41000      swap                        # (Cyl.   40*- 78*)
  c:  1056384        0    unused        0     0         # (Cyl.    0 - 1047)
  d:  1056384        0    unused        0     0         # (Cyl.    0 - 1047)
  e:   976384    80000    4.2BSD     1024  8192    16   # (Cyl.   79*- 1047*)




 We are completely lost now, having tried options a-plenty, so, if
anyone has any clues...thanks in abundance.

Cheers,

	Ian

-------------------------------------------------------------------------------
      Ian Fitchet			I.D.Fitchet@fulcrum.co.uk
  Fujitsu Fulcrum Telecommunications ltd., Fordrough Lane, Birmingham, B9 5FL