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.
TFTP
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.
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.
FTP
telnet
rlogin
rsh
rexec
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.
10/8 - 255.0.0.0 (/8)
172.16/12 - 255.255.0.0 (/16)
192.168/16 - 255.255.255.0 (/24)
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.
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)
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
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/
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 ../../
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 -
Update the etc/netmasks file.
echo '172.16.1.0 255.255.0.0' >> etc/netmasks
Create the hostname.
echo '172.16.1.23 netmask 255.255.0.0 up' >> etc/hostname.le0
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
Edit the etc/hosts file.
cat << EOF >> ./etc/hosts
172.16.1.1 server
172.16.1.22 client
EOF
Copy the bootloader to /tftpboot. As before, this file is architecture-specific.
cp usr/platform/sun4X/lib/fs/inetboot /tftpboot
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.
Using the hexnumbers, make a symlink or copy the boot.sun4
cd /tftpboot
ln -s inetboot AC100116.SUN4M OR cp inetboot AC100116.SUN4M
Boot the Solaris miniroot into single user mode.
boot net kernel/unix -s
Start the KornShell shell.
ksh
Set the terminal to be a VT100.
TERM=vt100
export TERM
Enter the Solaris package directory
cd Product*
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
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
Install the packages to /a.
list=$(<list)
pkgadd -na admin_file -R /a -d . $list
Halt the machine.
halt -q
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
Move the contents of /a to the /home/client directory.
cd a
mv * ../
cd ../
rm -rf a
Edit the etc/hosts file.
cat << EOF >> ./etc/hosts
172.16.1.1 server
172.16.1.22 client
EOF
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 -
Boot the client machine to Solaris. The machine will then prompt for the user terminal and then configure the box.
boot net kernel/unix