Subject: How to install/config a new HD in NetBSD
To: None <netbsd-users@netbsd.org>
From: Jurriaan de Boer <jfdeboer@support.euronet.nl>
List: netbsd-users
Date: 04/26/2000 21:53:43
Hi,

I've just installed NetBSD 1.4.2 on my old Pentium-90 system,
I installed it on a 800MB HD (Base install of NetBSD is under 200MB :).

I just hooked up a second harddrive (as primary device on the secondary
controller). It's a 4,3GB Seagate (ouch o:) harddrive, and now have
some problems getting it up and running.

During the boot-sequence the second HD gets detected, hence:

wd1 at pciide0 channel 1 drive 0: <ST34321A>
wd1: drive supports 32-sector pio transfers, lba addressing
wd1: 4103MB, 8894 cyl, 15 head, 63 sec, 512 bytes/sect x 8404830 sectors
wd1: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 2

If I understand correctly the way to configure/install a new harddrive is
to:

run: dd (zero the thing) -> disklabel -> newfs -> and finally mount it :)

But I already get stuck at disklabel, (in FreeBSD you can use the easy
Sysintall util) the syntax should be something like this:

disklabel -rw wd1 $disktype

$disktype is the problem, as the only way I can image I need to manually
add a new(my) disktype in the disktab file. But that's a bit
complicated:

#/etc/disktab

myseagate|Seagte 4.3GB HD ESDI :\
        :dt=ESDI:ty=fixed:se#512:nt#255:ns#63:nc#522:sf: \
        :pa#16065:oa#0:ta=4.2BSD:ba#4096:fa#512:\
        #:pb#21600:ob#21600:tb=swap: \
        #:pc#659880:oc#0: \
        #:pd#216000:od#53200:td=4.2BSD:bd#4096:fd#512: \
        #:ph#398520:oh#269200:th=4.2BSD:bh#4096:fh#512:

I've setup the above, with the information gathered by disklabel (there
was still some data on the 4,3GB HD from a former BSD installation I
guess) I want to use the whole disk for BSD.

a disklabel on /dev/wd1a

# /dev/wd1a:
type: ESDI
disk: ad0s1
label: 
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 255
sectors/cylinder: 16065
cylinders: 522
total sectors: 8401932
rpm: 3600
interleave: 1
trackskew: 0
cylinderskew: 0
headswitch: 0           # milliseconds
track-to-track seek: 0  # milliseconds
drivedata: 0 

8 partitions:
#        size   offset     fstype   [fsize bsize   cpg]
  a:   102400       63     4.2BSD     1024  8192    16   # (Cyl.    0*-
6*)
  b:   141824   102463       swap                        # (Cyl.    6*-
15*)
  c:  8401932       63     unused        0     0         # (Cyl.    0*-
522)
  e:    40960   244287     4.2BSD     1024  8192    16   # (Cyl.   15*-
17*)
  f:  8116748   285247     4.2BSD     1024  8192    16   # (Cyl.   17*-
522)
disklabel: partition c: partition extends past end of unit
disklabel: partition f: partition extends past end of unit

But I'm stuck with the following:

netbsd# disklabel -rw wd1 myseagate
ioctl DIOCWLABEL: Inappropriate ioctl for device
ioctl DIOCWLABEL: Inappropriate ioctl for device

Any pointers?
Isn't there an easier way to achieve it?

Thanks in advance,

Jurriaan