FreeBSD Handbook : Advanced Networking : Diskless Operation : Setup Instructions
Previous: Diskless Operation
Next: Using Shared / and /usr filesystems

16.3.1. Setup Instructions

  1. Find a machine that will be your server. This machine will require enough disk space to hold the FreeBSD 2.0 binaries and have bootp, tftp and NFS services available. Tested machines:
  2. Set up a bootp server to provide the client with IP, gateway, netmask.
    diskless:\
            :ht=ether:\
            :ha=0000c01f848a:\
            :sm=255.255.255.0:\
            :hn:\
            :ds=192.1.2.3:\
            :ip=192.1.2.4:\
            :gw=192.1.2.5:\
            :vm=rfc1048:
    
  3. Set up a TFTP server (on same machine as bootp server) to provide booting information to client. The name of this file is cfg.X.X.X.X (or /tftpboot/cfg.X.X.X.X, it will try both) where X.X.X.X is the IP address of the client. The contents of this file can be any valid netboot commands. Under 2.0, netboot has the following commands:
    help			- print help list
    ip <X.X.X.X>		- print/set client's IP address
    server <X.X.X.X>	- print/set bootp/tftp server address
    netmask <X.X.X.X>	- print/set netmask
    hostname <name>		- print/set hostname
    kernel <name>		- print/set kernel name
    rootfs <ip:/fs>		- print/set root filesystem
    swapfs <ip:/fs>		- print/set swap filesystem
    swapsize <size>		- set diskless swapsize in Kbytes
    diskboot		- boot from disk
    autoboot		- continue boot process
    trans <on|off>		- turn transceiver on|off
    flags [bcdhsv]		- set boot flags
    
    A typical completely diskless cfg file might contain:
    rootfs 192.1.2.3:/rootfs/myclient
    swapfs 192.1.2.3:/swapfs
    swapsize 20000
    hostname myclient.mydomain
    
    A cfg file for a machine with local swap might contain:
    rootfs 192.1.2.3:/rootfs/myclient
    hostname myclient.mydomain
    
  4. Ensure that your NFS server has exported the root (and swap if applicable) filesystems to your client, and that the client has root access to these filesystems A typical /etc/exports file on FreeBSD might look like:
    /rootfs/myclient -maproot=0:0 myclient.mydomain
    /swapfs -maproot=0:0 myclient.mydomain
    
    And on HP-UX:
    /rootfs/myclient -root=myclient.mydomain
    /swapfs -root=myclient.mydomain
    
  5. If you are swapping over NFS (completely diskless configuration) create a swap file for your client using dd. If your swapfs command has the arguments /swapfs and the size 20000 as in the example above, the swapfile for myclient will be called /swapfs/swap.X.X.X.X where X.X.X.X is the client's IP addr, eg:
    # dd if=/dev/zero of=/swapfs/swap.192.1.2.4 bs=1k count=20000
    
    Also, the client's swap space might contain sensitive information once swapping starts, so make sure to restrict read and write access to this file to prevent unauthorized access:
    # chmod 0600 /swapfs/swap.192.1.2.4
    
  6. Unpack the root filesystem in the directory the client will use for its root filesystem (/rootfs/myclient in the example above).
  7. Run netboot.com on the client or make an EPROM from the netboot.rom file


FreeBSD Handbook : Advanced Networking : Diskless Operation : Setup Instructions
Previous: Diskless Operation
Next: Using Shared / and /usr filesystems