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