xref: /netbsd/distrib/notes/alpha/install (revision c4a72b64)
$NetBSD: install,v 1.25 2002/06/30 12:28:55 lukem Exp $

Copyright (c) 1999-2002 The NetBSD Foundation, Inc.
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. All advertising materials mentioning features or use of this software
must display the following acknowledgement:
This product includes software developed by the NetBSD
Foundation, Inc. and its contributors.
4. Neither the name of The NetBSD Foundation nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.

Installation of .Nx*M is now easier than ever! For the latest news, problem reports, and discussion, join the port-\*M mailing list by mailing a line saying

p .Dl subscribe port-\*M

p to .Mt majordomo@netsbd.org . Also, see .Lk http://www.netbsd.org for more information.

p If you encounter any problems, please report them via the mailing list or the .Xr send-pr 1 program so that they can be fixed for the next release.

p To install or upgrade .Nx , you need to first boot an installation program and then interact with the screen-menu program c sysinst . The installation program actually consists of the .Nx kernel plus an in-memory file system of utility programs.

p The usual procedure is to write the installation system to a floppy disk set and then boot from the floppies, however, there are now six ways to boot the .Nx*M installation system! Each approach loads the exact same installation bits. The six paths are:

p . .(bullet -offset indent Floppy disk boot t CD boot t Hard Drive Boot t Magnetic Tape Boot t Existing Root FS Boot t Network boot .bullet) .

p In all cases, you need to transfer a bootable image of the installation system from the .Nx CD or from an ftp site to the chosen media type. Although booting from floppy is the usual path, the hard drive boot is useful if you have another operating system (and a spare drive) already installed, or if you don't mind swapping hard drives from box to box. CD and tape boots are nice and fast if you have a CD writer or a tape format in common with another previously installed l system. Finally, most versions of SRM can locate the .Nx boot program c netboot via bootp and download it via tftp, c netboot then mounts the root file system

q Pa / via NFS and loads the kernel.

p Note that if you are installing or upgrading from a writable media, the media can be write-protected if you wish. These systems mount a root image from inside the kernel, and will not need to write to the media. If you booted from a floppy, the floppy disk may be removed from the drive after the system has booted.

p . .(bullet Floppy disk boot

p The 3.5", 1.44 MB boot floppy set is found under the .Nx*M \*V distribution directory in

a \*M/installation/floppy/ as two files called

a disk1of2 and

a disk2of2 . You need to put these two disk images on two floppy disks.

p If you have a l system handy, you can do this with commands like the following:

p .Dl # Ic "dd if=disk1of2 of=/dev/rfd0a bs=18k" .Dl # Ic "dd if=disk2of2 of=/dev/rfd0a bs=18k"

p If the l system you are using is not a .Nx system, you will probably need to replace .Li /dev/rfd0a with the name of the floppy device on your particular system.

p If you have an .Tn MS-DOS or .Tn Windows system available, you can use the c rawrite.exe utility to transfer the image to a floppy disk. This utility is provided with the .Nx Ns /i386 install tools, under

a i386/installation/misc ; a documentation file, c rawrite.doc is available there as well.

p Once the floppy has been made, you simply need to put it in the drive and type

p .Dl \*>\*>\*> Ic "B DVA0"

p t CD boot t Hard Drive boot t Magnetic Tape Boot

p All three of these media types use the same initial image:

a .../installation/diskimage/cdhdtape The image can be written to a hard drive partition with a command like:

p .Dl # Ic "dd if=cdhdtape bs=16k of=/dev/rsd0c"

p To boot from a magnetic tape device such as .Tn DAT or .Tn DLT , it is important to create the tape image with 512-byte records. Use a command like:

p .Dl # Ic "dd if=cdhdtape bs=512 of=/dev/rst0"

p If the host system is not .Nx , the names of the destination devices are likely to be different. Be sure to use a .Dq raw partition device that doesn't skip over labels!

p The use of CD-R devices varies greatly depending on the host OS and host software; it isn't possible to give typical instructions here.

p t Existing Root FS Boot

p The installation subdirectory

a instkernel/ contains

a netbsd.gz ; this is the same install kernel but without a bootable file system image wrapped around it. You can perform an complete reinstall by beginning it as an upgrade, and booting this kernel in the normal way off the root file system

q Pa / of a previous installation.

p The gzipped image can be booted directly; it is not necessary to uncompress it first.

p t Network Boot

p Booting .Nx*M \*V over a network requires a BOOTP or DHCP 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:

p . . .(bullet \*M 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. t The secondary boot program resends the BOOTP request, this time also locating the NFS server and root path. It mounts the root path via NFS and reads in and transfers to the kernel:

a /netbsd . t 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. It then mounts its root

q Pa / via NFS and continues. .bullet) .

p You will need to set up servers for BOOTP, TFTP and NFS.

p If you want to run a full system from the network, untar the .Nx 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

a /dev with c sh ./MAKEDEV all . Detailed instructions on netbooting can be found by visiting the .Nx \*M platform page: .Lk http://www.netbsd.org/Ports/\*M

p At the time of this release, the URL for the netbooting instructions is: .Lk http://www.netbsd.org/Documentation/network/netboot/

p You'll want to map root to .Li root (rather than the default .Li nobody ) when you export your root file system

q Pa / . A typical

a /etc/exports line on a .Nx system would be:

p .Dl /usr/export/\*M -maproot=0 myclient.mydom.com

p One option is to load just the install kernel over the network but then proceed to a normal disk-based install and disk-based operation. (Perhaps the \*M doesn't have a floppy drive, or you just don't want to use a .Tn Windows system to make the floppy; we understand.)

p For this case, you still need to export an NFS root, but the only thing it needs to have in it is the .Li instkernel image from the distribution.

p The gzipped image can be booted directly; it is not necessary to uncompress it first.

p The console will be using TFTP to load the .Nx boot program, so for the TFTP setup, you need to copy the second stage bootstrap, c netboot , into an appropriately named file such as .Li boot.netbsd.\*M in the directory used by your TFTP server. If you extracted a full snapshot, you can get the netboot program from

a /usr/mdec/netboot ; if not, you can get this from the

a installation/netboot directory where you found the \*M distribution.

p For the BOOTP server you need to specify the: . .(bullet -compact -offset indent hardware type (Ethernet) t hardware address (Ethernet MAC address) t IP address of the client t subnet mask of the client t address of of the TFTP/NFS server t name of the second stage bootstrap loaded via TFTP t path to the root for the client (mounted via NFS) .bullet) .

p Here's an example for a l system running c bootpd : .(disp myhost.mydom.com:\ :ht=ethernet:ha=0000c0391ae4:\e :ip=192.168.1.2:sm=255.255.255.0:\e :sa=192.168.1.1:bf=boot.netbsd.\*M:rp=/usr/export/\*M: .disp)

p And here's an example for a l system running the ISC c dhcpd : .(disp 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.\*M"; option root-path "/usr/export/\*M"; option domain-name-servers 192.168.1.1; option broadcast-address 255.255.255.0; option domain-name "my.domain"; } .disp)

p The only Ethernet device the console on most \*M systems knows how to boot from is the onboard Ethernet interface or a .Tn DEC Tulip (21040, 21041, 21140) PCI Ethernet card. Some older SMC 100 Mbps cards 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 \*M port pages on www.netbsd.org for more information on this.) In general, 10 Mb cards from manufacturers other than .Tn DEC will work, and 100 Mb cards not from .Tn DEC will not.

p Once you're set up, you should be able to boot with:

p .Dl \*>\*>\*> Ic "boot -proto bootp ewa0"

p You should permanently set your protocol to .Tn BOOTP with:

p .Dl \*>\*>\*> Ic "set ewa0_protocols bootp"

p The 3000 series of Turbochannel systems and certain other models use .Em old SRM , do not have a .Fl proto option and use different device names. They also tend to not netboot very well so you probably don't need to worry about this section. However, if you want to give it a try, note the following differences: .(bullet -offset indent There is no .Fl proto argument, or c ewa0_protocols variable. Old SRM uses bootp if the device name is given as .Sy ez0 . t The use of the .Xr setnetbootinfo 8 program will probably also be necessary, as it is unlikely that an SRM from that era will properly communicate the ethernet HW address to the boot program. t Example:

p .Dl \*>\*>\*> Ic "boot ez0" .bullet) .bullet) . .

p .so ../common/sysinst . .Ss2 Manual and script-assisted installation . All of the installation procedures consist of putting a label on the disk to provide information on the sizes and placement of the partitions into which the disk is divided, putting the boot blocks on the disk, creating the file systems on the partitions, and unpacking the distribution tar archives. . . .(enum Disk prep: label, boot block, and file system setup . . .(tag "AA." t "A." Manual Install from the Shell Prompt

p 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.

p However, as stated above 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:

p . . .(bullet -compact create

a /etc/disktab , see .Xr disktab 5 t run .Xr disklabel 8 , t run .Xr newfs 8 t .Xr mount 8 the new root on

a /mnt t cd to

a /usr/mdec and run .Xr installboot 8 .bullet) .

p If you are reviewing man pages on .Nx platforms other than \*M, be sure that when reading .Xr installboot 8 you read the \*M version by typing:

p .Dl # Ic man 8 \*M/installboot

p At this point you need only unpack the distribution sets by running .Xr tar 1 as described below. t B.

a /install and

a /upgrade traditional installation scripts

p The

a install and

a upgrade scripts are still there, so by exiting the c sysinst program you can type .Li install or .Li upgrade at the shell prompt and run them as you did in the good old days.

p You may install on either a SCSI or an IDE disk; you will be prompted for the disk to install on. The disks in your system will be numbered starting at .Em x Ns Li d0 (where .Em x is an .Sq Li s for SCSI disks, .Sq Li 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.

p 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.

p 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.

p The swap partition is the second thing you specify, after the

a / (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.

p 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

a / (root) partition.

p If you have more space, we recommend devoting at least 32 MB, and preferably 48 MB, to the

a / (root) partition.

a /usr will need 150 MB or so if you're not installing X, 200 MB or so if you are. A typical organization is 50 MB for

a / (root), 150-250 MB for swap, and the remaining space for

a /usr . With enough swap space configured, you can make

a /tmp a nice, fast mfs. See .Xr mount_mfs 8 , and note that the mfs will require swap space for the largest planned amount of

a /tmp storage. It doesn't return space when files are deleted, but just keeps it its own freelist so the swap space required is equal to the highwater mark of

a /tmp use, plus space required to back up main memory and store inactive images.

p Once you've specified this information, the install script will write the disklabel, install boot blocks to make the disk bootable, initialise the file systems, and mount them all under

a /mnt . You are now ready to go on to the next step. . . . t Configuration: arranging access to the distribution sets

p After doing the disk and file system setup with either shell commands or the script assist, you then need only unpack the distribution sets with the .Xr tar 1 command. To do this you will need access from the target host to the tar files that contain the operating system in order to extract them to your disk. This is done via an NFS or FTP transfer over a network, via a CD-ROM archive, a tape archive, or by preloading an accessible hard drive with the necessary tar files. . . .(bullet Preparing to Install from a CD-ROM

p 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 is probed as.) This would be done with:

p .Dl # Ic "mount -r -t cd9660 /dev/cd0a /mnt2" t Preparing to Install from the Network

p The first thing you need to do is configure the loopback network interface, which is done with the command

p .Dl # Ic "ifconfig lo0 127.0.0.1"

p Then you will have to configure your Ethernet card. The command

p .Dl # Ic "ifconfig -l"

p 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).

p To configure your ethernet card, type c ifconfig Ar if Li inet .Ar addr .Op Li netmask .Op Li media Ar media where .Ar if is the network card (interface), almost always .Li de0 , .Ar addr is the IP address, the optional .Ar netmask parameter is the network mask, and the optional .Ar media parameter is one of: . . l -column "10baseT/UTPxx" "T4 twisted pair interfacexx" "100 Mbpsxxxx" \ -offset indent t 10base2 Ta BNC connector Ta 10 Mbps t AUI Ta AUI connector Ta 10 Mbps t 10baseT/UTP Ta Twisted pair connector Ta 10 Mbps t 100baseTX Ta Twisted pair connector Ta 100 Mbps t 100baseFX Ta Fibre-optic connector Ta 100 Mbps t 100baseT4 Ta T4 twisted pair interface Ta 100 Mbps .El . .

p 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

p .Dl # Ic "route add default \*<gateway-IP-address\*>"

p One improvement over the good old days is that the resolver is now present; by configuring

a /etc/resolv.conf you can get name resolution during any install NFS or FTP operations.

p Once networking has been configured, you may mount the directory with the install files via NFS, or download them via FTP.

p To mount them via nfs, type

p .Dl # Ic "mount -t nfs \*<hostname:/path/to/nfs/volume\*> /mnt2"

p If this volume has been exported read-only, you may need the .Fl r option to mount.

p 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: .Lk http://www.netbsd.org/Sites/net.html A typical session might be:

p .Dl # Ic mkdir /mnt/usr/release .Dl # Ic cd /mnt/usr/release .Dl # Ic ftp ftp.netbsd.org .D1 Em "the following commands are given to the " Ic ftp Em "program after logging in" .Dl ftp\*> Ic "prompt" .Dl ftp\*> Ic "cd /pub/NetBSD/NetBSD-\*V/\*M/binary/sets" .Dl ftp\*> Ic "mget *" .Dl ftp\*> Ic "quit"

p Feel free, of course, to leave off the sets that you don't need if you don't plan to install everything. . .bullet) . t Unpack distribution sets: Extracting the Operating System Files .

p Change to the root directory of your hard drive (which is

a /mnt if you've used the standard install script to this point) by typing

p .Dl # Ic "cd /mnt"

p For this and the following commands, replace

a /mnt/usr/release/ with the path to your NFS volume or CD-ROM if that's how you chose to access your install files instead.

p The sets and kernel are extracted with:

p .Dl # Ic "cd /mnt" .Dl # Ic "for i in base kern comp etc games man misc text; do" .Dl Ic " tar -zxpf /mnt/usr/release/$i.tgz;" .Dl # Ic "done"

p or perhaps:

p .Dl # Ic "cd /mnt" .Dl # Ic "for i in /mnt/usr/release/*.tgz; do" .Dl Ic " echo $i" .Dl Ic " tar -zxpf $i" .Dl # Ic "done"

p Now make the device nodes:

p .Dl # Ic "cd /mnt/dev" .Dl # Ic "sh ./MAKEDEV all" t Restart your system

p Unmount the file systems and halt. The exact instructions to type here will depend on the file systems you created, but typically the commands are:

p .Dl # Ic "cd /" .Dl # Ic "umount /mnt/usr" .Dl # Ic "umount /mnt" .Dl # Ic "sync" .D1 Pq Ic sync Em "is not strictly necessary but it is traditional" .Dl # Ic "halt"

p You should now be at the SRM console's .Li \*>\*>\*> prompt and can reboot into the new configuration (possibly after an optional power cycle) with a command such as:

p .Dl \*>\*>\*> Ic "boot dka0"

p This command might be: c "boot dka100" if your drive is on ID 1. You can usually use c "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. . .enum) . .

p You can create the floppy needed for installation under .Tn MS-DOS or .Tn Windows . Supposing your 1.44 MB floppy drive is drive A:, and your CD is drive c E: , do the following from an .Tn MS-DOS command prompt:

p .Dl Ic "e:" .Dl Ic "cd \eNetBSD-\*V\einstallation\emisc" .Dl Ic "rawrite"

p When asked for a source filename, answer

p .Dl "...\efloppy\edisk1of2

p When asked for a destination drive answer

p .Dl a

p (Repeat the procedure for

a installation/floppy/disk2of2 . )