Previous | Next | Table of Contents

Finishing up your installation, Diskless NetBSD HOW-TO

This last section covers how to ensure that all of the daemons you set up will automatically run each time your server(s) are booted.

Also, you might consider compiling a new kernel for your client. If you use the DISKLESS config file, it will produce a smaller kernel (without SCSI, HP-IB, NFS server, and a few other things), which will load more quickly, and will use less RAM. This is detailed in the How to build a kernel NetBSD Kernel FAQ item.

Another suggestion is to gzip the kernel on the nfs server, as this will load over the network faster (even with a slow client). The client will boot from this, even though it isn't named netbsd, it merely has to figure out that netbsd doesn't exist on the nfs server and try the next kernel name, which happens to be netbsd.gz. The NetBSD bootloader will attempt to load each of the following files in sequence until it loads one successfully and then executes it:

	netbsd
	netbsd.gz
	netbsd.bak
	netbsd.bak.gz
	netbsd.old
	netbsd.old.gz
	onetbsd
	onetbsd.gz

Finishing up, NetBSD
Finishing up, OpenBSD
Finishing up, FreeBSD
Finishing up, MacOS X and Darwin
Finishing up, Linux
Finishing up, SunOS
Finishing up, Solaris
Finishing up, NEWS-OS
Finishing up, NEXTSTEP
Finishing up, HP-UX 9
Finishing up, HP-UX 10


NetBSD

In NetBSD, all of the rc setup parameters are stored in /etc/defaults/rc.conf. Do not modify this file. Instead, copy the relevant lines to /etc/rc.conf and change the values there.

  1. Setting up the client-specific daemon:

    • To set up rbootd for hp300, edit /etc/rc.conf and make sure that the following line is set:
      rbootd=YES              rbootd_flags=""

    • To set up mopd for vax, edit /etc/rc.conf and make sure that the following line is set:
      mopd=YES              mopd_flags="-a"
  2. Setting up rarpd and bootparamd:
    Edit /etc/rc.conf and make sure the following lines are set:
    rarpd=YES               rarpd_flags="-a"
    bootparamd=YES          bootparamd_flags=""

  3. Setting up dhcpd:
    Edit /etc/rc.conf and make sure the following line is set:
    dhcpd=YES               dhcpd_flags="-q"

  4. Setting up nfs:
    Edit /etc/rc.conf and make sure the following line is set:
    nfs_server=YES                             # enable server daemons
                            mountd_flags=""
                            nfsd_flags="-6tun 4"

Congratulations, you're done!


OpenBSD

For OpenBSD 2.3 and later (earlier versions needed to edit the /etc/netstart file):

  1. Setting up the client-specific daemon:

    • To set up rbootd for hp300, edit /etc/rc.conf and make sure that the following line is set:
      rbootd=""

    • To set up mopd for vax, edit /etc/rc.conf and make sure that the following line is set:
      mopd_flags="-a"
  2. Setting up rarpd and bootparamd:
    Edit /etc/rc.conf and make sure the following lines are set:
    rarpd="-a"
    bootparamd=""

  3. Setting up dhcpd:
    Edit /etc/rc.conf and make sure the following line is set:
    dhcpd_flags="-q"

  4. Setting up nfs:
    Edit /etc/rc.conf and make sure the following line is set:
    nfs_server=YES

Congratulations, you're done!


FreeBSD

In recent versions of FreeBSD, all of the rc setup parameters are stored in /etc/defaults/rc.conf. Do not modify this file. Instead, copy the relevant lines to /etc/rc.conf and change the values there.

  1. Setting up the client-specific daemon:

    • To set up rbootd for hp300, edit /etc/rc.local and add the following lines:
      echo -n ' rbootd'
      /usr[/local]/libexec/rbootd
      echo -n ' bootparamd'
      /usr/sbin/bootparamd

    • To set up mopd for vax, edit /etc/rc.local and add the following lines:
      echo -n ' mopd'
      /usr/local/sbin/rbootd
      echo -n ' bootparamd'
      /usr/sbin/bootparamd
  2. Setting up rarpd:
    Edit /etc/rc.conf (or /etc/sysconfig for earlier versions) and make sure the following lines are set:
    rarpd_enable="YES"
    rarpd_flags="-a -s"

  3. Setting up dhcpd:
    There is probably a line in /etc/rc.conf which will start dhcpd.

  4. Setting up nfs:
    Some versions of the FreeBSD nfs server are unable to deal with the 8 KB block size that NetBSD likes to use (see http://www.freebsd.org/doc/handbook/network-nfs.html). If you find that you're getting terrible performance (on the order of 2 KB/sec) and/or are having serious problems, then you may need to do the following:

    1. Put the following at the top of the client's /etc/rc:
      mount -t nfs -a -o -I=1024,-r=1024,-w=1024 nfsserver:/export/client/root/ /

    2. Build a new kernel for the client that uses smaller blocksizes, in particular, you'll need the following line in your config file:
      options NFS_BOOT_RWSIZE=1024

    3. Then follow the directions in the How to build a kernel NetBSD Kernel FAQ item.

    Also, some versions of FreeBSD have problems with NFS3. If you encountered this when trying out nfs, then be sure to include the -r2 flag when starting mountd.

    Edit /etc/rc.conf (or /etc/sysconfig for earlier versions) and make sure the following lines are set:

    nfs_server_enable="YES"
    mountd_flags="-[2]r"

  5. Setting up detailed logging (optional):
    You may consider adding the following lines to /etc/syslog.conf, as they will add entries to /var/log/bootlog whenever your client tries booting:
    !rbootd
    *.*                                             /var/log/bootlog
    !rarpd  
    *.*                                             /var/log/bootlog

Congratulations, you're done!


MacOS X and Darwin

In MacOS X and Darwin, the system startup scripts are stored in /System/Library/StartupItems/. You'll want to create a bundle like these to start the netboot services in the user startup scripts /Library/StartupItems. NFS services are always started if there is a NetInfo directory called /exports.

The /etc/hostconfig describes which built-in services are automatically started. To prevent the native bootpd from starting (since it doesn't work and conflicts with dhcpd), make sure that the following lines are set:

CONFIGSERVER=-NO-
NETBOOTSERVER=-NO-

The SystemStarter HOWTO is a good reference if you want to learn more about creating your own startup bundles.

  1. # mkdir -p /Library/StartupItems/NetBSDNetBoot

  2. Create /Library/StartupItems/NetBSDNetBoot/StartupParameters.plist with the following contents:
    {
      Description     = "NetBoot services for NetBSD clients";
      Provides        = ("DHCPD",
                         "bootparams",
                         "rbootd");
      Requires        = ("NetInfo",
                         "Network");
      OrderPreference = "None";
      Messages =
      {
        start = "Starting NetBSD NetBoot services";
        stop  = "Stopping NetBSD NetBoot services";
      };
    }

  3. Create /Library/StartupItems/NetBSDNetBoot/NetBSDNetBoot with the following contents:
    #!/bin/sh
    
    . /etc/rc.common
    
    ##
    # Start up NetBSD NetBoot services
    ##
    
    ConsoleMessage "Starting NetBSD NetBoot Services"
    
    ##
    # Start NetBSD NetBoot services
    ##
    /usr/libexec/rbootd
    bootparamd
    dhcpd -q

  4. # chown -R root /Library/StartupItems/NetBSDNetBoot
    # chmod a+rx /Library/StartupItems/NetBSDNetBoot/NetBSDNetBoot

Congratulations, you're done!


Linux

Some Linux nfs servers are unable to deal with the 8 KB block size that NetBSD likes to use. If you find that you're getting terrible performace (on the order of 2 KB/sec) and/or are having serious problems, then you may need to do the following:

  1. Put the following at the top of the client's /etc/rc:
    mount -t nfs -a -o -I=1024,-r=1024,-w=1024 nfsserver:/export/client/root/ /

  2. Build a new kernel for the client that uses smaller blocksizes, in particular, you'll need the following line in your config file:
    options NFS_BOOT_RWSIZE=1024

  3. Then follow the directions in the How to build a kernel NetBSD Kernel FAQ item.

Also, some flavors of linux have problems with NFS3. If you encountered this when trying out nfs, then be sure to include the --no-nfs-version 3 flag when starting rpc.mountd.

Each flavor of linux deals with starting the daemons in a different way. Pick your distribution from the list below and follow those directions.


Finishing up, Slackware Linux

  1. Setting up the client-specific daemon:

    • To set up rbootd for hp300, add the following lines to your /etc/rc.d/rc.local file
      #Start the daemons to netboot a NetBSD client
      echo -n 'Starting diskless server daemons:'
      if [ -f /usr/local/bin/rbootd ]; then
          echo -n ' rbootd'; /usr/local/bin/rbootd > /dev/null
      fi

    • To set up mopd for vax, add the following lines to your /etc/rc.d/rc.local file
      #Start the daemons to netboot a NetBSD client
      echo -n 'Starting diskless server daemons:'
      if [ -f /usr/local/sbin/mopd ]; then
          echo -n ' mopd'; /usr/local/sbin/mopd > /dev/null
      fi
  2. Setting up rarp and bootparamd:
    Add the following lines to /etc/rc.d/rc.local after your client-specific daemon
    echo -n ' arp'
    /sbin/arp -s client CC:CC:CC:CC:CC:CC
    /sbin/rarp -s client CC:CC:CC:CC:CC:CC
    if [ -f /usr/[local]/sbin/rpc.bootparamd ]; then
        echo -n ' rpc.bootparamd'; /usr/[local]/sbin/rpc.bootparamd > /dev/null
    fi
    echo '.'

  3. Setting up dhcpd:
    This depends on whether dhcpd ships with your distribution. If it does, then there's probably some startup script you can use. Otherwise, add the following lines to /etc/rc.d/rc.local
    echo -n ' dhcpd'
    if [ -f /usr/[local]/sbin/dhcpd ]; then
        /usr/[local]/sbin/dhcpd -q
    fi
    echo '.'

  4. Setting up nfs
    Make sure that the following lines in /etc/rc.d/rc.inet2 are not commented (#) out:
    if [ -f ${NET}/rpc.portmap ]; then
      # Start the NFS server daemons.
      if [ -f ${NET}/rpc.mountd ]; then
        echo -n " mountd"
        ${NET}/rpc.mountd
      fi
      if [ -f ${NET}/rpc.nfsd ]; then
        echo -n " nfsd"
        ${NET}/rpc.nfsd
      fi
    fi # Done starting various SUN RPC servers.

Congratulations, you're done!


Finishing up, Red Hat Linux

The VAX Network Booting HOWTO discusses how to set up SysV style scripts for Red Hat linux.

If you don't want to bother with that, you can just add the daemons to your /etc/rc.d/rc.local.

  1. Setting up the client-specific daemon:

    • To set up rbootd for hp300, add the following lines to your /etc/rc.d/rc.local file
      #Start the daemons to netboot a NetBSD client
      echo -n 'Starting diskless server daemons:'
      if [ -f /usr/local/bin/rbootd ]; then
          echo -n ' rbootd'; /usr/local/bin/rbootd > /dev/null
      fi

    • To set up mopd for vax, add the following lines to your /etc/rc.d/rc.local file
      #Start the daemons to netboot a NetBSD client
      echo -n 'Starting diskless server daemons:'
      if [ -f /usr/local/sbin/mopd ]; then
          echo -n ' mopd'; /usr/local/sbin/mopd > /dev/null
      fi
  2. Setting up rarp and bootparamd:
    Add the following lines to /etc/rc.d/rc.local after your client-specific daemon
    echo -n ' arp'
    /sbin/arp -s client CC:CC:CC:CC:CC:CC
    /sbin/rarp -s client CC:CC:CC:CC:CC:CC
    if [ -f /usr/[local]/sbin/rpc.bootparamd ]; then
        echo -n ' rpc.bootparamd'; /usr/[local]/sbin/rpc.bootparamd > /dev/null
    fi
    echo '.'

  3. Setting up dhcpd:
    This depends on whether dhcpd ships with your distribution. If it does, then there's probably some startup script you can use. Otherwise, add the following lines to /etc/rc.d/rc.local
    echo -n ' dhcpd'
    if [ -f /usr/[local]/sbin/dhcpd ]; then
        /usr/[local]/sbin/dhcpd -q
    fi
    echo '.'

  4. Setting up nfs:
    Actually, NFS is supposed to be enabled by default on Red Hat systems. If you encountered NFS3 errors, then change the line in /etc/rc.d/init.d/nfs to read:
    daemon rpc.mountd --no-nfs-version 3

Congratulations, you're done!


Finishing up, Debian Linux

The VAX Network Booting HOWTO discusses how to set up SysV style scripts for Red Hat Linux. The only notable difference is that Red Hat uses /etc/rc.d/init.d/ and Debian uses /etc/init.d/.

Note that the Debian rbootd package will have already installed a SysV init script for rbootd and bootparam if you installed this.

If you don't want to bother with that, you can just add the daemons to your /etc/rc.local.

  1. Setting up the client-specific daemon:

    • If you did not install the Debian rbootd package, then you need to set up rbootd for hp300, add the following lines to your /etc/rc.local file
      #Start the daemons to netboot a NetBSD client
      echo -n 'Starting diskless server daemons:'
      if [ -f /usr/local/bin/rbootd ]; then
          echo -n ' rbootd'; /usr/local/bin/rbootd > /dev/null
      fi

    • To set up mopd for vax, add the following lines to your /etc/rc.local file
      #Start the daemons to netboot a NetBSD client
      echo -n 'Starting diskless server daemons:'
      if [ -f /usr/local/sbin/mopd ]; then
          echo -n ' mopd'; /usr/local/sbin/mopd > /dev/null
      fi
  2. Setting up rarp and bootparam:
    Add the following lines to /etc/init.d/network
    /sbin/arp -s client CC:CC:CC:CC:CC:CC
    /sbin/rarp -s client CC:CC:CC:CC:CC:CC
    if [ -f /usr/[local]/sbin/rpc.bootparamd ]; then
        /usr/[local]/sbin/rpc.bootparamd > /dev/null
    fi
    echo '.'

  3. Setting up dhcpd:
    This depends on whether dhcpd ships with your distribution. If it does, then there's probably some startup script you can use. Otherwise, add the following lines to /etc/rc.d/rc.local
    echo -n ' dhcpd'
    if [ -f /usr/[local]/sbin/dhcpd ]; then
        /usr/[local]/sbin/dhcpd -q
    fi
    echo '.'

  4. Setting up nfs:
    Make sure the important lines in /etc/init.d/netstd_nfs are not commented (#) out. There are six lines that contain nfsd and mountd that you need to make sure are uncommented.

Congratulations, you're done!


SunOS

  1. Setting up the client-specific daemon:

    • To set up rbootd for hp300, add the following lines to your /etc/rc.d/rc.local file
      #Start the daemons to netboot a NetBSD client
      echo -n 'Starting diskless server daemon:'
      if [ -f /usr/local/sbin/sun-rbootd ]; then
          echo ' rbootd.'; /usr/local/sbin/sun-rbootd -a > /dev/null
      fi
  2. Setting up rarpd and bootparamd:
    # mkdir -p /tftpboot

  3. Setting up dhcpd:
    Add the following lines to your /etc/rc.d/rc.local file
    #Start the daemons to netboot a NetBSD client
    echo -n 'Starting diskless server daemon:'
    if [ -f /usr/local/sbin/dhcpd ]; then
        echo ' dhcpd.'; /usr/local/sbin/dhcpd -q
    fi

  4. Setting up nfs:
    # touch /etc/exports

Congratulations, you're done!


Solaris

  1. Setting up the client-specific daemon:

    • To set up rbootd for hp300, create a SysV-style init script that runs:
      /usr/local/sbin/sun-rbootd -a
  2. Setting up rarpd and bootparamd:
    # mkdir -p /tftpboot

  3. To set up the ISC dhcpd, create a SysV-style init script that runs:
    /usr/local/sbin/dhcpd -q

  4. Setting up nfs:
    Make sure that /etc/rc3.d/S15nfs.server exists (this is default)
    Make sure your share commands in /etc/dfs/dfstab are of the form:
    share -F nfs ...

  5. To test out what will happen at boot time (optional), run:
    # /etc/init.d/nfs.server stop; /etc/init.d/nfs.server start
    This should start rarpd, bootparam, and nfs.

    If you later decide to remove these services, don't forget to:
    # rm -rf /tftpboot
    Remove the share lines in /etc/dfs/dfstab

Congratulations, you're done!


NEWS-OS

  1. Setting up the client-specific daemon:

    • To set up rbootd for hp300, add the following lines to your /etc/rc.net file
      #Start the daemons to netboot a NetBSD client
      echo -n 'Starting diskless server daemon:'
      if [ -f /usr/local/bin/rbootd ]; then
          echo ' rbootd.'; /usr/local/sbin/sun-rbootd -a > /dev/null
      fi
  2. Setting up rarpd and bootparamd:
    Edit /etc/rc.net and make sure that the following lines are uncommented:
    if [ -f /usr/etc/rpc.bootparamd ]; then   
           /usr/etc/rpc.bootparamd & (echo -n ' bootparamd' >/dev/console)
    fi
    if [ -f /etc/rarpd ]; then
           /etc/rarpd;               (echo -n ' rarpd'      >/dev/console)
    fi
    

  3. Setting up nfs:
    Edit /etc/rc.custom and make sure that:
    NET=on

Congratulations, you're done!


NEXTSTEP

  1. Setting up rarpd, bootparamd, and bootpd:
    Edit /etc/hostconfig and make sure that the NETMASTER line reads:
    NETMASTER=-YES-
    

  2. Setting up nfs:
    NFS is automatically set up from the steps described on the nfs page.

Congratulations, you're done!


HP-UX 9 and earlier

  1. Setting up the client-specific daemon:

    • To set up rbootd for hp300, you don't need to do anything. When SAM sets your machine up to be a cluster server, it configures everything so that /etc/rc will start rbootd.

    • To set up sun-rbootd, edit /etc/rc and make sure the following four lines are commented out (with a #):
      #            if /usr/bin/rtprio 64 /etc/rbootd $RBOOTD_DEVICES; then
      #                echo "remote boot daemon started"
        [...]
      #                if /usr/bin/rtprio 64 /etc/rbootd; then
      #                    echo "remote boot daemon started"
      Now edit one of the startup files (preferably /etc/netlinkrc) and add the following lines:
      #Start the daemons to netboot a NetBSD client
      echo -n 'Starting diskless server daemon:'
      if [ -f /usr/local/sbin/sun-rbootd ]; then
          echo ' rbootd.'; /usr/local/sbin/sun-rbootd -a > /dev/null
      fi
  2. Setting up rarpd and bootparamd:
    HP-UX 9 and earlier do not have rarpd or bootparamd

  3. Setting up dhcpd:
    Edit one of the startup files (preferably /etc/netlinkrc) and add the following lines:
    #Start the daemons to netboot a NetBSD client
    echo -n 'Starting diskless server daemon:'
    if [ -f /usr/local/sbin/dhcpd ]; then
        echo ' dhcpd.'; /usr/local/sbin/dhcpd -q
    fi

  4. Setting up nfs:
    Edit /etc/netnfsrc and make sure that:
    NFS_SERVER=1
    START_MOUNTD=1

Congratulations, you're done!


HP-UX 10

  1. Setting up the client-specific daemon:

    • To set up the HP-UX rbootd for hp300, edit your /etc/rc.config.d/netdaemons and make sure that
      START_RBOOTD=1

    • To set up the sun-rbootd for hp300, create a SYSV init script and make sure it is enabled (i.e. linked into /sbin/rc2.d). Also, edit /etc/rc.config.d/netdaemons and make sure that
      START_RBOOTD=0
  2. Setting up rarpd and bootparamd:
    HP-UX 10 does not support bootparamd
    Edit /etc/rc.config.d/netconf and make sure that:
    RARPD=1

  3. To set up dhcpd, create a SYSV init script and make sure it is enabled (i.e. linked into /sbin/rc2.d).

  4. Setting up nfs:
    Edit /etc/rc.config.d/nfsconf and make sure that:
    NFS_SERVER=1
    START_MOUNTD=1

Congratulations, you're done!


Previous | Next | Table of Contents
NetBSD Home Page
NetBSD Documentation top level

(Contact us) $NetBSD: finish.html,v 1.29 2006/02/25 17:18:49 kano Exp $
Copyright © 1998-2004 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.