Later Solaris Diskless Installation Guide

Overview

This article documents how to setup a diskless later Solaris (2.6 through 2.9) machine. It also documents several issues that will come up due to various reasons. These are noticed as the procedure encounters them.

The boot server uses NetBSD 9.2, which is current as of this writing (October 2021).

The server must have the following services available.

  1. TFTP

  2. bootparamd. If the boot server is multi-homed (multiple IP addresses), add the -r option to the bootparams options (e.g bootparamd -s ) so that the traffic is routed properly. This causes unusual errors in Solaris.

  3. NFS v2/v3

You can enable the following services so that the diskless client can interact more with the server. SunOS 4 predates SSH. These plain text protocols can be used on a trusted network.

  1. FTP

  2. telnet

  3. rlogin

  4. rsh

  5. rexec

Network Setup

Later versions of Solaris support classless routing (CIDR) starting in 2.6. This guide will use the dual network topology listed in the other SunOS and Solaris diskless procedures.

Wikipedia's entry on Classful Networking provides a table of which networks had which subnet masks. RFC1918 networks (10/8, 172.16/12, and 192.168/16) should use the following network masks.

In my case, I have a preexisting network of 192.168.1.1/16, which made the bootparam client have issues because it hard coded itself to a /24 network. The fix was to use the 172.16 network for my diskless clients and setup the NFS/TFTP/bootparamd server and other devices with a 172.16/16 address alias.

Server Setup

A full installation of Solaris is up to 2GB in size. The Sun recommended setup with shared read-only fileystems maximized available space through symbolic linking and common mount points.

The full client used here uses more disk space, but these sizes are negligible on modern hard drives.

The boot server puts the filesystem for each client under its own directory.

/home/client1

/home/client2

/etc/exports

echo '/home/client -alldirs -maproot=root' >> /etc/exports

/etc/bootparams

echo 'client root=server:/home/client  swap=server:/home/client/swap gateway=server:0xffff0000' >> /etc/bootparams

/etc/ethers

echo '*mac_address* *client*' >> /etc/ethers

/etc/inetd

uncomment out tftpd (optionally telnet,ftp, rsh,rlogin, exec, time, etc)

Client Setup

  1. Mount the Solaris ISO and copy the Solaris_*/Product package directory

    mount /dev/vnd0a /cdrom

    cd /cdrom/Solaris*

    find -name Product -print | cpio -dumpv /home/client

  2. Copy over the CD-ROM's miniroot to act as a base for client's root..

    cd /home/client/

    dd if=/dev/zero of=swap bs=32m count=1

    cd /cdrom/Solaris*/Tools/Boot

    find . -print | cpio -dumpv /home/client/

  3. Copy the files in etc and var to /home/client so that when the miniroot is booted, key files are available.

    cd /home/client/.tmp_proto/root

    find . -print | cpio -dumpv ../../

  4. Create the client's /etc/vfstab file.

    cd ../../

    rm etc/vfstab

    vi etc/vstab

    Contents of /etc/vfstab

    /proc - /proc proc - no -

    fd - /dev/fd fd - no -

    swap - /tmp tmpfs - yes -

    server:/home/client - / nfs - yes rw

    server:/home/client/swap - - swap - no -

  5. Update the etc/netmasks file.

    echo '172.16.1.0 255.255.0.0' >> etc/netmasks

  6. Create the hostname. file, which contains the ifconfig to bring up the interface. le0 is used below.

    echo '172.16.1.23 netmask 255.255.0.0 up' >> etc/hostname.le0

  7. Remove the nodename and defaultrouter file and create new ones.

    rm etc/nodename etc/defaultrouter

    echo '172.16.1.1' > etc/defaultrouter

    echo 'client' > etc/nodename

  8. Edit the etc/hosts file.

    cat << EOF >> ./etc/hosts

    172.16.1.1 server

    172.16.1.22 client

    EOF

  9. Copy the bootloader to /tftpboot. As before, this file is architecture-specific.

    cp usr/platform/sun4X/lib/fs/inetboot /tftpboot

  10. Calculate the hex number for the client's IP address using the bc command. The decimal is given in bold and the hex is in italics.

    obase=16

    172

    AC

    16

    10

    1

    1

    22

    16

    Press Control-D to quit out of bc.

  11. Using the hexnumbers, make a symlink or copy the boot.sun4 file to it.

    cd /tftpboot

    ln -s inetboot AC100116.SUN4M OR cp inetboot AC100116.SUN4M

  12. Boot the Solaris miniroot into single user mode.

    boot net kernel/unix -s

  13. Start the KornShell shell.

    ksh

  14. Set the terminal to be a VT100.

    TERM=vt100

    export TERM

  15. Enter the Solaris package directory

    cd Product*

  16. Create an admin file so that package installation will be silent.

    vi admin_file

    contents of admin_file

    mail=

    instance=unique

    partial=nocheck

    runlevel=nocheck

    idepend=nocheck

    rdepend=nocheck

    space=nocheck

    setuid=nocheck

    conflict=nocheck

    action=nocheck

    basedir=default

  17. Create a package list so that the packages are installed in the correct order. The .m is for the sun4m archtecture. Use .c for sun4c or .u for sun4u

    A=".m"

    while read pkg

    do

    if [ -d ${pkg}$A ];

    then

    pkg="${pkg}$A"

    fi

    echo "${pkg}" >> list

    done < .order

  18. Install the packages to /a.

    list=$(<list)

    pkgadd -na admin_file -R /a -d . $list

  19. Halt the machine.

    halt -q

  20. On the boot server, remove all but the a directory under /home/client. Re-create the swap partition.

    cd /home/client

    rm -rf [b-z]* .[a-z]* Solaris*

    dd if=/dev/zero of=swap bs=32m count=1

  21. Move the contents of /a to the /home/client directory.

    cd a

    mv * ../

    cd ../

    rm -rf a

  22. Edit the etc/hosts file.

    cat << EOF >> ./etc/hosts

    172.16.1.1 server

    172.16.1.22 client

    EOF

  23. Recreate the client's /etc/vfstab file.

    vi etc/vstab

    Contents of /etc/vfstab

    /proc - /proc proc - no -

    fd - /dev/fd fd - no -

    swap - /tmp tmpfs - yes -

    server:/home/client - / nfs - yes rw

    server:/home/client/swap - - swap - no -

  24. Boot the client machine to Solaris. The machine will then prompt for the user terminal and then configure the box.

    boot net kernel/unix