$NetBSD: install,v 1.7 1998/05/13 19:07:46 ross Exp $ 0. Introduction It's getting easier with every release to install NetBSD/alpha. If you do have problems, don't despair; most complications you might encounter are very easy to fix. We strongly suggest you join the port-alpha list (see the section on mailing lists on http://www.netbsd.org) and ask questions there. Also, please report any problems you've encountered or solved by using the mailing list or by running send-pr(1) so that they can be fixed for the next release. 1. General The following is a walk-through of the steps you will take while getting NetBSD installed on your hard disk. It's divided into three basic components: booting NetBSD (section 2 below), preparing the disk (section 3 below), and loading the operating system files onto the disk (section 4 below). 2. Booting NetBSD You have two choices of how to boot your machine. If you have a floppy drive, you may boot from that. This is probably the simplest way of getting started. If you don't have a floppy drive, you will need to set yourself up for a boot from a file server on the network, which is a little more complex. 2.1 Making and Booting a Floppy The 3.5", 1.44 MB boot floppy image is found under the NetBSD/alpha _VER distribution directory in the file alpha/installation/floppy/floppy-144. You need to take this disk image and put it on a floppy disk. If you have a Unix system handy, you can do this with a command like the following: dd if=floppy-144 of=/dev/rfd0a bs=18k If the Unix system you are using is not a NetBSD system, you will probably need to replace `/dev/rfd0a' with the name of the floppy device on your particular system. If you have an MS-DOS or Windows system available, you can use the `rawrite.exe' utility to transfer the image to a floppy disk. (Note that rawrite.exe doesn't work under many, if not all, Windows NT systems.) This utility is provided with the NetBSD/i386 install tools, under i386/installation/misc; a documentation file, `rawrite.doc' is available there as well. Once the floppy has been made, you simply need to put it in the drive and type boot dva0 Now you may skip to section 3. 2.2 Booting over the Network Booting NetBSD/alpha _VER over a network requires a BOOTP server, a TFTP server and an NFS server. (These are usually all run on the same machine.) There are three basic stages to the boot: 1.The Alpha console software sends a BOOTP request to get its own address, the address of the TFTP server and the file to download. It downloads this file, which is the second stage bootstrap, via TFTP and then executes it. 2.The second stage bootstrap uses further information in the BOOTP packet that the console received to find the NFS server and path and retrieve the kernel (the file /netbsd). After loading the kernel into memory, it executes it. 3.The kernel probes and configures the devices, and then sends out another BOOTP request so it can find out its address, the NFS server, and path. (The kernel probably should get this information from the console, but it currently doesn't.) It then mounts its root via NFS and continues. 2.2.1 Setting Up the Server You will need to set up your server to serve BOOTP, TFTP and NFS. The NFS setup is quite simple. If you want to run a full system from the network, untar the NetBSD snapshot or distribution into a directory on your server and NFS export that directory to the client. (Make sure you put a kernel there as well, and create the device nodes in /dev with `sh ./MAKEDEV all'. Detailed instructions on netbooting can be found by visiting the Alpha platform page of www.NetBSD.org. At the time of this release, the URL for the netbooting instructions is: http://www.netbsd.org/Ports/alpha/netboot.html You'll want to map root to `root' (rather than the default `nobody') when you export your root filesystem. A typical /etc/exports line on a NetBSD system would be: /usr/export/alpha -maproot=0 myclient.mydom.com If you just want to get the install kernel loaded so that you can download sets to the local hard drive of that machine, you need nothing other than the install kernel in the NFS root directory on your server. For the TFTP setup, you need to copy the second stage bootstrap, netboot, into an appropriately named file (I use boot.netbsd.alpha) in the directory used by your TFTP server. If you extracted a full snapshot, you can get the netboot program from /usr/mdec/netboot; if not, you can get this from the installation/netboot directory where you found the alpha distribution. For the BOOTP server you need to specify the: hardware type (Ethernet) hardware address (Ethernet MAC address) IP address of the client subnet mask of the client address of of the TFTP/NFS server name of the second stage bootstrap loaded via TFTP path to the root for the client (mounted via NFS) Here's an example for a Unix system running bootpd: myhost.mydom.com:\ :ht=ethernet:ha=0000c0391ae4:\ :ip=192.168.1.2:sm=255.255.255.0:\ :sa=192.168.1.1:bf=boot.netbsd.alpha:rp=/usr/export/alpha: And here's an example for a Unix system running dhcpd: host axp { hardware ethernet 0:0:c0:39:1a:e4; fixed-address 192.168.1.2; option host-name "myhost.mydom.com"; filename "boot.netbsd.alpha"; option root-path "/usr/export/alpha"; option domain-name-servers 192.168.1.1; option broadcast-address 255.255.255.0; option domain-name "my.domain"; } 2.2.2 The Alpha Console The only Ethernet device the console on most Alpha systems knows how to boot from is the onboard Ethernet interface or a DEC Tulip (21040, 21041, 21140) based PCI Ethernet card. Some older SMC 100 Mbps card that use this chip have been known to work as well. Many older systems will not be able to use the newer 2.0 stepping of the 21140, however. If your system appears not to be receiving packets, this may be the problem. (You may or may not be able to update your firmware to fix this; see the alpha port pages on www.netbsd.org for more information on this.) Once you're set up, you should be able to boot with: boot -proto bootp ewa0 (The command may be different on some very old machines.) 3. Preparing the Disk If you're going to be running a diskless machine, the steps so far have prepared you to run, and you can skip to section 5 ("Configuration") below. If you are going to run NetBSD from a local hard drive, however, this hard drive needs to be prepared. This preparation consists of putting a label on the disk, which includes information on the sizes and placement of the partition into which the disk is divided, putting the boot blocks on the disk, and initialising the filesystems on the partitions. This work is done by the `install' script from the boot floppy (or boot kernel, if you booted it via NFS with the INSTALL kernel). 3.1 Manual Install from the Shell Prompt The normal installation involves running the install shell script and interactively configuring the file systems, and then simply unpacking the tar files into these followed by running MAKEDEV. However, it is also possible to do the installation yourself from the shell, and in any case it is helpful to understand what the install script does. The procedure is: 1. create /etc/disktab(5) 2. run disklabel(8), 3. run newfs(8) 4. mount(8) the new root on /mnt 5. cd to /usr/mdec and run ./installboot(8) If you are reviewing man pages on NetBSD platforms other than alpha, be sure when reading installboot that you read the alpha version by typing: "man 8 alpha/installboot". 3.2 Running Install When you first boot the INSTALL kernel you will be given the options of `install' or `shell'. Choose `install' and the install script will start. If, at any time, you have made a mistake in the install script and want to abort, press ^C. This will take you to a shell prompt. You can then restart the install script by typing `/install', or halt the machine by typing `halt'. 3.3 Answering the Install Questions These will for the most part be fairly obvious. You may install on either a SCSI or an IDE disk, and you will be prompted for the disk to install on. The disks in your system will be numbered starting at xd0 (where x is an `s' for SCSI disks, `w' for IDE disks) based on the SCSI ID or IDE drive order; if you have more than one disk, watch the boot messages carefully to see which ones are probed as which numbers. Once you've selected a disk to install on, you'll be prompted for the geometry. This is also displayed in the boot messages, and you'll be given a chance to review the boot messages again to get the exact figures for the number of cylinders, heads and sectors. After this you must specify the size of your partitions. Generally you'll be giving the sizes in cylinders; the install program will tell you how many bytes there are in each cylinder. The swap partition is the second thing you specify, after the root partition. Regardless of the size of your disk, you'll want to specify a swap partition that's at least as large as the amount of RAM you have, and probably not less than 64 MB in any case. If you have a small disk (under 500 MB), it's probably best to devote all of the disk (excepting 64 MB or more for the swap) to the root partition. If you have more space, we recommend devoting at least 32 MB, and preferably 48 MB, to the root partition. /usr will need 150 MB or so if you're not installing X, 200 MB or so if you are. Once you've specified this information, the install script will write the disklabel, install boot blocks to make the disk bootable, initialise the filesystems, and mount them all under /mnt. You're now ready to go on to the next step. 4. Installing NetBSD To install NetBSD you'll have to get access to the tar files that contain the operating system, and extract them to your disk. You can get access to the tar files through either a network or from a CD-ROM. 4.1 Preparing to Install from a CD-ROM All you need to do is mount the CD-ROM, which will generally be device cd0. (The initial boot messages will tell you what the CD-ROM drive as probed as.) This would be done with: mount -r -t cd9660 /dev/cd0a /mnt2 4.2 Preparing to Install from the Network The first thing you need to do is configure the loopback network interface, which is done with the command ifconfig lo0 127.0.0.1 Then you will have to configure your Ethernet card. The command ifconfig -l will give you a list of the network interfaces on your system. It will show you your ethernet cards first, followed by lo0 (the loopback interface that we configured above), ppp0 (the PPP interface) and sl0 (the SLIP interface). To configure your ethernet card, type ifconfig inet [netmask ] [media ] Where is the network card (interface), is the IP address, the optional parameter is the network mask, and the optional parameter is one of: 10base2 BNC connector, 10 Mbps AUI AUI connector, 10 Mbps 10baseT/UTP Twisted pair connector, 10 Mbps 100baseTX Twisted pair connector, 100 Mbps 100baseFX Fibre-optic connector, 100 Mbps 100baseT4 T4 twisted pair interface, 100 Mbps If the host you are getting the data files from is not on the local network, you will also have to configure a gateway into your system. Do this with route add default In order to save space on the install floppy, the resolver does not implement the DNS protocol, ignores /etc/resolv.conf and does only host table lookups. You can specify all host addresses as IP numbers or you can enter the host names and numbers into /etc/hosts. For example, you can prepare a hosts table beforehand, and ftp(1) it down (by IP number) to /etc/hosts Once networking has been configured, you may mount the directory with the install files via NFS, or download them via FTP. To mount them via nfs, type mount -t nfs /mnt2 If this volume has been exported read-only, you may need the `-r' option to mount. To download the install sets with ftp, create a directory in which to put them and then use the ftp client to download them. Mirror sites are listed at: "http://www.netbsd.org/Sites/net.html". A typical session might be: mkdir /mnt/var/tmp cd /mnt/var/tmp ftp ftp.netbsd.org [all the following commmands are given to the ftp program after logging in] prompt cd /pub/NetBSD/NetBSD-1.3.2/alpha/binary/sets mget * bye Feel free, of course, to leave off the sets that you don't need if you don't plan to install everything. You are now ready to proceed to step 4.3. 4.3 Extracting the Operating System Files This is quite simple. Change to the root directory of your hard drive (which is /mnt if you've used the standard install script to this point) by typing cd /mnt For this and the following commands, replace `/mnt/var/tmp/' with the path to your NFS volume or CD-ROM if that's how you chose to access your install files instead. The sets and kernel are extracted with cd /mnt for file in base kern comp etc games man misc text; do tar xpfz /mnt/var/tmp/$file.tgz; done or (but do NOT unpack source/toolchain.tgz from / or /mnt) perhaps: cd /mnt for file in /mnt/var/tmp/*.tgz; do echo $i tar xpfz $i done Now make the device nodes: cd /mnt/dev sh ./MAKEDEV all You will now be ready to reboot from your hard disk. Type `sync' twice to make sure all the data is written out to disk and then type `halt' to halt your system and go back to the monitor. At this point you should be able to reboot your system with boot dka0 (or `boot dka100' if your disk drive is on ID 1, etc.--you can usually use `show device' to see a full list of bootable devices in your system). Your system will come up in single-user mode, ready for you to configure it. 4.4 Optional Toolchain Source Module The source to the toolchain components is available in: /pub/NetBSD/NetBSD-1.3.2/alpha/source/toolchain.tgz This module unpacks into ./toolchain, so: cd /usr/local ftp ftp://hostname/pub/NetBSD/NetBSD-1.3.2/alpha/source/toolchain.tgz tar xpfz toolchain.tgz rm toolchain.rgz 5. Configuring NetBSD Configuring your NetBSD system requires editing the /etc/rc.conf file. Most of this file is fairly self-explanatory, but you can `man rc.conf' for further explanations. Remember to set `rc_configured' to YES so you will boot multi-user, set `hostname' and possibly `defaultroute', and add an ifconfig_int for your interface , along the lines of ifconfig_de0="inet 123.45.67.89 netmask 255.255.255.0" or, if you have myname.my.dom in /etc/hosts: ifconfig_de0="inet myname.my.dom netmask 255.255.255.0" You will also want either to run named or add an /etc/resolv.conf file (`man resolv.conf' for information on this), use `vipw' to add accounts to your system, edit /etc/aliases to forward root mail to the right place (run `newaliases' afterwards) and edit /etc/rc.local to run any local daemons you use.