install revision 1.14 1 Installing NetBSD is a relatively complex process, but if you have
2 this document in hand it shouldn't be too much trouble.
3
4 There are several ways to install NetBSD onto a disk. The easiest way
5 in terms of preliminary setup is to use the NetBSD miniroot that can
6 be booted off your local disk's swap partition. Alternatively, if your
7 Sparcstation is hooked up in a network you can find a server and arrange
8 for a diskless setup which is a convenient way to install on a machine
9 whose disk does not currently hold a usable operating system (see the
10 section `Installing NetBSD by using a diskless setup' below).
11
12
13 Installing NetBSD by using the NetBSD miniroot.
14
15 The miniroot is a self-contained NetBSD filesystem holding all utilities
16 necessary to install NetBSD on a local disk. It is distributed as a plain
17 file designed to be transferred to a raw disk partition from which it can
18 be booted using the appropriate PROM command. Usually, the miniroot will
19 be loaded into the swap partition of a disk. If needed, you can use any
20 other unused partition, but remember that the partition will then not
21 available during the installation process.
22
23 Loading the miniroot onto your raw partition is simple. On NetBSD as well
24 as SunOS you use a command like:
25
26 # dd if=miniroot-RELEASE.fs of=/dev/rsd0b bs=20b conv=sync
27
28 (here `/dev/rsd0b' is assumed to be your swap partition). There's a
29 potential problem here if /dev/rsd0b is actually in use as a swap
30 partition by your currently running system. If you don't have another
31 disk or partition to spare, you can usually get away with running this
32 command anyway after first booting into single-user mode to ensure a
33 quiet system.
34
35 After transferring the miniroot to disk, bring the system down by:
36
37 # halt
38
39 Then boot the miniroot by typing the appropriate command at the PROM:
40
41 > b sd(,,1)netbsd -s # for sun4 monitors
42 ok boot sd(,,1)netbsd -s # for version 1 OpenBOOT ROMs
43 ok boot disk:b netbsd -s # for version 2 OpenBOOT ROMs
44
45 If you've loaded the miniroot onto some other disk than `sd0' adapt
46 the boot specifier accordingly, e.g.:
47
48 ok boot disk1:b netbsd -s
49
50 to boot from SCSI disk target 1 from a version 2 OpenBOOT ROM.
51 If you have to use the old-style `sd(c,u,p)' syntax to boot from a
52 SCSI disk, you can calculate the parameters as follows:
53
54 `c' - specifies the controller number
55 `u' - the hexadecimal number obtained from evaluating
56 the expression `(8 * TARGET) + LUN'
57 `p' - the partition number from which to boot (0=`a', 1=`b', etc).
58
59
60 The monitor boot command will cause the NetBSD kernel contained in the
61 miniroot image to be booted. After the initial probe messages you'll be
62 asked to start the install or upgrade procedure. Proceed to the section
63 `Running the installation scripts' below.
64
65
66 Installing NetBSD by using a diskless setup.
67
68 First, you must setup a diskless client configuration on a server. If
69 you are using a NetBSD system as the boot-server, have a look at the
70 diskless(8) manual page for guidelines on how to proceed with this.
71 If the server runs another operating system, you'll have to consult
72 documentation that came with it (on SunOS systems, add_client(8) is a
73 good start).
74
75 Your Sparcstation expects to be able to download a second stage bootstrap
76 program via TFTP after having acquired its IP address through RevARP when
77 instructed to boot "over the net". It will look for a filename composed of
78 the machine's IP address followed by the machine's architecture, separated
79 by a period. For example, a sun4c machine which has been assigned IP
80 address 130.115.144.11, will make an TFTP request for `8273900B.SUN4C'.
81 Normally, this file is a symbolic link to an appropriate second-stage
82 boot program, which should be located in a place where the TFTP daemon
83 can find it (remember, many TFTP daemons run in a chroot'ed environment).
84 You can find the boot program in `/usr/mdec/boot.net' in the NetBSD/sparc
85 distribution.
86
87 [ Note that the only difference between `/usr/mdec/boot.net' and
88 `/usr/mdec/boot' is in the a.out header, which has been magically
89 transformed in a way that makes it usable on all versions of
90 Sparc PROMs.
91 ]
92
93
94 After the boot program has been loaded into memory and given control by
95 the PROM, it starts locating the machine's remote root directory through
96 the BOOTPARAM protocol. First a BOOTPARAM WHOAMI request is broadcast
97 on the local net. The answer to this request (if it comes in) contains
98 the client's name. This name is used in next step, a BOOTPARAM GETFILE
99 request -- sent to the server that responded to the WHOAMI request --
100 requesting the name and address of the machine that will serve the client's
101 root directory, as well as the path of the client's root on that server.
102
103 Finally, this information (if it comes in) is used to issue a REMOTE MOUNT
104 request to the client's root filesystem server, asking for an NFS file
105 handle corresponding to the root filesystem. If successful, the boot
106 program starts reading from the remote root filesystem in search of the
107 kernel which is then read into memory.
108
109
110 As noted above in the section `Preparing your System for NetBSD Installation',
111 you have several options when choosing a location to store the installation
112 filesets. However, the easiest way is to put the *.tar.gz files you want
113 to install into the root directory for your client on the server.
114
115 Next, unpack `base.tar.gz' and `etc.tar.gz' on the server in the root
116 directory for your machine. If you elect to use a separately NFS-mounted
117 filesystem for `/usr' with your diskless setup, make sure the "./usr" base
118 files in base.tar.gz end up in the correct location. One way to do this is
119 to temporarily use a loopback mount on the server, re-routing <root>/usr to
120 your server's exported NetBSD "/usr" directory. Also put the kernel and the
121 install/upgrade scripts into the root directory.
122
123 A few configuration files need to be edited:
124
125 <root>/etc/hosts
126 Add the IP addresses of both server and client.
127
128 <root>/etc/myname
129 This files contains the client's hostname; use the same
130 name as in <root>/etc/hosts.
131
132 <root>/etc/fstab
133 Enter the entries for the remotely mounted filesystems.
134 For example:
135 server:/export/root/client / nfs rw 0 0
136 server:/export/exec/sun4.netbsd /usr nfs rw 0 0
137
138 Now you must populate the the `/dev' directory for your client. If you server
139 runs SunOS 4.x, you can simply change your working directory to `<root>/dev'
140 and run the MAKEDEV script: `sh MAKEDEV all'.
141
142 On SunOS 5.x systems, MAKEDEV can also be used, but there'll be error
143 messages about unknown user and groups. These errors are inconsequential
144 for the purpose of installing NetBSD. However, you may want to correct them
145 if you plan to use the diskless setup regularly. In that case, you may re-run
146 MAKEDEV on your NetBSD machine once it has booted.
147
148 Boot your workstation from the server by entering the appropriate `boot'
149 command at the monitor prompt. Depending on the PROM version in your machine,
150 this command takes one of the following forms:
151
152 > b le()netbsd -s # for sun4 monitors
153 ok boot le()netbsd -s # for version 1 OpenBOOT ROMs
154 ok boot net netbsd -s # for version 2 OpenBOOT ROMs
155
156 This will boot the NetBSD kernel in single-user mode.
157
158 [[
159 NOTE: the latter two examples assume you operate the OpenBOOT ROM in
160 "new command mode". If your machine comes up and gives you a `>' prompt
161 instead of `ok', type:
162
163 >n # enter native OpenBOOT mode
164 ok setenv sunmon-compat? false # make it permanent
165 ok
166 ]]
167
168 If you use a diskless setup with a separately NFS-mounted /usr filesystem,
169 mount /usr by hand now:
170
171 netbsd# mount /usr
172
173 At this point, it's worth checking the disk label and partition sizes on
174 the disk you want to install NetBSD onto. NetBSD understands SunOS-style
175 disklabels, so if your disk was previously used by SunOS there will be
176 a usable label on it. Use `disklabel -e <disk>' (where <disk> is the
177 device name assigned by the NetBSD kernel, e.g. `sd0') to view and
178 modify the partition sizes. See the section `Preparing your System for
179 NetBSD Installation' above for suggestions about disk partition sizes.
180
181 If you are installing on a SCSI disk that does *not* have a SunOS or
182 NetBSD label on it, you may still be able to use disklabel(8) but you'll
183 have to create all partitions from scratch. If your disk is listed in
184 `/etc/disktab', you may use the entry (which in most cases only defines
185 a `c' partition to describe the whole disk) to put an initial label on
186 the disk. Then proceed with `disklabel -e <disk>' to create a partition
187 layout that suits your needs.
188
189 NOTE: Because of the built-in compatibility with SunOS-style labels,
190 ALWAYS MAKE SURE ALL YOUR PARTITIONS START AND END ON CYLINDER BOUNDARIES.
191
192
193 Here follows an example of what you'll see while in the dislabel editor.
194 Do not touch any of the parameters except for the `label: ' entry and
195 the actual partition size information at the bottom (the lines starting
196 with `a:', `b:', ...).
197
198 The size and offset fields are given in sector units. Be sure to make
199 these numbers multiples of the of the number of sectors per cylinder:
200 the kernel might be picky about these things, but aside from this you'll
201 have the least chance of wasting disk space.
202 Partitions on which you intend to have a mountable filesystem, should
203 be given fstype `4.2BSD'. Remember, the `c' partition should describe
204 the whole disk.
205 The `(Cyl. x - y)' info that appears after the hash (`#') character is
206 treated as a comment and need not be filled in when altering partitions.
207
208 Special note: the line containing `8 partitions:' is best left alone,
209 even if you define less then eight partitions. If this line displays
210 a different number and the program complains about it (after you leave
211 the editor), then try setting it to `8 partitions:'.
212
213
214 <BEGIN SAMPLE DISKLABEL SCREEN>
215 netbsd# disklabel sd2
216 # /dev/rsd2c:
217 type: SCSI
218 disk: SCSI disk
219 label: Hold Your Breath
220 flags:
221 bytes/sector: 512
222 sectors/track: 64
223 tracks/cylinder: 7
224 sectors/cylinder: 448
225 cylinders: 1429
226 rpm: 3600
227 interleave: 1
228 trackskew: 0
229 cylinderskew: 0
230 headswitch: 0 # milliseconds
231 track-to-track seek: 0 # milliseconds
232 drivedata: 0
233
234 8 partitions:
235 # size offset fstype [fsize bsize cpg]
236 a: 50176 0 4.2BSD 0 0 0 # (Cyl. 0 - 111)
237 b: 64512 50176 swap # (Cyl. 112 - 255)
238 c: 640192 0 unknown # (Cyl. 0 - 1428)
239 d: 525504 114688 4.2BSD 0 0 0 # (Cyl. 256 - 1428)
240 <END SAMPLE DISKLABEL SCREEN>
241
242
243 If you are upgrading a NetBSD installation, start the upgrade script:
244
245 netbsd# sh upgrade.sh
246
247 else, start the installation script:
248
249 netbsd# sh install.sh
250
251
252 Running the installation scripts.
253
254 The installation scripts will do most of the work of transferring the
255 system from the distribution sets onto your disk. You will frequently be
256 asked for confirmation before the script proceeds with each phase of the
257 installation process.
258
259 Occasionally, you'll have to provide a piece of information such as the
260 name of the disk you want to install on or IP addresses and domain names
261 you want to assign. If your system has more than one disk, you may want
262 to look at the output of the dmesg(8) command to see how your disks
263 have been identified by the kernel.
264
265 The installation script goes through the following phases:
266
267 - determination of the disk to install NetBSD on
268 - checking of the partition information on the disk
269 - creating and mounting the NetBSD filesystems
270 - setup of IP configuration
271 - extraction of the distribution tar files
272 - installation of boot programs
273
274
275 Now try a reboot. Initially I'd suggest you "boot sd()netbsd -bs", then
276 try multiuser after that. If you boot single-user the NetBSD incantation
277 to make the root filesystem writable is
278
279 netbsd# mount -u /dev/sd0a /
280
281 The Sun monitor might have been setup to instruct the boot program to load
282 a file called "vmunix". On OpenBOOT ROM systems you can change it to load
283 "netbsd" instead using the following commands:
284
285 On version 1 OpenBOOT ROMs:
286 >n
287 ok setenv boot-from sd(0,0,0)netbsd
288 ok
289
290 On version 2 OpenBOOT ROMs:
291 ok setenv boot-file netbsd
292 ok setenv boot-device /sbus/esp/sd@0,0
293
294
295 Congratulations, you have successfully installed NetBSD RELEASE. When you
296 reboot into NetBSD, you should log in as "root" at the login prompt.
297 There is no initial password, but if you're using the machine in a
298 networked environment, you should create yourself an account and
299 protect it and the "root" account with good passwords.
300
301 Some of the files in the NetBSD RELEASE distribution might need to be
302 tailored for your site. In particular, the /etc/sendmail.cf file will
303 almost definitely need to be adjusted, and other files in /etc will
304 probably need to be modified. If you are unfamiliar with UN*X-like
305 system administration, it's recommended that you buy a book that
306 discusses it.
307
308