$NetBSD: install,v 1.18 1998/01/09 18:46:30 perry Exp $ 0. Introduction Using "sysinst", installing NetBSD is a relatively easy process. You still should read this document and have it in hand when doing the installation process. This document tries to be a good guideline for the installation and as such covers many details to be complete. Do not let this discourage you, the install program is not hard to use. 0.1 Possible PCMCIA issues There is a serious bug that may make installation of NetBSD on PCMCIA machines difficult. This bug does not make USE of PCMCIA difficult once a machine is installed. If you do not have PCMCIA on your machine (PCMCIA is only really used on laptop machines), you can skip this section, and ignore the "[PCMCIA]" notes. This will explains how to work around the installation problem. It is anticipated that this bug will be fixed by NetBSD 1.4 What is the bug: The kernel keeps careful track of what interrupts and i/o ports are in use during autoconfiguration. It then allows the PCMCIA devices to pick unused interrupts and ports. Unfortunately, not all devices are included in the INSTALL kernels in order to save space. Let's say your laptop has a soundblaster device built in. The INSTALL kernel has no sound support. The PCMCIA code might allocate your soundblaster's IRQ and i/o ports to PCMCIA devices, causing them not to work. This is especially bad if one of the devices in question is your ethernet card. This problem will impact some, but not all, users of PCMCIA. If this bug is hurting you, watch the "[PCMCIA]" notes that will appear in this document. 1. General The following is a walk-through of the steps you will take while getting NetBSD installed on your hard disk. sysinst is a menu driven installation system that allows for some freedom in doing the installation. Sometimes, questions will be asked and in many cases the default answer will be displayed in brackets ("[]") after the question. If you wish to stop the installation, you may hit Control-C at any time, but if you do, you'll have to begin the installation process again from scratch. 2. Booting NetBSD [PCMCIA]: unplug your PCMCIA devices, so that they won't be found by NetBSD. Boot your machine using the boot floppy. The boot loader will start, and will print a countdown and begin booting. You will likely see one "file not found" warning from the boot loader -- ignore this as it is normal, and indicates the boot loader failed to find a normal kernel to boot before trying to boot a compressed kernel. If the boot loader messages do not appear in a reasonable amount of time, you either have a bad boot floppy or a hardware problem. Try writing the install floppy image to a different disk, and using that. If that doesn't work, try booting after disabling your CPU's internal and external caches (if any). If it still doesn't work, NetBSD probably can't be run on your hardware. This can probably be considered a bug, so you might want to report it. If you do, please include as many details about your system configuration as you can. It will take a while to load the kernel from the floppy, probably around a minute or so. You will then be presented with the NetBSD kernel boot messages. This may take a little while, as NetBSD will be probing for a lot of types of hardware, You may want to read the boot messages, to notice your disk's name and geometry. Its name will be something like "sd0" or "wd0" and the geometry will be printed on a line that begins with its name. As mentioned above, you may need your disk's geometry when creating NetBSD's partitions. You will also need to know the name, to tell sysinst on which disk to install. The most important thing to know is that 'wd0 is NetBSD's name for your first IDE disk, wd1 the second, etc. 'sd0' is your first SCSI disk, sd1 the second, etc. Note that, once the system has finished booting, you need no longer leave the floppy in the disk drive. Earlier version of the NetBSD install floppies mounted the floppy as the system's root partition, but the new installation floppies use a ramdisk file system and are no longer dependent on the floppy once it has booted. Once NetBSD has booted and printed all the boot messages, you will be presented with a welcome message and a main menu. It will also include instructions for using the menus. 3. Network configuration [PCMCIA] You can skip this section, as you will only get data from floppy in the first part of the install. If you will not use network operation during the installation, but you do want your machine to be configured for networking once it is installed, you should first go to the utilities menu, and select the "Configure network option". If you only want to temporarily use networking during the installation, you can specify these parameters later. If you are not using Domain Name Service (DNS), you can give an empty response in reply to answers relating to this. 4. The hard disk to install on and its parameters. To start the installation, select the menu option to install NetBSD from the main menu. The first thing is to identify the disk on which you want to install NetBSD. sysinst will report a list of disks it finds and ask you for your selection. Depending on how many disks are found, you may get a different message. You should see disk names like "wd0", "wd1", "sd0", or "sd1". sysinst next tries to figure out the real and BIOS geometry of your disk. It will present you with the values it found, if any, and will give you a chance to change them. Please note that if you change the values, sysinst WILL ALSO REINITIALIZE YOUR MBR. You will also be asked if you want to use the last cylinder of the disk. Originally, the last cylinder of the disk was used for diagnostic purposes, but this is usually not a concern anymore these days. You will be able to specify whether you want to skip the last cylinder anyway. Next, depending on whether you are using a "wdX" or a "sdX" disk, you will either be asked for the type of disk (wdX) you are using or you will be asked if you want to specify a fake geometry for your SCSI disk (sdX). The types of disk are be IDE, ST-506 or ESDI. If you're installing on an ST-506 or ESDI drive, you'll be asked if your disk supports automatic sector forwarding. If you are SURE that it does, reply affirmatively. Otherwise, the install program will automatically reserve space for bad144 tables. 5. Partitioning the disk. 5.1 Which portion of the disk to use. You will be asked if you want to use the entire disk or only part of the disk. If you decide to use the entire disk for NetBSD, it will be checked if there are already other systems present on the disk, and you will be asked to confirm whether you want to overwrite these. If you want to use the entire disk for NetBSD, you can skip the following section and go to section 5.3, "Editing the NetBSD disklabel". 5.2 Editing the Master Boot Record. First, you will be prompted to specify the units of size that you want to express the sizes of the partitions in. You can either pick megabytes, cylinders or sectors. After this, you will be presented with the current values stored in the MBR, and will be given the opportunity to change, create or delete partitions. For each partition you can set the type, the start and the size. Setting the type to 'unused' will delete a partition. You can also mark a partition as active, meaning that this is the one that the BIOS will start from at boot time. Be sure to mark the partition you want to boot from as active! After you are done editing the MBR, a sanity check will be done, checking for partitions that overlap. If everything is ok, you can go on to the next step, editing the NetBSD disklabel. 5.3 Editing the NetBSD disklabel. The partition table of a NetBSD part of a disk is called a 'disklabel'. There are 3 layouts for the NetBSD part of the disk that you can pick from: Standard, Standard with X and Custom. The first two use a set of default values (that you can change) suitable for a normal installation, possibly including X. The last option lets you specify everything yourself. You will be presented with the current layout of the NetBSD disklabel, and given a chance to change it. For each partition, you can set the type, offset and size, block and fragment size, and the mount point. The type that NetBSD uses for normal file storage is called "4.2BSD". A swap partition has a special type called "swap". You can also specify a partition as type "msdos". This is useful if you share the disk with MS-DOS or Windows95, NetBSD is able to access the files on these partitions. You can use the values from the MBR for the MS-DOS part of the disk to specify the partition of type "msdos" (you don't have to do this now, you can always re-edit the disklabel to add this once you have installed NetBSD). Some partitions in the disklabel have a fixed purpose. Partition 'a' is always the root partition, 'b' is the swap partition, 'c' is the entire NetBSD part of the disk, and 'd' is the whole disk. Partitions 'e'-'h' are available for other use. Traditionally, 'e' is the partition mounted on the /usr directory, but this is historical practice, not a fixed value. You will then be asked to name your disk's disklabel. The default response is "mydisk". For most purposes this will be OK. If you choose to name it something different, make sure the name is a single word and contains no special characters. You don't need to remember this name. 6. Preparing your hard disk YOU ARE NOW AT THE POINT OF NO RETURN. Nothing has been written to your disk yet, but if you confirm that you want to install NetBSD, your hard drive will be modified. If you are sure you want to proceed, enter "yes" at the prompt. The install program will now label your disk and make the file systems you specified. The filesystems will be initialized to contain NetBSD bootstrapping binaries and configuration files. You will see messages on your screen from the various NetBSD disk preparation tools that are running. There should be no errors in this section of the installation. If there are, restart from the beginning of the installation process. Otherwise, you can continue the installation program after pressing 'return'. NOTE: In previous versions of NetBSD, the kernel from the install floppy was copied onto the hard drive in a special step. In the new install system, the kernel on the floppy is unsuited to being copied onto the hard drive. Instead, a new set, "kern", has been added which contains a generic kernel to be unloaded onto the drive. So, you can not boot from your hard drive yet at this point. 7. Getting the distribution sets. [PCMCIA] Load a kernel tar file (i.e. the kern.tgz set file) on to your hard disk, for example by mounting the hard disk first, copying the kern.tgz file from floppy and unpacking it. Example: mount /dev/wd0a /mnt cd /mnt mount -t msdos /dev/fd0a /mnt2 cp /mnt2/kern.* . umount /mnt2 cat kern.* | tar vxzf - Then halt the machine using the 'halt' command. Power the machine down, and re-insert all the PCMCIA devices. Remove any floppy from the floppy drive. Start the machine up. After booting NetBSD, you will be presented with the main sysinst menu. Choose the option to re-install sets. Wait for the filesystem checks that it will do to finish, and then proceed as described below. The NetBSD distribution consists of a number of 'sets', that come in the form of gzipped tarfiles. A few sets must be installed for a working system, others are optional. At this point of the installation, you will be presented with a menu which enables you to choose from one of the following methods of installing the sets. Some of these methods will first load the sets on your hard disk, others will extract the sets directly. For all these methods, the first step is making the sets available for extraction, and then do the actual installation. The sets can be made available in a few different ways. The following sections describe each of those methods. After reading the one about the method you will be using, you can continue to section 8 7.1 Installation using ftp To be able to install using ftp, you first need to configure your network setup, if you haven't already at the start of the install procedure. sysinst will do this for you, asking you to provide some data, like IP number, hostname, etc. If you do not have name service set up for the machine that you are installing on, you can just press 'return' in answer to these questions, and DNS will not be used. You will also be asked to specify the host that you want to transfer the sets from, the directory on that host, and the account name and password used to log into that host using ftp. If you did not set up DNS when answering the questions to configure networking, you will need to specify an IP number instead of a hostname for the ftp server. sysinst will proceed to transfer all the default set files from the remote site to your hard disk. 7.2 Installation using NFS To be able to install using NFS, you first need to configure your network setup, if you haven't already at the start of the install procedure. sysinst will do this for you, asking you to provide some data, like IP number, hostname, etc. If you do not have name service set up for the machine that you are installing on, you can just press 'return' in answer to these questions, and DNS will not be used. You will also be asked to specify the host that you want to transfer the sets from, and the directory on that host that the files are in. This directory should be mountable by the machine you are installing on, i.e. correctly exported to your machine. If you did not set up DNS when answering the questions to configure networking, you will need to specify an IP number instead of a hostname for the NFS server. 7.3 Installation from CD-ROM When installing from a CD-ROM, you will be asked to specify the device name for your CD-ROM player (usually 'cd0'), and directory name on the CD-ROM where the distribution files are. sysinst will then check if the files are indeed available in the specified location, and proceed to the actual extraction of the sets. 7.4 Installation from floppy Because the installation sets are too big to fit on one floppy, the floppies are expected to be filled with the split set files. The floppies are expected to be in MS-DOS format. You will be asked for a directory where the sets should be reassembled. Then you will be prompted to insert the floppies containing the split sets. This process will continue until all the sets have been loaded from floppy. 7.5 Installation from an unmounted filesystem In order to install from a local filesystem, you will need to specify the device that the filesystem resides on (for example 'wd1e'), the type of the filesystem, and the directory on the specified filesystem where the sets are located. sysinst will then check if it can indeed access the sets at that location. 7.6 Installation from a local directory This option assumes that you have already done some preparation yourself. The sets should be located in a directory on a filesystem that is already accessible. sysinst will ask you for the name of this directory. 8. Extracting the distribution sets After you the install sets containing the NetBSD distribution have been made available, you can either extract all the sets (a full installation), or only extract sets that you have selected. In the latter case you will be shown the currently selected sets, and given the opportunity to select the sets you want. Some sets always need to be installed ("kern", "base" and "etc"), they will not be shown in this selection menu. Before extraction begins, you can elect to watch the files being extracted; the name of each file that is extracted will be shown. After all the files have been extracted, all the necessary device node files will be created. If you have already configured networking, you will be asked if you want to use this configuration for normal operation. If so, these values will be installed in the network configuration files. 9. Finalizing your installation. Congratulations, you have successfully installed NetBSD _VER. You can now reboot the machine, and boot from harddisk. NetBSD will enter single-user mode, and you will be presented with a shell prompt. You should now edit the /etc/rc.conf file to configure the system to suit your needs. To do this, you might want to first make all local filesystems accessible and set the terminal type, so that, for example, vi will work properly. The following commands will do this: mount -a TERM=pc3 ; export TERM You should at least do the following in /etc/rc.conf: * Change rc_configured=NO to rc_configured=YES * Set the hostname in the 'hostname' line, e.g. hostname="somename" You are advised to take a look at the other items in the /etc/rc.conf file, and change them if you wish. After you have made and saved the changes, reboot the machine again. After reboot, you can log in "root" at the login prompt. There is no initial password, but if you're using the machine in a networked environment, you should create yourself an account and protect it and the "root" account with good passwords. Some other files in the NetBSD _VER distribution might need to be tailored for your site. In particular, the /etc/sendmail.cf file will almost definitely need to be adjusted, and other files in /etc will probably need to be modified, as well. Some leftover files from the installation may be on your hard disk, depending on the procedure you followed. If you find any of the files, you should remove them: /.termcap /sysinst If you are unfamiliar with UN*X-like system administration, it's recommended that you buy a book that discusses it.