install revision 1.2 1 Installing NetBSD is a relatively complex process, but if you have
2 this document in hand it should not be too difficult.
3
4 There are several ways to install NetBSD onto your disk. If your
5 machine has a tape drive the easiest way is "Installing from tape"
6 (details below). If your machine is on a network with a suitable
7 NFS server, then "Installing from NFS" is the next best method.
8 Otherwise, if you have another VME147 machine running NetBSD you can
9 initialize the disk on that machine and then move the disk.
10
11
12 * Installing from tape:
13
14 Create the NetBSD/mvme68k _VER boot tape as described in the section
15 entitled "Preparing a boot tape". Then, with the tape in the drive,
16 type the following at the 147Bug prompt:
17
18 --> 147-Bug> bo 5
19
20 As mentioned earlier, this assumes your tape is jumpered for SCSI-id 5.
21
22 As the tape loads (which may take 20 to 30 seconds), you will see a
23 series of status messages. It may be useful if you can capture these
24 messages to a file, or a scrollable xterm window. In particular, you
25 should make a note of the lines which describe the geometry of the
26 SCSI disks detected by NetBSD. They are of the form:
27
28 sd0 at scsibus0 targ 0 lun 0: <CDC, 94161-9, 2506> SCSI1 0/direct fixed
29 sd0: 148MB, 967 cyl, 9 head, 35 sec, 512 bytes/sect x 304605 sectors
30
31 The information of most interest is the number of sectors; here it's
32 304605. You will need this number when you come to create a disklabel
33 for that drive.
34
35 [ START OF STATUS MESSAGES ]
36
37 RAM address from VMEbus = $00000000
38
39 Booting from: VME147, Controller 5, Device 0
40 Loading: Operating System
41
42 Volume: NBSD
43
44 IPL loaded at: $003F0000
45 >> BSD MVME147 tapeboot [$Revision: 1.2 $]
46 578616+422344+55540+[46032+51284]=0x11a6e4
47 Start @ 0x8000 ...
48 Copyright (c) 1996, 1997 The NetBSD Foundation, Inc. All rights reserved.
49 Copyright (c) 1982, 1986, 1989, 1991, 1993
50 The Regents of the University of California. All rights reserved.
51
52 NetBSD 1.3 (RAMDISK) #1: Sun Dec 21 16:19:04 GMT 1997
53 steve (a] soapy.mctavish.demon.co.uk:/usr/src/sys/arch/mvme68k/compile/RAMDISK
54 Motorola MVME-147S: 25MHz MC68030 CPU+MMU, MC68882 FPU
55 real mem = 7237632
56 avail mem = 6381568
57 using 88 buffers containing 360448 bytes of memory
58 mainbus0 (root)
59 pcc0 at mainbus0: Peripheral Channel Controller, rev 0, vecbase 0x40
60 clock0 at pcc0 offset 0x0 ipl 5: Mostek MK48T02, 2048 bytes of NVRAM
61 .
62 .
63
64 [ END OF STATUS MESSAGES ]
65
66 Note that the exact text of the messages will vary depending on which
67 MVME147 variant you're using.
68
69 Finally, you will see the following "welcome" message:
70
71 [ START OF WELCOME MESSAGE ]
72
73 Welcome to the NetBSD/mvme68k RAMDISK root!
74
75 This environment is designed to do only four things:
76 1: Partititon your disk (use the command: edlabel /dev/rsd0c)
77 2: Copy a miniroot image into the swap partition (/dev/rsd0b)
78 3: Make that partition bootable (using 'installboot')
79 4: Reboot (using the swap partition, i.e. /dev/sd0b).
80
81 Copying the miniroot can be done several ways, allowing the source
82 of the miniroot image to be on any of these:
83 boot tape, NFS server, TFTP server, rsh server
84
85 The easiest is loading from tape, which is done as follows:
86 mt -f /dev/nrst0 rewind
87 mt -f /dev/nrst0 fsf 3
88 dd bs=8k if=/dev/nrst0 of=/dev/rsd0b
89 (For help with other methods, please see the install notes.)
90
91 To reboot using the swap partition after running installboot, first
92 use "halt", then at the Bug monitor prompt use a command like:
93 bo 0,,b:
94
95 To view this message again, type: cat /.welcome
96 ssh:
97
98 [ END OF WELCOME MESSAGE ]
99
100 You must now create a disklabel on the disk you wish to use for the
101 root filesystem. This will usually be 'sd0'. The disklabel is used by
102 NetBSD to identify the starting block and size of each partition on
103 the disk.
104
105 Partitions are named 'sd0a', 'sd0b', 'sd0c' etc, up to 'sd0h'. The
106 mvme68k port of NetBSD makes some assumptions about the first three
107 partitions on a boot disk:
108
109 sd0a The root filesystem.
110 sd0b The swap partition.
111 sd0c The whole disk. Also known as the Raw Partition.
112
113 The 'Raw Partition' is special; NetBSD is able to use it even if the
114 disk has no label. You should never create a filesystem on the Raw
115 Partition, even on a non-boot disk.
116
117 It is good practice to put /usr on a different partition than / (sd0a).
118 So, the first available partition for /usr is 'sd0d'. Refer to the
119 section entitled "NetBSD System Requirements and Supported Devices" for
120 information on the recommended sizes of the /, /usr and swap partitions.
121
122 You are not required to define any partitions beyond sd0d, but if you
123 have a large disk drive, you might want to create several other partitions
124 for filesystems such as /home or /usr/src. Note that at this time you
125 are only required to partition the root/boot disk; you will get the
126 opportunity to partition any other disks in your system from the main
127 'miniroot' installation program.
128
129 To create the disklabel and partitions, use the 'edlabel' program,
130 passing it the name of the Raw Partition of your root/boot disk. Note
131 that '-->' at the start of a line in the following examples indicates
132 you are being prompted to enter some information. Obviously, you won't
133 see this when you run the program for real.
134
135 --> ssh: edlabel /dev/rsd0c
136 edlabel menu:
137 print - display the current disk label
138 modify - prompt for changes to the label
139 write - write the new label to disk
140 quit - terminate program
141 edlabel>
142
143 The program shows what commands it recognises; "print", "modify",
144 "write" and "quit". It will accept the first letter of a command if
145 you don't feel like typing each one in full.
146
147 To start creating the basic partitions, you should enter 'm' (modify)
148 at the edlabel prompt, then enter the letter corresponding to the first
149 partition, 'a'.
150
151 --> edlabel> m
152 modify subcommands:
153 @ : modify disk parameters
154 a-h : modify partition
155 s : standarize geometry
156 q : quit this subcommand
157 --> edlabel/modify> a
158 a (root) 0 (0/00/00) 0 (0/00/00) unused
159 --> start as <blkno> or <cyls/trks/sects> : 0
160 --> length as <nblks> or <cyls/trks/sects> : 38000
161 --> type: 4.2BSD
162 edlabel/modify>
163
164 When you enter the start and length of a partition, you can use either
165 blocks or cylinder/track/sector notation. If this is the first time
166 you've partitioned a disk for NetBSD, it's probably easiest to use block
167 notation. The above example creates partition 'a', starting at block zero
168 and with a size of 38000 blocks. Note that the usual size of a block is
169 512 bytes, so this creates a 19Mb partition.
170
171 The 'type' of the partition should be "4.2BSD", otherwise you won't
172 be able to create a filesystem on it.
173
174 Next, create a swap partition (b). Note that the minimum size of this
175 swap partition should be 8Mb, otherwise you won't be able to use a
176 miniroot to complete the NetBSD installation!
177
178 --> edlabel/modify> b
179 b (swap) 0 (0/00/00) 0 (0/00/00) unused
180 --> start as <blkno> or <cyls/trks/sects> : 38000
181 --> length as <nblks> or <cyls/trks/sects> : 32768
182 --> type: swap
183 edlabel/modify>
184
185 Here, we specify a value for 'start' such that the swap partition follows
186 immediately after partition 'a', i.e. 38000. The length of the swap
187 partition should be a multiple of the amount of RAM you have in your
188 system. Here, I've chosen 32768, or 16Mb. The next available block on the
189 drive is thus 38000 + 32768. We will use this to create partition 'd' for
190 our /usr filesystem. (Note that for a busy system, or a system with more
191 than 8Mb of RAM, you'll be better off with a 32 or 64Mb swap partition.)
192
193 --> edlabel/modify> d
194 d (user) 0 (0/00/00) 0 (0/00/00) unused
195 --> start as <blkno> or <cyls/trks/sects> : 70768
196 --> length as <nblks> or <cyls/trks/sects> : 233837
197 --> type: 4.2BSD
198 --> edlabel/modify> q
199 edlabel>
200
201 As you can see, I've chosen to assign the remainder of the disk to /usr.
202 Since there are 304605 sectors on the example disk (did you remember to
203 note down the number of sectors on your disk during boot?), and partition
204 'd' starts at sector 70768, a simple bit of arithmetic (304605 - 70768)
205 gives 'd' a size of 233837.
206
207 You now need to write this new disklabel, together with the partition
208 details you've just entered, to disk. You might also try the 'p' command
209 to view the partitions. Once written, you can quit back to ssh using 'q'.
210
211 --> edlabel> p
212 type_num: 4
213 sub_type: 0
214 type_name: SCSI disk
215 pack_name: fictitious
216 bytes/sector: 512
217 sectors/track: 35
218 tracks/cylinder: 9
219 cylinders: 967
220 sectors/cylinder: 315
221 partition start (c/t/s) nblks (c/t/s) type
222
223 a (root) 0 (0/00/00) 38000 (120/05/25)* 4.2BSD
224 b (swap) 38000 (120/05/25)* 32768 (104/00/08)* swap
225 c (disk) 0 (0/00/00) 304605 (967/00/00) unused
226 d (user) 70768 (224/05/33)* 233837 (742/03/02)* 4.2BSD
227 --> edlabel> w
228 --> edlabel> q
229 ssh:
230
231
232 Now that your disk's partitioned, you need to get the proper installation
233 miniroot image onto it. The miniroot image is designed to be copied into
234 the swap partition of your disk. This is a safe place which won't be
235 overwritten by the installation procedure. From the ssh prompt, use the
236 following commands to copy the miniroot image from tape to swap (b).
237
238 --> ssh: mt -f /dev/nrst0 rewind
239 --> ssh: mt -f /dev/nrst0 fsf 3
240 --> ssh: dd bs=8k if=/dev/nrst0 of=/dev/rsd0b
241
242 The disk and the miniroot must now be made bootable using the
243 'installboot' command, To do this, issue the following commands:
244
245 --> ssh: mount /dev/sd0b /mnt
246 --> ssh: installboot /mnt/usr/mdec/bootsd /bootxx /dev/rsd0b
247 --> ssh: umount /dev/sd0b
248
249 You can now shutdown the system.
250
251 --> ssh: halt
252 signal 15
253 ssh: syncing disks... done
254 unmounting /mnt (/dev/sd1b)...
255 unmounting / (root_device)...
256 halted
257
258 --> 147-Bug>reset
259 --> Reset Local SCSI Bus [Y,N] N? y
260 --> Automatic reset of known SCSI Buses on RESET [Y,N] = Y?
261 --> Cold/Warm Reset flag [C,W] = C?
262 --> Execute Soft Reset [Y,N] N? y
263
264 You should now reboot from that just installed miniroot. See the section
265 entitled "Booting the miniroot" for details.
266
267
268 * Installing from NFS:
269
270 Before you can install from NFS, you must have already configured
271 your NFS server to support your machine as a bootable client.
272 Instructions for configuring the server are found in the section
273 entitled "Getting the NetBSD System onto Useful Media" above.
274
275 To get started, you need to download "sboot" into RAM (you will find
276 'sboot' in the "install" directory of the mvme68k distribution).
277 You can either do that through the console line or through a 2nd serial
278 connection. For example, a VME147 connected to a sun4/110 and accessed
279 via "tip" can be loaded as follows:
280
281 lo 0
282 ~Ccat sboot
283 go 4000
284
285 Which will look like this:
286
287 --> 147-Bug>lo 0
288 --> ~CLocal command? cat sboot
289
290 away for 11 seconds
291 !
292
293 --> 147-Bug>g 4000
294 Effective address: 00004000
295
296 sboot: serial line bootstrap program (&end = 6018)
297
298 >>>
299
300 Now, if you want to do it through serial line 1, then connect serial
301 line one to a machine. At the "147-Bug> " prompt do this "tm 1".
302 You should then login to whatever machine it is connected to.
303 Then hit "^A" to escape to Bug. do "lo 1;x=cat sboot" ... then when
304 that is done you can reconnect "tm 1" and logout. Then do "go 4000"
305 and you've got ">>> " prompt of sboot.
306
307 Once you've got the ">>> " prompt, you can boot the RAMDISK kernel
308 from the server:
309
310 --> >>> b
311
312 le0: ethernet address: 8:0:3e:20:cb:87
313 My ip address is: 192.168.1.4
314 Server ip address is: 192.168.1.1
315 4800
316 Download was a success!
317 Start @ 0x8000 ...
318 >> BSD MVME147 netboot (via sboot) [$Revision: 1.2 $]
319 device: le0 attached to 08:00:3e:20:cb:87
320 boot: client IP address: 192.168.1.4
321 boot: client name: soapy
322 root addr=192.168.1.1 path=/export/soapy
323 578616+422344+55540+[46032+51284]=0x11a6e4
324 Start @ 0x8000 ...
325 Copyright (c) 1996, 1997 The NetBSD Foundation, Inc. All rights reserved.
326 Copyright (c) 1982, 1986, 1989, 1991, 1993
327 The Regents of the University of California. All rights reserved.
328
329 NetBSD 1.3 (RAMDISK) #1: Sun Dec 21 16:19:04 GMT 1997
330 steve (a] soapy.mctavish.demon.co.uk:/usr/src/sys/arch/mvme68k/compile/RAMDISK
331 Motorola MVME-147S: 25MHz MC68030 CPU+MMU, MC68882 FPU
332 real mem = 7237632
333 avail mem = 6381568
334 using 88 buffers containing 360448 bytes of memory
335 mainbus0 (root)
336 pcc0 at mainbus0: Peripheral Channel Controller, rev 0, vecbase 0x40
337 clock0 at pcc0 offset 0x0 ipl 5: Mostek MK48T02, 2048 bytes of NVRAM
338 .
339 .
340
341 After the boot program loads the RAMDISK kernel, you should see the
342 welcome screen as shown in the "tape boot" section above.
343
344 You now need to create a disklabel with partition information on the
345 SCSI disk on which you intend to create your root filesystem. Follow
346 the instructions in the previous section entitled "Installing from
347 tape" to do this. (But stop short of the part which describes how to
348 copy the miniroot from tape.)
349
350 You must now configure the network interface before you can access the
351 NFS server containing the miniroot image. For example the command:
352
353 --> ssh: ifconfig le0 inet 192.168.1.4 up
354
355 will bring up the network interface 'le0' with that address. The next
356 step is to copy the miniroot from your server. This can be done using
357 either NFS or remote shell. (In the examples that follow, the server has
358 IP address 192.168.1.1) You may then need to add a default route if the
359 server is on a different subnet:
360
361 --> ssh: route add default 192.168.1.2 1
362
363 You can look at the route table using:
364
365 --> ssh: route show
366
367 Now mount the NFS filesystem containing the miniroot image:
368
369 --> ssh: mount -r 192.168.1.1:/export/soapy /mnt
370
371 The procedure is simpler if you have space for an expanded (not
372 compressed) copy of the miniroot image. In that case:
373
374 --> ssh: dd bs=8k if=/mnt/miniroot of=/dev/rsd0b
375
376 Otherwise, you will need to use "zcat" to expand the miniroot image
377 while copying. This is tricky because the "ssh" program (small shell)
378 does not handle sh(1) pipeline syntax. Instead, you first run the reader
379 in the background with its input set to /dev/pipe and then run the other
380 program in the foreground with its output to /dev/pipe. The result looks
381 like this:
382
383 --> ssh: run -bg dd obs=8k if=/dev/pipe of=/dev/rsd0b
384 --> ssh: run -o /dev/pipe zcat /mnt/install/miniroot.gz
385
386 To load the miniroot using rsh to the server, you would use a pair
387 of commands similar to the above. Here is another example:
388
389 --> ssh: run -b dd obs=8k if=/dev/pipe of=/dev/rsd0b
390 --> ssh: run -o /dev/pipe rsh 192.168.1.1 zcat miniroot.gz
391
392 You must now make the disk bootable. Refer to the previous section on
393 installing from tape, where it describes how to run 'installboot'.
394 This is immediately following the part which explains how to copy the
395 miniroot from tape.
396
397
398 * Booting the miniroot:
399
400 Assuming the miniroot is installed on partition 'b' of the disk with
401 SCSI-id 0, then the 147Bug boot command is:
402
403 147-Bug> bo 0,,b:
404
405 The command line parameters above are:
406
407 0 controller (usually zero)
408 ,, bug argument separators
409 b: tell the bootstrap code to boot from partition 'b'
410
411 You should see a bunch of boot messages, followed by messages from
412 the miniroot kernel just as you did when the RAMDISK kernel booted.
413
414 You will then be prompted to enter the root device. Since the miniroot
415 was booted from the swap partition, you should enter 'sd0b'. You will
416 then be asked for the swap device and filesystem type. Just press
417 return twice to accept the defaults. When asked to enter a terminal
418 type, either accept the default, or use whatever the TERM environment
419 variable is set to in the shell of your host system:
420
421 vmel0 at vmechip0
422 boot device: sd0
423 --> root device (default sd0a): sd0b
424 --> dump device (default sd0b):
425 --> file system (default generic):
426 root on sd0b dumps on sd0b
427 mountroot: trying ffs...
428 root file system type: ffs
429 init: copying out path `/sbin/init' 11
430 erase ^H, werase ^W, kill ^U, intr ^C
431 --> Terminal type? [vt100]
432
433 Congratulations! The system should now be running the miniroot
434 installation program.
435
436
437 Miniroot install program:
438 ------------------------
439
440 The miniroot's install program is very simple to use. It will guide
441 you through the entire process, and is well automated. Additional
442 improvements are planned for future releases.
443
444 The miniroot's install program will:
445
446 * Allow you to place disklabels on additional disks.
447 The disk we are installing on should already have
448 been partitioned using the RAMDISK kernel.
449
450 Note that partition sizes and offsets are expressed
451 in sectors. When you fill out the disklabel, you will
452 need to specify partition types and filesystem parameters.
453 If you're unsure what the these values should be, use the
454 following defaults:
455
456 fstype: 4.2BSD
457 fsize: 1024
458 bsize: 4096
459 cpg: 16
460
461 If the partition will be a swap partition, use the following:
462
463 fstype: swap
464 fsize: 0 (or blank)
465 bsize: 0 (or blank)
466 cpg: 0 (or blank)
467
468 Note that partition 'c' is special; it covers then entire
469 disk and should not be assigned to a filesystem.
470
471 The number of partitions is currently fixed at 8.
472
473 * Create filesystems on target partitions.
474
475 * Allow you to set up your system's network configuration.
476 Remember to specify host names without the domain name
477 appended to the end. For example use `foo' instead of
478 `foo.bar.org'. If, during the process of configuring
479 the network interfaces, you make a mistake, you will
480 be able to re-configure that interface by simply selecting
481 it for configuration again.
482
483 * Mount target filesystems. You will be given the opportunity
484 to manually edit the resulting /etc/fstab.
485
486 * Extract binary sets from the media of your choice.
487
488 * Copy configuration information gathered during the
489 installation process to your root filesystem.
490
491 * Make device nodes in your root filesystem.
492
493 * Copy a new kernel onto your root partition.
494
495 * Install a new boot block.
496
497 * Check your filesystems for integrity.
498
499 First-time installation on a system through a method other than the
500 installation program is possible, but strongly discouraged.
501