xref: /netbsd-src/distrib/notes/alpha/install (revision 93f9db1b75d415b78f73ed629beeb86235153473)
1	$NetBSD: install,v 1.13 1998/09/07 21:48:08 veego 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.  This utility is provided with the NetBSD/i386 install
49    tools, under i386/installation/misc; a documentation file,
50    `rawrite.doc' is available there as well.
51
52    Once the floppy has been made, you simply need to put it in the
53    drive and type
54
55        boot dva0
56
57    Now you may skip to section 3.
58
592.2 Booting over the Network
60
61    Booting NetBSD/alpha _VER over a network requires a BOOTP or
62    DHCP server, a TFTP server and an NFS server. (These are usually
63    all run on the same machine.) There are three basic stages to
64    the boot:
65
66    1.The Alpha console software sends a BOOTP request to get its
67    own 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 secondary boot program resends the BOOTP request, this
72    time also locating the NFS server and root path. It mounts the
73    root path via NFS and reads in and transfers to the kernel: /netbsd.
74
75    3.The kernel probes and configures the devices, and then sends
76    out another BOOTP request so it can find out its address, the NFS
77    server, and path. (The kernel probably should get this information
78    from the console, but it currently doesn't.) It then mounts its
79    root via NFS and continues.
80
812.2.1 Setting Up the Server
82
83    You will need to set up your server to serve BOOTP, TFTP and NFS.
84
85    The NFS setup is quite simple. If you want to run a full system
86    from the network, untar the NetBSD snapshot or distribution
87    into a directory on your server and NFS export that directory
88    to the client. (Make sure you put a kernel there as well, and
89    create the device nodes in /dev with `sh ./MAKEDEV all'. Detailed
90    instructions on netbooting can be found by visiting the
91    Alpha platform page of www.NetBSD.org. At the time of this
92    release, the URL for the netbooting instructions is:
93
94	http://www.netbsd.org/Ports/alpha/netboot.html
95
96    You'll want to map root to `root' (rather than the default
97    `nobody') when you export your root filesystem. A typical
98    /etc/exports line on a NetBSD system would be:
99
100        /usr/export/alpha -maproot=0 myclient.mydom.com
101
102    If you just want to get the install kernel loaded so that you
103    can download sets to the local hard drive of that machine, you
104    need nothing other than the install kernel in the NFS root
105    directory on your server.
106
107    For the TFTP setup, you need to copy the second stage bootstrap,
108    netboot, into an appropriately named file (I use boot.netbsd.alpha)
109    in the directory used by your TFTP server. If you extracted a full
110    snapshot, you can get the netboot program from /usr/mdec/netboot;
111    if not, you can get this from the installation/netboot directory
112    where you found the alpha distribution.
113
114    For the BOOTP server you need to specify the:
115
116         hardware type (Ethernet)
117         hardware address (Ethernet MAC address)
118         IP address of the client
119         subnet mask of the client
120         address of of the TFTP/NFS server
121         name of the second stage bootstrap loaded via TFTP
122         path to the root for the client (mounted via NFS)
123
124    Here's an example for a Unix system running bootpd:
125
126         myhost.mydom.com:\
127                 :ht=ethernet:ha=0000c0391ae4:\
128                 :ip=192.168.1.2:sm=255.255.255.0:\
129                 :sa=192.168.1.1:bf=boot.netbsd.alpha:rp=/usr/export/alpha:
130
131    And here's an example for a Unix system running dhcpd:
132
133        host axp {
134                hardware ethernet 0:0:c0:39:1a:e4;
135                fixed-address 192.168.1.2;
136                option host-name "myhost.mydom.com";
137                filename "boot.netbsd.alpha";
138                option root-path "/usr/export/alpha";
139                option domain-name-servers 192.168.1.1;
140                option broadcast-address 255.255.255.0;
141                option domain-name "my.domain";
142        }
143
1442.2.2 The Alpha Console
145
146    The only Ethernet device the console on most Alpha systems
147    knows how to boot from is the onboard Ethernet interface or a
148    DEC Tulip (21040, 21041, 21140) based PCI Ethernet card. Some
149    older SMC 100 Mbps cards that use this chip have been known to
150    work as well. Many older systems will not be able to use the
151    newer 2.0 stepping of the 21140, however. If your system appears
152    not to be receiving packets, this may be the problem. (You may
153    or may not be able to update your firmware to fix this; see
154    the alpha port pages on www.netbsd.org for more information on
155    this.)
156
157    Once you're set up, you should be able to boot with:
158
159            boot -proto bootp ewa0
160
161    Systems with the `old SRM' do not have a -proto option and
162    use different device names.
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 Manual Install from the Shell Prompt
180
181    The normal installation involves running the install shell script
182    and interactively configuring the file systems, and then simply
183    unpacking the tar files into these followed by running MAKEDEV.
184
185    However, it is also possible to do the installation yourself
186    from the shell, and in any case it is helpful to understand
187    what the install script does. The procedure is:
188
189	1. create /etc/disktab(5)
190	2. run disklabel(8),
191	3. run newfs(8)
192	4. mount(8) the new root on /mnt
193	5. cd to /usr/mdec and run ./installboot(8)
194
195    If you are reviewing man pages on NetBSD platforms other than
196    alpha, be sure when reading installboot that you read the alpha
197    version by typing: "man 8 alpha/installboot".
198
1993.2 Running Install
200
201    When you first boot the INSTALL kernel you will be given the
202    options of `install' or `shell'. Choose `install' and the
203    install script will start.
204
205    If, at any time, you have made a mistake in the install script
206    and want to abort, press ^C. This will take you to a shell
207    prompt.  You can then restart the install script by typing
208    `/install', or halt the machine by typing `halt'.
209
2103.3 Answering the Install Questions
211
212    These will for the most part be fairly obvious. You may install
213    on either a SCSI or an IDE disk, and you will be prompted for
214    the disk to install on. The disks in your system will be numbered
215    starting at xd0 (where x is an `s' for SCSI disks, `w' for IDE
216    disks) based on the SCSI ID or IDE drive order; if you have
217    more than one disk, watch the boot messages carefully to see
218    which ones are probed as which numbers.
219
220    Once you've selected a disk to install on, you'll be prompted
221    for the geometry. This is also displayed in the boot messages,
222    and you'll be given a chance to review the boot messages again
223    to get the exact figures for the number of cylinders, heads
224    and sectors.
225
226    After this you must specify the size of your partitions.
227    Generally you'll be giving the sizes in cylinders; the install
228    program will tell you how many bytes there are in each cylinder.
229
230    The swap partition is the second thing you specify, after the
231    root partition. Regardless of the size of your disk, you'll
232    want to specify a swap partition that's at least as large as
233    the amount of RAM you have, and probably not less than 64 MB
234    in any case.
235
236    If you have a small disk (under 500 MB), it's probably best to
237    devote all of the disk (excepting 64 MB or more for the swap)
238    to the root partition.
239
240    If you have more space, we recommend devoting at least 32 MB,
241    and preferably 48 MB, to the root partition. /usr will need
242    150 MB or so if you're not installing X, 200 MB or so if you
243    are. A typical organization is 50 MB for root, 150-250 MB for
244    swap, and the remaining space for /usr. With enough swap space
245    configured, you can make /tmp a nice, fast mfs. See man 8
246    mount_mfs, and note that the mfs will require swap space for
247    the largest planned amount of /tmp storage. It doesn't return
248    space when files are deleted, but just keeps it its own freelist
249    so the swap space required is equal to the highwater mark of
250    /tmp use, plus space required to back up main memory and store
251    inactive images.
252
253    Once you've specified this information, the install script will
254    write the disklabel, install boot blocks to make the disk
255    bootable, initialise the filesystems, and mount them all under
256    /mnt. You're now ready to go on to the next step.
257
2584. Installing NetBSD
259
260    To install NetBSD you'll have to get access to the tar files
261    that contain the operating system, and extract them to your
262    disk.  You can get access to the tar files through either a
263    network or from a CD-ROM.
264
2654.1 Preparing to Install from a CD-ROM
266
267    All you need to do is mount the CD-ROM, which will generally
268    be device cd0. (The initial boot messages will tell you what
269    the CD-ROM drive is probed as.) This would be done with:
270
271        mount -r -t cd9660 /dev/cd0a /mnt2
272
2734.2 Preparing to Install from the Network
274
275    The first thing you need to do is configure the loopback network
276    interface, which is done with the command
277
278        ifconfig lo0 127.0.0.1
279
280    Then you will have to configure your Ethernet card. The command
281
282        ifconfig -l
283
284    will give you a list of the network interfaces on your system.
285    It will show you your ethernet cards first, followed by lo0
286    (the loopback interface that we configured above), ppp0 (the
287    PPP interface) and sl0 (the SLIP interface).
288
289    To configure your ethernet card, type
290
291        ifconfig <if> inet <addr> [netmask <netmask>] [media <media>]
292
293    Where <if> is the network card (interface), <addr> is the IP
294    address, the optional <netmask> parameter is the network mask,
295    and the optional <media> parameter is one of:
296
297        10base2         BNC connector, 10 Mbps
298        AUI             AUI connector, 10 Mbps
299        10baseT/UTP     Twisted pair connector, 10 Mbps
300        100baseTX       Twisted pair connector, 100 Mbps
301        100baseFX       Fibre-optic connector, 100 Mbps
302        100baseT4       T4 twisted pair interface, 100 Mbps
303
304    If the host you are getting the data files from is not on the
305    local network, you will also have to configure a gateway into
306    your system. Do this with
307
308        route add default <gateway-IP-address>
309
310    In order to save space on the install floppy, the resolver does
311    not implement the DNS protocol, ignores /etc/resolv.conf and
312    does only host table lookups.  You can specify all host addresses
313    as IP numbers or you can enter the host names and numbers into
314    /etc/hosts. For example, you can prepare a hosts table beforehand,
315    and ftp(1) it down (by IP number) to /etc/hosts. This is not
316    stored on the floppy but on the temporary ramdisk filesystem,
317    so it must be repeated on any subsequent reboots from floppy.
318
319    Once networking has been configured, you may mount the directory
320    with the install files via NFS, or download them via FTP.
321
322    To mount them via nfs, type
323
324        mount -t nfs <hostname:/path/to/nfs/volume> /mnt2
325
326    If this volume has been exported read-only, you may need the
327    `-r' option to mount.
328
329    To download the install sets with ftp, create a directory in
330    which to put them and then use the ftp client to download them.
331    Mirror sites are listed at: "http://www.netbsd.org/Sites/net.html".
332    A typical session might be:
333
334        mkdir /mnt/usr/release
335        cd /mnt/usr/release
336        ftp 204.152.184.75	 (ftp.netbsd.org when this was written)
337        [all the following commmands are given to the ftp program
338            after logging in]
339        prompt
340        cd /pub/NetBSD/NetBSD-1.3.2/alpha/binary/sets
341        mget *
342        bye
343
344    Feel free, of course, to leave off the sets that you don't need
345    if you don't plan to install everything.
346
347    You are now ready to proceed to step 4.3.
348
3494.3 Extracting the Operating System Files
350
351    This is quite simple. Change to the root directory of your hard
352    drive (which is /mnt if you've used the standard install script
353    to this point) by typing
354
355        cd /mnt
356
357    For this and the following commands, replace `/mnt/usr/release/'
358    with the path to your NFS volume or CD-ROM if that's how you
359    chose to access your install files instead.
360
361    The sets and kernel are extracted with
362
363	cd /mnt
364        for i in base kern comp etc games man misc text; do
365            tar xpzf /mnt/usr/release/$i.tgz;
366	done
367
368    or (but do NOT unpack source/toolchain.tgz from / or /mnt) perhaps:
369
370	cd /mnt
371	for i in /mnt/usr/release/[a-z]*.tgz; do
372	    echo $i
373	    tar xpzf $i
374	done
375
376    Now make the device nodes:
377
378	cd /mnt/dev
379	sh ./MAKEDEV all
380
381    Unmount the file systems and halt. The exact instructions to
382    type here will depend on the file systems you created, but
383    typically the commands are:
384
385	cd /
386	umount /mnt/usr
387	umount /mnt
388	sync		# not needed but traditional
389	halt
390
391    You should now be at the SRM console's >>> prompt and can reboot
392    into the new configuration (possibly after an optional power cycle)
393    with a command such as:
394
395        boot dka0
396
397    This command might be: `boot dka100' if your drive is on ID 1.
398    You can usually use `show device' to see a full list of bootable
399    devices in your system). Your system will come up in single-user
400    mode, ready for you to configure it.
401
4024.4 Optional Toolchain Source Module
403
404    The source to the toolchain components is available in:
405
406	.../alpha/source/toolchain.tgz
407
408    This module unpacks into ./toolchain, so:
409
410	cd /usr/local
411	tar xpzf .../toolchain.tgz
412