Subject: Re: Adding Disk Drives to NetBSD
To: Marcel Chukwunenye <moc@mlb.semi.harris.com>
From: Zoltan Zsido <zsido@westel900.net>
List: port-pmax
Date: 06/26/1998 22:22:00
On Fri, 26 Jun 1998, Marcel Chukwunenye wrote:

> Well Guys,
> 
> I am from the Sun environment and have HP, SGI and a little exposure 
> to DEC. Each of these OS provides some utility for adding disks to a
> system. I am sure this is no news to you.
> 
> Format under sunOS and Solaris provides an interface thus:
> voyager(/)SU# format sd7
> Searching for disks...done
> selecting sd7: <SUN1.3G>
> [disk formatted, defect list found]
> Warning: Current Disk has mounted partitions.
>  
>  FORMAT MENU:
>         disk       - select a disk
>         type       - select (define) a disk type
>         partition  - select (define) a partition table
>         current    - describe the current disk
>         format     - format and analyze the disk
>         repair     - repair a defective sector
>         show       - translate a disk address
>         label      - write label to the disk
>         analyze    - surface analysis
>         defect     - defect list management
>         backup     - search for backup labels
>         quit
> format> .
>

No. It supports only the partition and label item from SUN's format
menu. It is same as fmthard plus prtvtoc on Solaris.
  
> This is the sort of utility I was refering to. Can I repair a
> defective sector or manage the defect list using "disklabel"?
>  
> I found out that my company is scraping all our DEC 5000/200,
> 5000/240, and 5000/260; so some of us (Admins) want to take 
> these system home or keep it in the office as sidekicks. 
> This is why I am messing with NetBSD at this time. So, I am 
> a NEWBIE to "disklabel" and "newfs" as the utility to partition 
> a 2.1GB into 3 separate partitions.
> 
> I think easy to use utilities like Sun's "format" and DEC's "chpt"
> will help this OS.

As far as I remember Ultrix's chpt is equivalent to DEC OSF/1 's
disklabel, which is similar to NetBSD's disklabel.

If You want to "format" a disk under NetBSD, and it is not Your boot
device, put the device to the SCSI bus, reboot Your machine, and write the
kernel message where it describes the geometry of the new disk. Create the
appropriate device file with MAKEDEV (eg rzX, where X is the id of the
device on the SCSI bus. If You have more than 1 SCSI bus, X is equal to
the SCSI ID + 8*bus id.). Create a pseudo disklabel with disklabel -r 
rzYc > /tmp/newdisklabel where Y is an already labelled disk. Change the
geometry parameters wich was reported by kernel, and create the desired
slices. 

Sorry,the example is from DEC's OSF/1, but the NetBSD is similar:

# /dev/rrz0a:
type: SCSI
disk: RZ29B
label: 
flags:
bytes/sector: 512
sectors/track: 113		--->	Edit 
tracks/cylinder: 20		--->	Edit
sectors/cylinder: 2260		--->	Edit
cylinders: 3708			--->	Edit
sectors/unit: 8380080		--->	Edit
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:   262144        0     ADVfs                        # (Cyl.    0 -115*)
  b:  2150400   262144    unused     1024  8192         # (Cyl.  115*-1067*)
  c:  8380080        0    unused     1024  8192         # (Cyl.    0 -3707)
  d:        0        0    unused     1024  8192         # (Cyl.    0 - -1)
  e:        0        0    unused     1024  8192         # (Cyl.    0 - -1)
  f:        0        0    unused     1024  8192         # (Cyl.    0 - -1)
  g:  4056000  2412544     ADVfs                        # (Cyl. 1067*-2862*)
  h:  1911536  6468544     ADVfs                        # (Cyl. 2862*-3707*)


(Don't care the the "(Cyl....) after the # sign. Those are comments only.)


Write the new disklabel to the target disk with disklabel -R rrzXc
/tmp/newdisklabel. If it was corret, You can newfs the desired
partition as on Solaris. (NetBSD uses letters instead of numbers to refer
to the slices, so /dev/dsk/c0t3d0s2 is equivalent to /dev/rz0c ) 

That's all.  

Zoltan Zsido