setting up many FreeBSD boxes at once... advice?

listone at deathbeforedecaf.net listone at deathbeforedecaf.net
Sat Apr 26 07:25:31 PDT 2003


> I'm going to be setting up 6 identical FreeBSD boxes at the same time.
> (Workstation boxes inside our office.)
> 
> Each one with the exact same setup.  Same ports installed, etc.
> 
> Anyone whose done this before have any advice?

I can't help you with distributed ports, but I have done some work on
auto-installs.

The manpage for sysinstall(8) talks about a config file, which has the default
name install.cfg. With this, you can specify disk partitioning, labelling &
distribution. You can also add packages if they're on the install media.

Here's the one I use for my webserver:

  # disk format
  disk=ad0
  partition=exclusive
  diskPartitionEditor

  # disk slices
  ad0s1-1=ufs     262144      /           1       # 128M + soft updates
  ad0s1-2=swap    262144      none                # 128M
  ad0s1-3=ufs     262144      /var        1       # 128M + soft updates
  ad0s1-4=ufs     2097152     /usr        1       # 1G   + soft updates
  ad0s1-5=ufs     0           /home       1       # free + soft updates
  diskLabelEditor

  # install system
  distSetDeveloper
  mediaSetCDROM
  installCommit

  # install packages
  package=lynx-2.8.4.1c
  packageAdd
  package=sudo-1.6.6
  packageAdd

And the one for my workstation (dual booting with Win2k):

  # disk format
  disk=ad0
  partition=existing
  bootManager=none
  diskPartitionEditor

  # disk slices
  ad0s1-1=ufs     4194304     /           1       # 2G   + soft updates
  ad0s1-2=swap    2097152     none                # 1G
  ad0s1-3=ufs     4194304     /var        1       # 2G   + soft updates
  ad0s1-4=ufs     4194304     /usr        1       # 2G   + soft updates
  ad0s1-5=ufs     0           /home       1       # free + soft updates
  diskLabelEditor

  # install system
  distSetEverything
  mediaSetCDROM
  installCommit

  # install packages
  package=lynx-2.8.4.1c
  packageAdd
  package=sudo-1.6.6
  packageAdd

To use the config file, copy it onto a floppy. Then boot from the CD-ROM and
select Load Config File from the main install menu. If all is correct, you can
come back in half an hour to a freshly built system.

I use this to re-install my handful of FreeBSD boxes every time a new version
comes out.

With 6 floppies and 6 install CDs, you could even do it in parallel, although a
network install may make more sense in this case.

(To take the idea further, I have some scripts that run on the first boot to
setup the system files and download a custom kernel using fetch(1) - but they're
not particularly portable at the moment.)

Using the environment variables in the ports(7) manpage, you should be able to
use a local server for distfiles. This would be more robust than sharing the
/usr filesystem, but would still save your bandwidth.

Hope this helps.

Rob.


More information about the freebsd-questions mailing list