Chapter 3. Example installation

Table of Contents

3.1. Introduction
3.2. The installation process
3.3. Keyboard layout
3.4. Starting the installation
3.5. MBR partitions
3.6. Disklabel partitions
3.7. Setting the disk name
3.8. Last chance!
3.9. The disk preparation process
3.10. Choosing the installation media
3.10.1. Installing from CD-ROM or DVD
3.10.2. Installing from an unmounted file system
3.10.3. Installing via FTP
3.10.4. Installing via NFS
3.11. Extracting sets
3.12. System configuration
3.13. Finishing the installation

3.1. Introduction

This chapter will guide through the installation procedure with sysinst, the NetBSD installation program. It describes the installation from CD-ROM, from an unmounted file system, and over the network via FTP or NFS. The concepts are the same for all types of installation; the only difference is in the way the binary sets are found by sysinst. Some details of the installation differ depending on the NetBSD release: The examples from this chapter were created with NetBSD 4.0.

Note

The data from the following install screens are just exemplary values. Do not simply copy them, as your hardware and configuration details may be different!

3.2. The installation process

The installation process is divided logically in two steps. In the first part you create a partition for NetBSD and you write the disklabel for that partition. In the second part you decide which distribution sets you want to install and extract the files in the newly created partitions. The distribution sets are the operating system.

At the end of the first part nothing has yet been written to the hard disk and you are prompted to confirm the installation. If you confirm, the installation goes on, else you are brought back to the main menu and the hard disk remains unchanged.

3.3. Keyboard layout

The NetBSD install program sysinst allows you to change the keyboard layout during the installation. If for some reason this does not work for you, you can use the map in the following table.

US IT DE FR
- ' ß )
/ - - !
= ì ' -
: ç Ö M
; ò ö m
# £ § 3
" ° Ä %
* ( ( 8
( ) ) 9
) = = 0
' à ä ù
` \ ^ @
\ ù # `

3.4. Starting the installation

To start the installation of NetBSD insert the newly created installation floppy and reboot the computer, or boot from a prepared CD, memory card, USB flash drive, (etc.). The kernel on the installation medium is booted and starts displaying a lot of messages on the screen, most of which say something about hardware not being found or not being configured. This is normal as the default install kernel tries to detect almost all the hardware supported by NetBSD; you probably don't have all these devices in your machine.

Figure 3.1. Selecting the language

Selecting the language

When the boot procedure is over you will find yourself in the NetBSD installation program, sysinst, shown in Figure 3.1, “Selecting the language”. From here on you should follow the instructions displayed on the screen, using the INSTALL.* document as a reference. You will find the INSTALL.* document in various formats in the root directory of the NetBSD release. The sysinst screens all have more or less the same layout: the upper part of the screen shows a short description of the current operation or a short help message; the central part of the screen shows the current settings as detected by NetBSD; the bottom part displays a menu of available choices. To make a choice, either use the cursor keys, the “Ctrl+N” (next) and “Ctrl+P” (previous) keys, or press one of the letters displayed left of each choice, and confirm your choice by pressing the Return key.

Start with the selection of the language you prefer for the installation procedure.

The next screen Figure 3.2, “Selecting a keyboard type” will allow you to select a suitable keyboard type.

Figure 3.2. Selecting a keyboard type

Selecting a keyboard type

This will bring you to the main menu of the installation program (Figure 3.3, “The sysinst main menu”).

Figure 3.3. The sysinst main menu

The sysinst main menu

Choosing the “Install NetBSD to hard disk” option brings you to the next screen (Figure 3.4, “Confirming to install NetBSD”), where you need to confirm to continue the installation.

Figure 3.4. Confirming to install NetBSD

Confirming to install NetBSD

After choosing to continue with “Yes”, you select on which hard disk NetBSD shall be installed. If more than one disk is available, sysinst displays a list of disks from which you need to choose one. In the example given in Figure 3.5, “Choosing a hard disk”, there are two disks, and NetBSD will be installed on “wd0”, the first IDE disk found. If you use SCSI or external USB disks, the first will be named “sd0”, the second “sd1” and so on.

Figure 3.5. Choosing a hard disk

Choosing a hard disk

Sysinst will then ask whether you want to do a full, minimal or custom installation. NetBSD is broken into a collection of distributions sets. “Full installation” is the default and will install all sets; “Minimal installation” will only install a small core set, the minimum of what is needed for a working system. If you choose “Custom installation” you can choose which sets you would like to have installed. This step is shown in Figure 3.6, “Full or custom installation”.

Figure 3.6. Full or custom installation

Full or custom installation

If you chose to do a custom installation, sysinst allows you to choose which distribution sets to install, as shown in Figure 3.7, “Selecting distribution sets”. You will at least need a “Kernel” “Base” and “System (/etc)” for a functional installation.

Figure 3.7. Selecting distribution sets

Selecting distribution sets

3.5. MBR partitions

The first important step of the installation has come: the partitioning of the hard disk. First, you need to specify if NetBSD will use a partition (suggested choice) or the whole disk. In the former case it is still possible to create a partition that uses the whole hard disk (Figure 3.8, “Choosing the partitioning scheme”) so we recommend to select this option as it keeps the BIOS partition table in a format which is compatible with other operating systems.

Figure 3.8. Choosing the partitioning scheme

Choosing the partitioning scheme

Figure 3.9, “fdisk”The next step shows the current state of the MBR partition table on the hard disk before the installation of NetBSD: There are four primary partitions and as you can see this disk is currently empty. If you do have other partitions you can leave them around and install NetBSD on a partition that is currently unused, or you can wipe out a partition to use it for NetBSD.

Figure 3.9. fdisk

fdisk

Deleting a partition is simple: after selecting the partition a menu with options for that partition will appear (Figure 3.10, “Partition options”), change the partition kind to “Delete partition” to remove the partition. Of course, if you want to use the partition for NetBSD you can set the partition kind to “NetBSD” right-away.

You can create a partition for NetBSD by selecting the partition you want to install NetBSD to. The partition names “a” to “d” correspond to the four primary partitions on other operating systems. After selecting a partition, a menu with options for that partition will appear, as shown in Figure 3.10, “Partition options”.

Figure 3.10. Partition options

Partition options

To create a new partition the following information must be supplied:

  • the type (kind) of the new partition

  • the first (start) sector of the new partition

  • the size of the new partition

Choose the partition type “NetBSD” for the new partition (using the “type” option). The installation program will automatically try to guess option “start”, by starting after the end of the preceding partition. Change this if necessary. The same thing applies to the “size” option; the installation program will try to fill in the space that is available till the next partition or the end of the disk (depending on which comes first). You can change this value if it is incorrect, or if you do not want NetBSD to use the suggested space.

After you have set up the partition type, start and size, it is a good idea to set the name that should be used in the boot menu. You can do this by selecting the “bootmenu” option, and filling in how NetBSD should appear in the bootmenu, e.g. “NetBSD”. It is a good idea to repeat this step for other bootable partitions: so you can boot both NetBSD and a Windows system (or other operating systems) using the NetBSD bootselector. If you are satisfied with the partition options, you confirm your choice by selecting “Partition OK”. You choose the same option in the fdisk interface to finish the partitioning of the disk.

If you have made an error in partitioning (for example you have created overlapping partitions) sysinst will display a message and suggest to go back to the fdisk menu (but you are also allowed to continue). If the data is correct but the NetBSD partition lies outside the range of sectors which is bootable by the BIOS, sysinst will warn you and ask if you want to proceed anyway. This may eventually lead to problems on older PCs.

Note

This is not a limitation of NetBSD: some old BIOSes cannot boot a partition which lies outside the first 1024 cylinders. To fully understand the problem you should study the different type of BIOSes and the many addressing schemes that they use (physical CHS, logical CHS, LBA, ...). These topics can not be described in this guide.

With the most recent BIOS, supporting int13 extensions, it is possible to install NetBSD in partitions that live outside the first 8 GB of the hard disk, provided that the NetBSD boot selector is installed.

If the data is correct, sysinst will offer to install a boot selector on the hard disk. This screen is shown in Figure 3.11, “Installing the boot selector”.

Figure 3.11. Installing the boot selector

Installing the boot selector

At this point, the first part of the installation, the disk partitioning, is over.

The BIOS partitions (called slices on BSD systems) have been created. They are also called PC BIOS partitions, MBR partitions or fdisk partitions.

Note

Do not confuse the slices or BIOS partitions with the BSD partitions, which are different things.

3.6. Disklabel partitions

Some platforms, like PC systems (i386), use (DOS-style) MBR partitions to separate file systems. The MBR partition you created earlier in the installation process is necessary to make sure that other operating systems do not overwrite the diskspace that you allocated to NetBSD.

NetBSD uses its own partition scheme, named a disklabel, which is stored at the start of the MBR partition. In the next few steps you will create a disklabel(5) and set the sizes of the NetBSD partitions, or use existing partition sizes, as shown in Figure 3.12, “Editing partitions?”.

Figure 3.12. Editing partitions?

Editing partitions?

When you choose to set the sizes of the NetBSD partitions you can predefine what partitions you would like to create. The installation program will generate a disklabel based on these settings. This installation screen is shown in Figure 3.13, “Setting partition sizes”.

Figure 3.13. Setting partition sizes

Setting partition sizes

The default partition scheme of just using a big / (root) file system (plus swap) works fine with NetBSD, and there is little need to change this. Figure 3.13, “Setting partition sizes” shows how to change the size of the swap partition to 600 MB. Changing /tmp to reside on a RAM disk (mfs(8)) for extra speed may be a good idea. Other partition schemes may use separate partitions for /var, /usr and/or /home, but you may use your own experience to decide if you need this.

The next step is to create the disklabel and edit its partitions - if necessary - , using the disklabel editor Figure 3.14, “The disklabel editor”. If you have predefined the partition sizes in the previous step, the resulting disklabel will probably fit your wishes. In these case you can complete the process immediately by selecting “Partition sizes ok”.

Figure 3.14. The disklabel editor

The disklabel editor

There are two reserved partitions, “c”, representing the NetBSD partition, and “d”, representing the whole disk. You can edit all other partitions by using the cursor keys and pressing the return key. You can add a partition by selecting an unused slot, and setting parameters for that partition. The partition editing screen is shown in Figure 3.15, “Disklabel partition editing”

Figure 3.15. Disklabel partition editing

Disklabel partition editing

3.7. Setting the disk name

After defining the data for the new disklabel, the last item is to enter a name for the NetBSD disk as shown in Figure 3.16, “Naming the NetBSD disk”. This can be used later to distinguish between disklabels of otherwise identical disks.

Figure 3.16. Naming the NetBSD disk

Naming the NetBSD disk

3.8. Last chance!

The installer has now all the data to prepare the disk for the installation. Nothing has been written to the disk at this point but now it is the last chance to abort the installation process before actually writing data to the disk, as shown in Figure 3.17, “Last chance to abort”. Choose “no” to abort the installation process and return to the main menu, or continue by selecting “yes”.

Figure 3.17. Last chance to abort

Last chance to abort

3.9. The disk preparation process

After confirming that sysinst should prepare the disk, it will run disklabel(8) to define the NetBSD partition layout and newfs(8) to create the file systems on the disk.

After preparing the NetBSD partitions and their filesystems, the next question shown in Figure 3.18, “Selecting a bootblock” is which bootblock to install. Usually you will choose the default to use the BIOS console, i.e. show boot messages on your computer's display.

If you run a farm of machines without monitor, it may be more convenient to opt for a serial console running on one of the serial ports. The menu also allows changing the serial port's baud rate from the default of 9600 baud, 8 data bits, no parity and one stopbit.

Figure 3.18. Selecting a bootblock

Selecting a bootblock

3.10. Choosing the installation media

Halftime - you have finished the first and most difficult part of the installation!

The second half of the installation process consists of populating the file systems with the the operating system files by extracting the “sets” that you have selected before (base, etc, comp,...). For unpacking the sets, sysinst asks what information you would like to see during that process, as shown in (Figure 3.19, “Choosing the verbosity of the extraction process”). You can choose to let sysinst either show a progress bar, be quiet, or show the name of each extracted file.

Figure 3.19. Choosing the verbosity of the extraction process

Choosing the verbosity of the extraction process

Now sysinst needs to find the NetBSD sets and you must supply this information. The menu offers several choices as shown in Figure 3.20, “Installation media”. The options are explained in detail in the INSTALL.* document.

Figure 3.20. Installation media

Installation media

3.10.1. Installing from CD-ROM or DVD

When selecting “CD-ROM / DVD”, sysinst asks the name of the CD-ROM or DVD device and the directory in which the set files are stored, see Figure 3.21, “CD-ROM/DVD installation”. The device is usually cd0 for the first CD-ROM or DVD drive, regardless if it is IDE or SCSI (or an external USB or FireWire drive).

Figure 3.21. CD-ROM/DVD installation

CD-ROM/DVD installation

The CD-ROM/DVD device name

if you don't know the name of the CD-ROM/DVD device, you can find it in the following way:

  1. Press Ctrl-Z to pause sysinst and go to the shell prompt.

  2. Type the command:

    # dmesg

    This will show the kernel startup messages, including the name of the CD-ROM device, for example cd0.

  3. If the display scrolls too quickly, you can also use more:

    # dmesg | more
  4. Go back to the installation program with the command:

    # fg

3.10.2. Installing from an unmounted file system

Figure 3.22, “Mounting a file system” shows the menu to install NetBSD from an unmounted file system. It is necessary to specify the device ("Device"), the file system of the device ("File system") and the path to the install sets ("Set directory"). The setting for the "Base directory" is optional and can be kept blank.

In the following example the install sets are stored on a MSDOS file system, on partition "e" on the device "sd0".

Figure 3.22. Mounting a file system

Mounting a file system

It is usually necessary to specify the device name and the partition. Figure 3.23, “Mounting a partition ” shows how to specify device "sd0" with partition "e".

Figure 3.23. Mounting a partition

Mounting a partition

In Figure 3.24, “Accessing a MSDOS file system” the file system type is specified. It is “msdos” but it could also be the NetBSD file system “ffs” or “ext2fs”, a Linux file system. The “Base directory” item is left blank and the binary sets are stored under “/sets”. Choosing “x: Continue” will finally start the installation of the sets.

Figure 3.24. Accessing a MSDOS file system

Accessing a MSDOS file system

3.10.3. Installing via FTP

If you choose to install from a local network or the Internet via FTP, sysinst will configure the system's network connection, download the selected set files to a temporary directory and extract them.

The NetBSD versions 3.x and 4.x currently support the installation via ethernet, ethernet-over-USB and wireless LAN. Installation via DSL (PPP over Ethernet) is not supported during installation.

The first step shown in Figure 3.25, “Which network interface to configure” consists of selecting which network card to configure. sysinst will determine a list of network interfaces available in your hardware, present them and ask which one it shall use.

Note

The exact names of your network interfaces depends on the hardware you use, example interfaces are “ne” for NE2000 and compatible ethernet cards, “tlp” for TULIP-based ethernet cards, “wi” for Lucent WaveLAN and “ath” for Atheros based wireless cards. This list is by no means complete, and NetBSD supports many more network devices.

To get a list of network interfaces available on your system (or rather, a list of all the network interfaces which NetBSD detected), interrupt the installation process by pressing “Ctrl+Z”, then enter

# ifconfig -a
ne2: flags=8822<UP,BROADCAST,NOTRAILERS,SIMPLEX,MULTICAST> mtu 1500
        address: 00:06:0d:c6:73:d5
        media: Ethernet autoselect 10baseT full-duplex
        status: active
        inet 0.0.0.0 netmask 0xffffff00 broadcast 0.0.0.0
        inet6 fe80::206:dff:fec6:73d5%ne2 prefixlen 64 scopeid 0x1
lo0: flags=8009<UP,LOOPBACK,MULTICAST> mtu 33196
        inet 127.0.0.1 netmask 0xff000000
        inet6 ::1 prefixlen 128
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2
ppp0: flags=8010<POINTOPOINT,MULTICAST> mtu 1500
ppp1: flags=8010<POINTOPOINT,MULTICAST> mtu 1500
sl0: flags=c010<POINTOPOINT,LINK2,MULTICAST> mtu 296
sl1: flags=c010<POINTOPOINT,LINK2,MULTICAST> mtu 296
strip0: flags=0 mtu 1100
strip1: flags=0 mtu 1100 

for a list of all network interfaces (ne2, lo0, ppp0, ...), and their current state. To get more information about all the devices found during system startup, including network devices, type

# dmesg | more

To only get information about a single device, for example “ne2”, run:

# dmesg | grep ^ne2
ne2 at pci0 dev 3 function 0: Realtek 8029 Ethernet
ne2: Ethernet address 00:06:0d:c6:73:d5
ne2: 10base2,, 10baseT, 10baseT-FDX, auto, default [0x40 0x40] 10baseT-FDX
ne2: interrupting at irq 11

You can return to the NetBSD installation by typing

# fg

Figure 3.25. Which network interface to configure

Which network interface to configure

Next, here is a chance to configure options for your network medium, like duplex settings for ethernet, and various settings for wireless LAN cards.

Note

It is unlikely that you will need to enter anything other than the default here. If you experience problems like very slow transfers or timeouts, you may for example force different duplex settings for ethernet cards here. To get a list of supported media and media options for a given network device (say: “ne2”), escape from sysinst by pressing “Ctrl+Z”, then enter:

# ifconfig -m ne2
ne2: flags=8822<UP,BROADCAST,NOTRAILERS,SIMPLEX,MULTICAST> mtu 1500
        address: 00:03:0d:c6:73:d5
        media: Ethernet 10baseT full-duplex
        status: active
        supported Ethernet media:
                media 10baseT
                media 10baseT mediaopt full-duplex
                media 10base2
                media autoselect

The various values given after “media” may be of interest here, including keywords like “autoselect” but also including any “mediaopt” settings.

Return to the installation by typing:

# fg

The next question will be if you want to perform DHCP autoconfiguration as shown in Figure 3.26, “Using DHCP for network configuration”. Answer “Yes” if you have a server for the Dynamic Host Configuration Protocol (DHCP) running somewhere on your network, and sysinst will fetch a number of defaults from it. Answer “No” to enter all the values manually.

To explain things, we will assume you answered “No” and go into all the questions asked in detail.

Figure 3.26. Using DHCP for network configuration

Using DHCP for network configuration

Figure 3.27, “Entering and configuring network data” shows the questions asked for the network configuration. The values asked for are:

Your DNS Domain:

This is the name of the domain you are in.

Your host name:

The name by which other machines can usually address your computer. Not really used during installation.

Your IPv4 number:

Enter your numerical Internet Protocol address in “dotted quad” notation here, for example 192.168.1.3

IPv4 Netmask:

The netmask for your network, either given as a hex value (“0xffffff00”) or also in dotted-quad notation (“255.255.255.0”).

IPv4 gateway:

Your router's (or default gateway's) IP address. Do not use a hostname here!

IPv4 name server:

Your (first) DNS server's IP address. Again, don't use a hostname here to avoid some nasty problems.

Figure 3.27. Entering and configuring network data

Entering and configuring network data

After answering all questions for the network configuration, they will be printed again with a chance to go back and re-enter them, see Figure 3.28, “Confirming network parameters”. When selecting “No”. Choose “Yes” if you are satisfied with your settings to proceed with the installation.

Figure 3.28. Confirming network parameters

Confirming network parameters

sysinst will now run a few commands (not displayed in detail here) to configure the network: flushing the routing table, setting the default route, and testing if the network connection is operational.

After the installer knows the destination where to download the files, what network connection to use for downloading them, and on which partition and file system to extract them, the last data missing is the place where to download the install sets from, which is what the next dialogue shown in Figure 3.29, “Defining the FTP settings” allows to change. You can adjust the server where the distribution sets are fetched from, the base directory of the NetBSD release you want to install and the set directory (relative to the base directory), which usually contains the architecture you want to install. You can also change the FTP user's login name (“user”) and password here, if needed. If you want to use a FTP proxy for downloading, enter its URL here as well.

When you are satisfied with your settings (the defaults work most of the time), choose “Get Distribution” to continue.

Figure 3.29. Defining the FTP settings

Defining the FTP settings

The distribution sets will now get downloaded and extracted. After extracting all selected sets, sysinst will create device nodes in the /dev directory. The installer will then ask, if the network settings should be saved permanently for regular use, as shown in Figure 3.30, “Saving the network settings”:

Figure 3.30. Saving the network settings

Saving the network settings

3.10.4. Installing via NFS

If you want to install NetBSD from a server in your local network, NFS is an alternative to FTP.

Note

Using this installation method requires the knowledge to setup a NFS server and is a task for experienced users.

As shown in Figure 3.31, “NFS install screen” using NFS requires to specify the IP address of the NFS server with "Host", the "Base directory" that is exported by the NFS server and the "Set directory", which contains the install sets.

Figure 3.31. NFS install screen

NFS install screen

Figure 3.32, “NFS example” shows an example: Host “192.168.1.50 ” is the NFS server, that provides the directory “/home/username/Downloads” accessible over network. The NetBSD install sets are stored in the directory “/home/username/Downloads/sets” on the NFS server. Choose “Continue” to start the installation of the distribution sets.

Figure 3.32. NFS example

NFS example

3.11. Extracting sets

After all sets are available at this step - either from a CD-ROM/DVD or in a directory where the set files were downloaded into, they will be extracted into the new NetBSD file system next.

After extracting all selected sets, sysinst will create device nodes in the /dev directory and then displays a message saying that everything went well.

Another message (see Figure 3.33, “Extraction of sets completed”) will let you know that the set extraction is now completed, and that you will have an opportunity to configure some essential things before finishing the NetBSD installation.

Figure 3.33. Extraction of sets completed

Extraction of sets completed

3.12. System configuration

The first thing you can adjust is the timezone in which the system resides. It is Universal Time Coordinated (UTC) by default, and you can use the two-level menu of continents/countries and cities shown in Figure 3.34, “Selecting the system's time zone” to determine your timezone. If you are satisfied with your choice, press the Return key to update the display of your local time. Press “x” followed by Return to exit timezone selection.

Figure 3.34. Selecting the system's time zone

Selecting the system's time zone

The next thing that is asked is which algorithm shall be used to encrypt the password file (Figure 3.35, “Selecting a password encryption scheme”). While “DES” is the standard algorithm used on most Unix systems, “MD5” and “Blowfish” allow longer passwords than DES, which only uses the first eight characters of the password that is entered. DES is still useful for interoperability with other operating systems.

Figure 3.35. Selecting a password encryption scheme

Selecting a password encryption scheme

After choosing the password cipher you are asked if you want to set the root password, see Figure 3.36, “Setting root password?”. NetBSD doesn't start any services when booting up after installation, yet it is still recommended to set a root password right here for security reasons.

Figure 3.36. Setting root password?

Setting root password?

When you agree to set a root password, sysinst will run the passwd(1) utility for you, and you should enter your new root password (twice). Please note that the password is not echoed, and if you enter a very simple password, the system will warn you about this. If you insist on entering the same simple password again, NetBSD will give in and let you have your will, providing you with all the rope you need to hang yourself.

Figure 3.37. Setting root password

Setting root password

The next item is to choose which command line interpreter - also known as “shell” in Unix - will be used for the root account. As printed in Figure 3.38, “Choosing a shell”, the default is the classic Bourne shell sh(1). Other choices are the Korn shell ksh(1) and the C shell csh(1). While BSD systems have traditionally shipped with csh as login shell for the system manager, modern systems tend to come with a Bourne shell (or variants thereof, like ksh or bash), and it may be useful to choose this if you have experience on such systems. Else, the default will be fine, and it can always be changed later.

Figure 3.38. Choosing a shell

Choosing a shell

3.13. Finishing the installation

At this point the installation is finished, see Figure 3.39, “Installation completed”.

Figure 3.39. Installation completed

Installation completed

After passing the dialog that confirms the installation, sysinst will return to the main menu. Remove any installation media (floppy, CD, disks) and choose “Reboot the computer” to boot your new NetBSD installation as shown in Figure 3.40, “Reboot to finish installation”.

Figure 3.40. Reboot to finish installation

Reboot to finish installation