install revision 1.6
1	$NetBSD: install,v 1.6 1998/05/12 00:00:18 ross Exp $	
2
30. Introduction
4
5    It's getting easier with every release to install NetBSD/alpha.
6    If you do have problems, don't despair; most complications you
7    might encounter are very easy to fix. We strongly suggest you
8    join the port-alpha list (see the section on mailing lists on
9    http://www.netbsd.org) and ask questions there.  Also, please
10    report any problems you've encountered or solved by using the
11    mailing list or by running send-pr(1) so that they can be fixed
12    for the next release.
13        
141. General
15
16    The following is a walk-through of the steps you will take
17    while getting NetBSD installed on your hard disk. It's divided
18    into three basic components: booting NetBSD (section 2 below),
19    preparing the disk (section 3 below), and loading the operating
20    system files onto the disk (section 4 below).
21
222. Booting NetBSD
23
24    You have two choices of how to boot your machine. If you have a
25    floppy drive, you may boot from that. This is probably the simplest
26    way of getting started. If you don't have a floppy drive, you will
27    need to set yourself up for a boot from a file server on the
28    network, which is a little more complex.
29
302.1 Making and Booting a Floppy
31
32    The 3.5", 1.44 MB boot floppy image is found under the
33    NetBSD/alpha _VER distribution directory in the file
34    alpha/installation/floppy/floppy-144. You need to take this disk
35    image and put it on a floppy disk.
36
37    If you have a Unix system handy, you can do this with a command
38    like the following:
39
40        dd if=floppy-144 of=/dev/rfd0a bs=18k
41
42    If the Unix system you are using is not a NetBSD system, you will
43    probably need to replace `/dev/rfd0a' with the name of the floppy
44    device on your particular system.
45
46    If you have an MS-DOS or Windows system available, you can use
47    the `rawrite.exe' utility to transfer the image to a floppy
48    disk. (Note that rawrite.exe doesn't work under many, if not
49    all, Windows NT systems.) This utility is provided with the
50    NetBSD/i386 install tools, under i386/installation/misc; a
51    documentation file, `rawrite.doc' is available there as well.
52
53    Once the floppy has been made, you simply need to put it in the
54    drive and type
55
56        boot dva0
57
58    Now you may skip to section 3.
59
602.2 Booting over the Network
61
62    Booting NetBSD/alpha _VER over a network requires a BOOTP server,
63    a TFTP server and an NFS server. (These are usually all run on
64    the same machine.) There are three basic stages to the boot:
65
66    1.The Alpha console software sends a BOOTP request to get its own
67    address, the address of the TFTP server and the file to
68    download. It downloads this file, which is the second stage
69    bootstrap, via TFTP and then executes it.
70
71    2.The second stage bootstrap uses further information in the BOOTP
72    packet that the console received to find the NFS server and path
73    and retrieve the kernel (the file /netbsd). After loading the
74    kernel into memory, it executes it.
75
76    3.The kernel probes and configures the devices, and then sends
77    out another BOOTP request so it can find out its address, the NFS
78    server, and path. (The kernel probably should get this information
79    from the console, but it currently doesn't.) It then mounts its
80    root via NFS and continues.
81
822.2.1 Setting Up the Server
83
84    You will need to set up your server to serve BOOTP, TFTP and NFS. 
85
86    The NFS setup is quite simple. If you want to run a full system
87    from the network, untar the NetBSD snapshot or distribution
88    into a directory on your server and NFS export that directory
89    to the client. (Make sure you put a kernel there as well, and
90    create the device nodes in /dev with `sh ./MAKEDEV all'. Detailed
91    instructions on netbooting can be found by visiting the
92    Alpha platform page of www.NetBSD.org. At the time of this
93    release, the URL for the netbooting instructions is:
94
95	http://www.netbsd.org/Ports/alpha/netboot.html
96
97    You'll want to map root to `root' (rather than the default
98    `nobody') when you export your root filesystem. A typical
99    /etc/exports line on a NetBSD system would be:
100
101        /usr/export/alpha -maproot=0 myclient.mydom.com
102
103    If you just want to get the install kernel loaded so that you
104    can download sets to the local hard drive of that machine, you
105    need nothing other than the install kernel in the NFS root
106    directory on your server.
107
108    For the TFTP setup, you need to copy the second stage bootstrap,
109    netboot, into an appropriately named file (I use boot.netbsd.alpha)
110    in the directory used by your TFTP server. If you extracted a full
111    snapshot, you can get the netboot program from /usr/mdec/netboot;
112    if not, you can get this from the installation/netboot directory
113    where you found the alpha distribution.
114
115    For the BOOTP server you need to specify the: 
116
117         hardware type (Ethernet) 
118         hardware address (Ethernet MAC address) 
119         IP address of the client 
120         subnet mask of the client 
121         address of of the TFTP/NFS server 
122         name of the second stage bootstrap loaded via TFTP 
123         path to the root for the client (mounted via NFS) 
124
125    Here's an example for a Unix system running bootpd: 
126
127         myhost.mydom.com:\ 
128                 :ht=ethernet:ha=0000c0391ae4:\ 
129                 :ip=192.168.1.2:sm=255.255.255.0:\ 
130                 :sa=192.168.1.1:bf=boot.netbsd.alpha:rp=/usr/export/alpha:
131
132    And here's an example for a Unix system running dhcpd:
133
134        host axp {
135                hardware ethernet 0:0:c0:39:1a:e4;
136                fixed-address 192.168.1.2;
137                option host-name "myhost.mydom.com";
138                filename "boot.netbsd.alpha";
139                option root-path "/usr/export/alpha";
140                option domain-name-servers 192.168.1.1;
141                option broadcast-address 255.255.255.0;
142                option domain-name "my.domain";
143        }
144
1452.2.2 The Alpha Console
146
147    The only Ethernet device the console on most Alpha systems
148    knows how to boot from is the onboard Ethernet interface or a
149    DEC Tulip (21040, 21041, 21140) based PCI Ethernet card. Some
150    older SMC 100 Mbps card that use this chip have been known to
151    work as well. Many older systems will not be able to use the
152    newer 2.0 stepping of the 21140, however. If your system appears
153    not to be receiving packets, this may be the problem. (You may
154    or may not be able to update your firmware to fix this; see
155    the alpha port pages on www.netbsd.org for more information on
156    this.)
157
158    Once you're set up, you should be able to boot with:
159
160            boot -proto bootp ewa0
161
162    (The command may be different on some very old machines.)
163
1643. Preparing the Disk
165
166    If you're going to be running a diskless machine, the steps so
167    far have prepared you to run, and you can skip to section 5
168    ("Configuration") below.
169
170    If you are going to run NetBSD from a local hard drive, however,
171    this hard drive needs to be prepared. This preparation consists
172    of putting a label on the disk, which includes information on
173    the sizes and placement of the partition into which the disk
174    is divided, putting the boot blocks on the disk, and initialising
175    the filesystems on the partitions. This work is done by the
176    `install' script from the boot floppy (or boot kernel, if you
177    booted it via NFS with the INSTALL kernel).
178
1793.1 Running Install
180
181    When you first boot the INSTALL kernel you will be given the
182    options of `install' or `shell'. Choose `install' and the
183    install script will start.
184
185    If, at any time, you have made a mistake in the install script
186    and want to abort, press ^C. This will take you to a shell
187    prompt.  You can then restart the install script by typing
188    `/install', or halt the machine by typing `halt'.
189
1903.1 Answering the Install Questions
191
192    These will for the most part be fairly obvious. You may install
193    on either a SCSI or an IDE disk, and you will be prompted for
194    the disk to install on. The disks in your system will be numbered
195    starting at xd0 (where x is an `s' for SCSI disks, `w' for IDE
196    disks) based on the SCSI ID or IDE drive order; if you have
197    more than one disk, watch the boot messages carefully to see
198    which ones are probed as which numbers.
199
200    Once you've selected a disk to install on, you'll be prompted
201    for the geometry. This is also displayed in the boot messages,
202    and you'll be given a chance to review the boot messages again
203    to get the exact figures for the number of cylinders, heads
204    and sectors.
205
206    After this you must specify the size of your partitions.
207    Generally you'll be giving the sizes in cylinders; the install
208    program will tell you how many bytes there are in each cylinder.
209
210    The swap partition is the second thing you specify, after the
211    root partition. Regardless of the size of your disk, you'll
212    want to specify a swap partition that's at least as large as
213    the amount of RAM you have, and probably not less than 64 MB
214    in any case.
215
216    If you have a small disk (under 500 MB), it's probably best to
217    devote all of the disk (excepting 64 MB or more for the swap)
218    to the root partition.
219
220    If you have more space, we recommend devoting at least 32 MB,
221    and preferably 48 MB, to the root partition. /usr will need
222    150 MB or so if you're not installing X, 200 MB or so if you
223    are.
224
225    Once you've specified this information, the install script will
226    write the disklabel, install boot blocks to make the disk
227    bootable, initialise the filesystems, and mount them all under
228    /mnt. You're now ready to go on to the next step.
229
2304. Installing NetBSD
231
232    To install NetBSD you'll have to get access to the tar files
233    that contain the operating system, and extract them to your
234    disk.  You can get access to the tar files through either a
235    network or from a CD-ROM.
236
2374.1 Preparing to Install from a CD-ROM
238
239    All you need to do is mount the CD-ROM, which will generally
240    be device cd0. (The initial boot messages will tell you what
241    the CD-ROM drive as probed as.) This would be done with:
242
243        mount -r -t cd9660 /dev/cd0a /mnt2
244
2454.2 Preparing to Install from the Network
246
247    The first thing you need to do is configure the loopback network
248    interface, which is done with the command
249
250        ifconfig lo0 127.0.0.1
251
252    Then you will have to configure your Ethernet card. The command
253
254        ifconfig -l
255
256    will give you a list of the network interfaces on your system.
257    It will show you your ethernet cards first, followed by lo0
258    (the loopback interface that we configured above), ppp0 (the
259    PPP interface) and sl0 (the SLIP interface).
260
261    To configure your ethernet card, type
262
263        ifconfig <if> inet <addr> [netmask <netmask>] [media <media>]
264
265    Where <if> is the network card (interface), <addr> is the IP
266    address, the optional <netmask> parameter is the network mask,
267    and the optional <media> parameter is one of:
268
269        10base2         BNC connector, 10 Mbps
270        AUI             AUI connector, 10 Mbps
271        10baseT/UTP     Twisted pair connector, 10 Mbps
272        100baseTX       Twisted pair connector, 100 Mbps
273        100baseFX       Fibre-optic connector, 100 Mbps
274        100baseT4       T4 twisted pair interface, 100 Mbps
275
276    If the host you are getting the data files from is not on the
277    local network, you will also have to configure a gateway into
278    your system. Do this with
279
280        route add default <gateway-IP-address>
281
282    In order to save space on the install floppy, the resolver does
283    not implement the DNS protocol, ignores /etc/resolv.conf and
284    does only host table lookups.  You can specify all host addresses
285    as IP numbers or you can enter the host names and numbers into
286    /etc/hosts. For example, you can prepare a hosts table beforehand,
287    and ftp(1) it down (by IP number) to /etc/hosts
288
289    Once networking has been configured, you may mount the directory
290    with the install files via NFS, or download them via FTP.
291
292    To mount them via nfs, type
293
294        mount -t nfs <hostname:/path/to/nfs/volume> /mnt2
295
296    If this volume has been exported read-only, you may need the
297    `-r' option to mount.
298
299    To download the install sets with ftp, create a directory in
300    which to put them and then use the ftp client to download them.
301    Mirror sites are listed at: "http://www.netbsd.org/Sites/net.html".
302    A typical session might be:
303
304        mkdir /mnt/var/tmp
305        cd /mnt/var/tmp
306        ftp ftp.netbsd.org
307        [all the following commmands are given to the ftp program
308            after logging in]
309        prompt
310        cd /pub/NetBSD/NetBSD-1.3.2/alpha/binary/sets
311        mget *
312        bye
313
314    Feel free, of course, to leave off the sets that you don't need
315    if you don't plan to install everything.
316
317    You are now ready to proceed to step 4.3.
318
3194.3 Extracting the Operating System Files
320
321    This is quite simple. Change to the root directory of your hard
322    drive (which is /mnt if you've used the standard install script
323    to this point) by typing
324
325        cd /mnt
326
327    For this and the following commands, replace `/mnt/var/tmp/'
328    with the path to your NFS volume or CD-ROM if that's how you
329    chose to access your install files instead.
330
331    The sets and kernel are extracted with
332
333        for file in base kern comp etc games man misc text; do
334            tar xpfz /mnt/var/tmp/$file.tgz;
335	done
336
337    You will now be ready to reboot from your hard disk. Type `sync'
338    twice to make sure all the data is written out to disk and then
339    type `halt' to halt your system and go back to the monitor. At
340    this point you should be able to reboot your system with
341
342        boot dka0
343
344    (or `boot dka100' if your disk drive is on ID 1, etc.--you can
345    usually use `show device' to see a full list of bootable devices
346    in your system). Your system will come up in single-user mode,
347    ready for you to configure it.
348
3494.4 Optional Toolchain Source Module
350
351    The source to the toolchain components is available in:
352
353	/pub/NetBSD/NetBSD-1.3.2/alpha/source/toolchain.tgz
354
355    This module unpacks into ./toolchain, so:
356
357	cd /usr/local
358	ftp ftp://hostname/pub/NetBSD/NetBSD-1.3.2/alpha/source/toolchain.tgz
359	tar xpfz toolchain.tgz
360	rm toolchain.rgz
361
362
3635. Configuring NetBSD
364
365    Configuring your NetBSD system requires editing the /etc/rc.conf
366    file. Most of this file is fairly self-explanatory, but you
367    can `man rc.conf' for further explanations. Remember to set
368    `rc_configured' to YES so you will boot multi-user, set `hostname'
369    and possibly `defaultroute', and add an ifconfig_int for your
370    interface <int>, along the lines of
371
372        ifconfig_de0="inet 123.45.67.89 netmask 255.255.255.0"
373
374    or, if you have myname.my.dom in /etc/hosts:
375
376        ifconfig_de0="inet myname.my.dom netmask 255.255.255.0"
377
378    You will also want either to run named or add an /etc/resolv.conf
379    file (`man resolv.conf' for information on this), use `vipw' to add
380    accounts to your system, edit /etc/aliases to forward root mail to
381    the right place (run `newaliases' afterwards) and edit /etc/rc.local
382    to run any local daemons you use.
383
384
385