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