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