install revision 1.8
1Installing NetBSD is a relatively complex process, but if you have
2this document in hand it shouldn't be too much trouble.
3
4There are several ways to install NetBSD onto a disk. If your Sparcstation
5is hooked up in a network you can find find a server and arrange for a
6diskless setup which is a convenient way to install on a machine with
7a single disk attached. Alternatively, you could use SunOS (booted from
8a local disk) and install NetBSD onto a second disk. For the latter method,
9skip to the section "Installing from SunOS" below.
10
11
12Installing using a diskless setup.
13
14First, you must setup a diskless client configuration on a server. If
15you are using a NetBSD system as the boot-server, have a look at the
16diskless(8) manual page for guidelines on how to proceed with this.
17If the server runs another operating system, you'll have to consult
18documentation that came with it (on SunOS systems, add_client(8) is a
19good start).
20
21As noted above in the section `Preparing your System for NetBSD Installation',
22you have several options when choosing a location to store the installation
23filesets. However, the easiest way is to put the *.tar.gz files you want
24to install into the root directory for your client on the server.
25
26Next, unpack `base.tar.gz' and `etc.tar.gz' on the server in the root 
27directory for your machine. If you elect to use a separately NFS-mounted
28filesystem for `/usr' with your diskless setup, make sure the "./usr" base
29files in base.tar.gz end up in the correct location. One way to do this is
30to temporarily use a loopback mount on the server, re-routing <root>/usr to
31your server's exported NetBSD "/usr" directory. Also put the kernel and the
32install/upgrade scripts into the root directory.
33
34A few configuration files need to be edited:
35
36	<root>/etc/hosts
37		Add the IP addresses of both server and client.
38
39	<root>/etc/myname
40		This files contains the client's hostname; use the same
41		name as in <root>/etc/hosts.
42
43	<root>/etc/fstab
44		Enter the entries for the remotely mounted filesystems.
45		For example:
46			server:/export/root/client       /     nfs  rw 0 0
47			server:/export/exec/sun4.netbsd  /usr  nfs  rw 0 0
48
49Now you must populate the the `/dev' directory for your client. If you server
50runs SunOS 4.x, you can simply change your working directory to `<root>/dev'
51and run the MAKEDEV script: `sh MAKEDEV all'.
52
53On SunOS 5.x systems, MAKEDEV can also be used, but there'll be error
54messages about unknown user and groups. These errors are inconsequential
55for the purpose of installing NetBSD. However, you may want to correct them
56if you plan to the diskless setup regularly. In that case, you may re-run
57MAKEDEV on your NetBSD machine once it has booted.
58
59Boot your workstation from the server by entering the appropriate `boot'
60command at the monitor prompt. Depending on the PROM version in your machine,
61this command takes one of the following forms:
62
63	> b le()netbsd -s		# for sun4 monitors
64	ok boot le()netbsd -s		# for version 1 OpenBOOT ROMs
65	ok boot net netbsd -s		# for version 2 OpenBOOT ROMs
66
67This will boot the NetBSD kernel in single-user mode.
68
69[[
70NOTE: the latter two examples assume you operate the OpenBOOT ROM in
71"new command mode". If your machine comes up and gives you a `>' prompt
72instead of `ok', type:
73
74    >n					# enter native OpenBOOT mode
75    ok setenv sunmon-compat? false	# make it permanent
76    ok
77]]
78
79If you use a diskless setup with a separately NFS-mounted /usr filesystem,
80mount /usr by hand now:
81
82netbsd# mount /usr
83
84At this point, it's worth checking the disk label and partition sizes on
85the disk you want to install NetBSD onto. NetBSD understands SunOS-style
86disklabels, so if your disk was previously used by SunOS there will be
87a usable label on it. Use `disklabel -e <disk>' (where <disk> is the
88device name assigned by the NetBSD kernel, e.g. `sd0') to view and
89modify the partition sizes. A comfortable size for the root filesystem
90partition is about 20MB; a good initial size for the swap partition is
91twice the amount of physical memory in your machine (though, unlike
92SunOS 4.x, there are no restrictions on the size of the swap partition
93that would render part of your memory unusable). A full binary installation
94takes about 60MB in `/usr'. Make all your partitions start and end on
95cylinder boundaries.
96
97NOTE: if you are installing on a SCSI disk that does *not* have a SunOS
98or NetBSD label on it, you may still be able to use disklabel(8) but you'll
99have to create all partitions from scratch. If your disk is listed in
100`/etc/disktab', you may use the entry (which in most cases only defines
101a `c' partition to describe the whole disk) to put an initial label on
102the disk.
103
104Here follows an example of what you'll see while in the dislabel editor.
105Do not touch any of the parameters except for the `label: ' entry and
106the actual partition size information at the bottom (the lines starting
107with `a:', `b:', ...).
108
109The size and offset fields are given in sector units. Be sure to make
110these numbers multiples of the of the number of sectors per cylinder:
111the kernel might be picky about these things, but aside from this you'll
112have the least chance of wasting disk space.
113Partitions on which you intend to have a a mountable filesystem, should
114be given fstype `4.2BSD'. Remember, the `c' partition should describe
115the whole disk.
116The `(Cyl. x - y)' info that appears after the hash (`#') character is
117treated as a comment and need not be filled in when altering partitions.
118
119Special note: the line containing `8 partitions:' is best left alone,
120even if you define less then eight partitions. If this line displays
121a different number and the program complains about it (after you leave
122the editor), then try setting it to `8 partitions:'.
123
124
125<BEGIN SAMPLE DISKLABEL SCREEN>
126netbsd# disklabel sd2
127 # /dev/rsd2c:
128type: SCSI 
129disk: SCSI disk
130label: Hold Your Breath
131flags:
132bytes/sector: 512
133sectors/track: 64
134tracks/cylinder: 7  
135sectors/cylinder: 448
136cylinders: 1429
137rpm: 3600
138interleave: 1
139trackskew: 0
140cylinderskew: 0
141headswitch: 0           # milliseconds
142track-to-track seek: 0  # milliseconds
143drivedata: 0
144
1458 partitions:
146#        size   offset    fstype   [fsize bsize   cpg]
147  a:    50176        0    4.2BSD        0     0     0   # (Cyl.    0 - 111)
148  b:    64512    50176      swap                        # (Cyl.  112 - 255)
149  c:   640192        0   unknown                        # (Cyl.    0 - 1428)
150  d:   525504   114688    4.2BSD        0     0     0   # (Cyl.  256 - 1428)
151<END SAMPLE DISKLABEL SCREEN>
152
153
154If you are upgrading a NetBSD installation, start the upgrade script:
155
156netbsd# sh upgrade.sh
157
158else, start the installation script:
159
160netbsd# sh install.sh
161
162
163These scripts will do most of the work of transferring the system from the
164tar files onto your disk. You will frequently be asked for confirmation
165before the script proceeds with each phase of the installation process.
166Occasionally, you'll have to provide a piece of information such as the
167name of the disk you want to install on or IP addresses and domain names
168you want to assign. If your system has more than one disk, you may want
169to look at the output of the dmesg(8) command to see how your disks
170have been identified by the kernel.
171
172The installation script goes through the following phases:
173
174	- determination of the disk to install NetBSD on
175	- checking of the partition information on the disk
176	- creating and mounting the NetBSD filesystems
177	- setup of IP configuration
178	- extraction of the distribution tar files
179	- installation of boot programs
180
181
182Now try a reboot.  (If needed, swap your scsi id's first).  Initially
183I'd suggest you "boot sd()netbsd -bs", then try multiuser after that.
184if you boot single-user the NetBSD incantation to make the root
185filesystem writable is
186
187    netbsd# mount -u /dev/sd0a /
188
189The Sun monitor normally tries to load a file called "vmunix". On
190OpenBOOT ROM systems you can change it to load NetBSD instead using
191the following commands:
192
193On version 1 OpenBOOT ROMs:
194    >n
195    ok setenv boot-from sd(0,0,0)netbsd
196    ok
197
198On version 2 OpenBOOT ROMs:
199    ok setenv boot-file netbsd
200    ok setenv boot-device /sbus/esp/sd@0,0
201
202
203Congratulations, you have successfully installed NetBSD 1.1.  When you
204reboot into NetBSD, you should log in as "root" at the login prompt.
205There is no initial password, but if you're using the machine in a
206networked environment, you should create yourself an account and
207protect it and the "root" account with good passwords.
208
209Some of the files in the NetBSD 1.1 distribution might need to be
210tailored for your site.  In particular, the /etc/sendmail.cf file will
211almost definitely need to be adjusted, and other files in /etc will
212probably need to be modified.  If you are unfamiliar with UN*X-like
213system administration, it's recommended that you buy a book that
214discusses it.
215
216
217
218Installing from SunOS.
219
220You need a SunOS machine to install NetBSD.  You also need at
221least the following pieces:
222
223    the *.tar.gz files you want to install (as a minimum, base.tar.gz)
224    gzip (GNU gzip) SunOS binary
225    gtar (GNU tar) SunOS binary
226    the "install.sh" script
227    a "/boot" file from a SunOS machine that matches your machine type
228	(e.g. sun or sun4c)
229    a kernel, most likely "/netbsd"
230
231All these pieces, except "/boot", are supplied in the NetBSD/sparc
232distribution.
233
234You need to format and partition the disk using SunOS (since
235NetBSD/sparc uses SunOS disk labels.)  Give yourself adequate
236partition sizes.  Here is an example layout:
237
238    partition    size   offset	  will be..
239    sd2a        28140        0	  /
240    sd2b        16170    28140	  swap
241    sd2c       204540        0	  `whole disk'
242    sd2g       160230    44310	  /usr
243
244BTW, These are not recommended sizes.  They simply match the first
245(tiny) disk that NetBSD/sparc ran on.
246
247Use SunOS to newfs the partitions which will have filesystems on them.
248(NetBSD's filesystem format is identical to SunOS).
249
250    sunos# newfs /dev/rsd2a
251    [... lots of output]
252    sunos# newfs /dev/rsd2g
253    [... lots of output]
254
255NOTE: If you are able to, there is a performance benefit from
256newfs'ing using NetBSD.  If you newfs using the NetBSD newfs command,
257be sure to use the -O flag for your / partition, so that newfs will
258use the 4.3BSD filesystem format, rather than the new 4.4BSD filesystem
259format.  If you forget, you will not be able to boot -- the SunOS boot
260blocks do not understand the extended 4.4BSD filesystem format.
261
262Mount those partitions in a tree formation, under /mnt; ie:
263
264    sunos# df
265    Filesystem            kbytes    used   avail capacity  Mounted on
266    [...]
267    /dev/sd2a              11501       0   11501     0%    /mnt
268    /dev/sd2g             179529       0  179529     0%    /mnt/usr
269
270Place a standard SunOS "/boot" program in /mnt (your new root
271partition), and use the SunOS command "installboot" to make it work.
272The installboot man page says to do something like this:
273
274    sunos# cp /boot /mnt/boot
275    sunos# /usr/mdec/installboot -vlt /mnt/boot /usr/mdec/bootsd /dev/rsd2a
276
277You can now extract the provided "*.tar.gz files onto your disk.  The
278provided script, "install_from_sunos.sh" will help you:
279
280    sunos# ls -FC
281    base.tar.gz      etc.tar.gz       man.tar.gz       secr.tar.gz
282    comp.tar.gz      games.tar.gz     misc.tar.gz      text.tar.gz
283    install.sh       netbsd.id3_scsi
284    sunos# ./install_from_sunos.sh
285    [...]
286
287This script NEEDS gzip and gtar (GNU gzip and GNU tar) on your
288execution path!  The tar files are in a "new format" that includes
289directory information, and SunOS tar will not read them.  Statically
290linked versions of these programs for SunOS are supplied in the
291distribution.
292
293After the files have been extracted, repair /mnt/etc/fstab to match
294your actual disk layout.  (Minus the "/mnt" component of each path, of
295course :-)
296
297Now proceed to reboot the machine as described above in "Installing
298using a diskless setup".
299