A Linux guy looks at NetBSD

60

Author: JT Smith

By Russell Pavlicek

I have been a Linux user since 1995. It has been my desktop and server of
choice since about 1997. But there is more in the Open Source operating
system world than just Linux. So, I decided to play with the Wasabi
Systems’ distribution of NetBSD. The basic distribution comes on two CDs
with a small instruction booklet.

Overview

When perusing the CDs, I became aware of certain differences between the
NetBSD and Linux approaches to creating an operating system. First,
NetBSD is fiercely multi-platform. Linux has a remarkable number of ports
to its credit, but the lion’s share of activity has been on the i386 platform.
Most Linux CDs you encounter contain binaries for a only single platform.
If you want to install Linux on a different hardware architecture, you
will need to obtain a new set of CDs for that architecture. And, beyond
the top half dozen ports, you will likely need to burn those CDs yourself.

Not so for NetBSD. According to its documentation, NetBSD has been
ported to 32 architectures consisting of 12 distinct families
of CPUs. The basic Wasabi NetBSD 1.5.2 kit contains binaries
for installation on 20 machine architectures. So, with a
single kit, I successfully installed NetBSD on a Pentium, a VAX, and a
MIPS-based DEC system. This is definitely not a bad thing if you are
hoping to revive a number of retired machines of different architectures.

The natural question is, “How can two CDs hold distributions for
so many platforms?” The answer is found in the minimalist nature of
NetBSD. A default installation is neither large nor complex. In fact,
you can assemble a working system in most architectures in less than 250
MB of disk space.

The result of any installation from the two-CD set is lean and mean. It reminds me of using a Unix system from about 1985. This means you
will probably need to edit files using vi or ed, at least during set up.
If you choose to install the X Window System (if it is supported on your
hardware architecture, that is), you will use twm, the
Tiny Window Manager, until you download something more substantial. KDE
and GNOME are not present in the kit, but you can install them via the
network later. Your choice of shells includes sh, ksh, and csh.
If you want bash, you will have to add it after installation.

The leanness of the operating system can be disturbing to Linux folks.
I have become so used to large, flexible distributions with all the bells
and whistles that a desktop user might want, that the stark minimalism of
NetBSD seems out of place. It quickly becomes apparent that the default
NetBSD installation is not suitable for your grandmother. Nor does it try
to be.

However, the default NetBSD installation is quite useful for building
targeted systems or network appliances. It provides a solid base to which
you can add packages to create a lean, mean computing machine.

But how do you find and add these packages? Thankfully, NetBSD has a
network-aware packaging system that allows you to pull packages and all
their dependencies from any of several ftp sites listed on the netbsd.org
Web site. While not something you would want an end-user to do, the
installations are simple for a technically astute individual.

This raises another important issue: NetBSD, as it is currently packaged,
requires Unix expertise on the part of the administrator. Someone with no
experience in Unix-like systems can become quickly overwhelmed. If you
don’t feel capable of finding and editing configuration files with vi with
little guidance, you can expect to have a sharp learning curve ahead of
you.

Installation

When I first examined the instructions in the booklet and the files that come
with the Wasabi kit, I felt a sense of deja vu. It reminded me of the
instruction booklets I used to see with Linux distributions in the mid-1990s. There are reasonably detailed instructions for doing things such as creating boot floppies (where necessary). However, the installation instructions are far from a blow-by-blow description of what to do. They are adequate for most typical installations, but they come up short if the unexpected occurs.

The i386 PC port seems to have the most complete installation
documentation. Many of the other ports rely on a short document
that describes the unique aspects of that particular hardware platform
and refers to the i386 installation document as a reference. Despite the
potential shortcomings of such an approach, it proved to be adequate for
the installations I performed.

As I mentioned earlier, the Wasabi two-CD set supports 20 hardware
architectures. The ports supplied are as follows:

  • alpha (Compaq/Digital Alpha)
  • amiga (Commodore Amiga)
  • arc (MIPS boxes with ARC firmware)
  • arm32 (Acorn RiscPC and StrongARM)
  • atari (Atari TT/Falcon/Hades)
  • cobalt (MIPS-based Cobalt RaQ and Qube)
  • hp300 (HP 300/400 workstations)
  • hpcmips (MIPS handheld PCs)
  • i386 (Intel/AMD x86 PCs)
  • mac68k (680×0 Apple Macintosh)
  • macppc (PowerPC Apple Power Macintosh)
  • mvme68k (Motorola VME cards)
  • news68k (Sony 680×0 NeWS workstations)
  • next68k (NeXT cube and slab workstations)
  • pmax (MIPS DECstations and DECsystems)
  • sparc (Sun SPARC)
  • sparc64 (Sun UltraSPARC)
  • sun3 (680×0 Sun 3 series)
  • vax (DEC VAX)
  • x68k (X680x0 Sharp workstations)

Like most current Linux installations, there are a number of means to perform the install. The simplest method, of course, is to load
directly from the CD. However, if there is no CDROM drive attached to the
system, there are standard protocols available for installing
off a network. In the case of the ancient VAXstation I was testing, I
used NFS to load the software from the CD served up on a Linux PC.

Hint: Even if you are installing from a CD, go to the utility menu and
define the network information before you begin the installation itself.
This will save you a lot of file editing later on.

Most of the time, the installation was quite easy. The
installation routine is a relatively simple text-based program that
tries to be as friendly as it can be. It succeeds, unless you
need to work with the partition table. And, unfortunately, I found that
I always needed to adjust the partition table.

The installation gives you three partitioning options: a standard
installation, a standard installation with the X Window System, or a
custom installation. I found the standard
installation with the X Window System did not give me a useful set of
partitions. If you are building a system that will not
need much in /home, /tmp. or /var, then the standard partitions may be
okay. If you are looking to build a system which will require
significant space in any of those areas, you will need to
use a custom partition table.

Be aware that the installation program seems to have no idea how
much space is required for any one partition. It will happily allow you
to create partitions that cannot possibly hold the files required by the
installation. If a partition is too small, you will find out later when
the installation procedure starts cussing at you.

The initial dialogue for the custom partition table is actually quite
usable. A hint here is to get the table right the first time. If you do,
you will get to skip the partition table editor. And, frankly, that is a
step worth skipping.

The partition table editor is certainly better than the standard
Linux fdisk program, but that’s not saying too much. If you can use
fdisk, you will have little problem setting up the partitions. One
major change, though, is that partitioning has two distinct parts:
allocating the partition and editing the disklabel.

Under Linux (on an x86, anyway), you normally partition using the same
system that DOS employs. You have four main partitions and four additional
partitions that can be packed into one of the main partitions. So
creating a system with separate Linux / (root), /boot, /home, /usr, and
swap partitions, along with a Windows partition, will require seven partitions
(one of which is an extended partition containing some of the other
partitions).

Under NetBSD, you can allocate a partition which will contain the entire
BSD installation. It is important that you allocate enough space to
contain everything, including swap. You then edit the BSD disklabel to
divide up the one physical partition into a number of BSD-style
partitions.

Once you get past the partitioning, the rest of the installation is
smooth as butter on a mid-summer afternoon. When the packages are unpacked into their respective places, there are a few short questions, and
then you are ready to reboot and go.

Configuration

At this point, you can now log in and do things. However, unlike many
modern Linux distributions, you will probably need to perform several
manual tasks before you can be particularly productive.

For instance, if you installed directly from the CD and did not
define the network during the installation, you will need to manually
configure the network yourself. This can be accomplished by creating or
editing a number of files in the /etc directory.

After completing the system setup, the first thing I wanted to do was to
install the bash shell. Because I would be using the command line
extensively, I wanted a shell that made command line editing easy.

NetBSD contains a useful package installation command called pkg_add. It
allows you to load additional packages from files or from FTP sites. It
uses the normal tar command to unpack the files and utilizes some
metafiles to make sure that other necessary packages are installed.
Thankfully, pkg_add will automatically add any of the needed software
packages which may be required to run the target package.

The second package I installed was pico, the editor from the pine email
agent. If I was going to make a
series of simple edits, a quick and simple editor like pico would be useful. If vi
is your preferred editor, you won’t need this step.

Since there is no working X Window System for my VAX (a fact that was not
clearly expressed in any of the documents I examined), and my DECstation
has no video monitor, I had no need to install a GUI on either of these
boxes. However, my IBM Thinkpad laptop could benefit from a
usable GUI. So I decided to install KDE.

NetBSD has a KDE package file that basically directs pkg_add to
install a number of KDE-related packages. Unfortunately, it took me
several hours to fully load KDE over my cable modem, largely due to
connectivity issues. The first couple of FTP sites I chose for the
download could not perform adequately, causing the load to fail. After
trying a few mirror sites, I finally found an FTP site that performed
well enough to complete the installation. It was useful
to manually install some of the KDE-related packages on their own, so that
there was less opportunity for a network problem to mess up the entire
process.

Usability

Once installed, NetBSD can feel very much like Linux, if that is what you
want. Most apparent to me is the difference in device
names. For example, the first partition of the first IDE disk is called
/dev/hda0 in Linux, but /dev/wd0a in NetBSD. My PCMCIA network card would
be /dev/eth0 under Linux, but is /dev/ne2 under NetBSD.

The three different architectures I tested all produced similar looking
systems, from a user’s viewpoint. The biggest issue was in the support
(or lack thereof) of the X Window System on various hardware. The
variety of hardware also yields a variety of device names, reflecting the
types of interfaces used.

When I was having a few issues trying to install NetBSD on my VAXstation
(it turned out that support for the MFM disk on the VS2000 was not
compiled in the installation kernel), I found the mailing
list for the NetBSD VAX port useful. Likewise, I found answers
to many questions in the mailing list archives of the i386 and DECstation
ports. It’s obvious that the mailing lists and their archives have a great
wealth of information available for people exploring NetBSD.

Conclusion

Though the NetBSD installation and configuration process is not
meant to be as easy as most current Linux distributions,
it is still manageable by someone with some Unix sysadmin
skills. NetBSD has its own charm, especially in its
multi-platform aspects and its compactness. It provides a useful base for
creating network appliances out of a great number of machines, including
some of those which you may have intended to shove off your loading dock
in the near future.

Category:

  • Unix