This article presents a method for quickly reproducing
filesystems, including user and system files. Once the
a single machine (the Master) has been properly configured,
of that load can be made and quickly distributed to
(Slaves) in a short time.
One method of boot-disk production is to place a Slave
the same SCSI bus as the Master, and perform a low-level
copy. This method is serial-based, and inherently slow
one Slave can be copied at a time and each in turn must
and uncabled. Another disadvantage is that the Master
for any other use while the copies are being made.
The parallel-based method presented here, in contrast,
is very fast
because it employs an easily reproducible, inexpensive
medium containing an exact copy of the Master boot-disk.
multiple copies of the production medium (1/4"
tape, CD, or similar
raw, or non-blocked, medium), one operator can load
at the same time. And because copying from the production
hard-disk has nearly the same throughput as a low-level
copy, the decrease in Slave production time is tremendous:
using five production media can load Slaves 500 percent
would be possible serially, with virtually no production
The copy procedure described here requires a system
with moderately high to advanced skills. It was written
on a DEC 5000/240
ULTRIX 4.2a (BSD) RISC-based workstation with SCSI peripherals
does use some peripheral names, device drivers, and
are DEC ULTRIX-specific. System administrators with
level of experience should have no difficulty porting
these to other
systems and architectures.
The procedure consists of three logical steps of pre-production
and one step for production. The steps are:
1. Fully configure the Master so it is ready to be
2. Create the production medium by sequentially transferring
four (or more) files to it: File 1: the mini-kernel,
(see the sidebar "Required Mini-Root Functions"),
boot the Slave into a shell where commands can be executed
3. Create multiple copies of the production medium.
4. Place the production medium in each Slave and
load its boot-disk, as follows:
b) From the mini-root shell, copy the load script (File
2) from the production medium into the mini-root filesystem
c) Execute the load script (File 2), which then automatically
the Slave boot-disk with each filesystem dump (Files
3 through "n").
When the load script is finished, the Slave will be
a clone of the
Master, and ready for service.
If this is not practical, then a number of tape drives
(equal to the
level of parallelism) must be procured and cabled to
each Slave during
production.Additional SCSI tape drive (optional).
You can procure the mini-root from the operating system
load script can be written from scratch or you can use
the one in
Implementing the Procedure
The subsections that follow present detailed instructions
1. Create the Master Software Configuration
Set up the Master with all system files, user files,
software. Keep the files unique to each Slave generic,
so that, using
operator input, the load script can automatically change
them to Slave-unique
files during production.
For example, our machines have hostnames defined in
the file /etc/rc.local,
which means that this file is different on each Slave.
In our case,
the Master generic file /etc/rc.local would contain
At production time, the load script will prompt the
for the hostname of the Slave currently being loaded.
The load script
will then copy the generic file /etc/rc.local from the
tape to the Slave boot-disk. If the operator enters
for the Slave name, the load script will then change
the generic file
into the Slave-unique file containing the command:
Each file on the Master that contains Slave-unique information
be made generic, and the load script should be written
to change that
file from generic to Slave-unique.
2. Place the Mini-Root on the Master Boot-Disk
Place the vendor distribution tape containing the mini-root
Master tape drive. Then, from the Master, copy the mini-root
the tape to the directory /tmp by executing the command:
dd if=/dev/rmt0h of=/tmp/miniroot ibs=1024 obs=8192 conv=sync
See the sidebar "Device Issues" for details
the use of the dd(1) command with tapes.
This procedure copies every file from the Master to
production tape, including the mini-root. Because the
not used during normal operation, placing it in the
ensures that it will be removed automatically on Slave
3. Place the Load Script on the Master Boot-Disk
The load script performs the following functions on
the Slave during
-- Partitions the boot-disk, using the chpt(8) command.
-- Writes the boot-blocks (usually supplied as part
mini-root) to the boot-disk, using the dd(1) command.
-- Creates two filesystems on the boot-disk, using the
-- Restores each filesystem dump from the production
the boot-disk, using the restore(8) command.
-- Performs Slave-specific editing of generic files
inputs and the sed(1) command.
-- Checks boot-disk filesystem integrity, using the
-- Shuts the mini-root down, using the sync(1) and
You can create a Bourne shell load script, to perform
or you can use the one shown in Listing 1. Keep in mind
that the commands
in the mini-root are very few and very primitive (see
"Required Mini-Root Functions"). The load
script can also
be written to interactively accept command arguments
from the operator
at production time.
In this particular example, the operator enters three
(Slave hostname, IP address, and swap partition size);
all the other
arguments are predetermined and hard-coded into the
When your load script is debugged, place it on the Master
in the file /tmp/loadscript.
4. Create the Production Tape from the Master
The mini-root, load script, and two filesystems dumps
sequentially to the production tape by executing the
from a Bourne shell on the Master:
arg="ibs=8192 obs=1024 conv=sync"
dd if=/tmp/miniroot of=$of $arg
dd if=/tmp/loadscript of=$of $arg
dump 0usdf 21600 16000 $of /
dump 0usdf 21600 16000 $of /usr
Note the tape device driver (of) in the above commands
no-rewind (i.e., nrmt0h as opposed to rmt0h), so that
files can be written sequentially. The mt(1) command
the tape is completely rewound and ready for writing.
command sequentially writes the files /tmp/miniroot
from the Master boot-disk to the production tape. The
commands sequentially write level 0 dumps of the Master
/ and /usr to the production tape. (See the sidebar
"Device Issues" for details on the use of
and dump(8) commands with tapes.)
This completes the creation of the production tape.
5. Create Multiple Copies of the Production Tape
Copies of the production tape can be made either by
1 through 4 above or by making tape-to-tape copies.
for tape-to-tape copies is straightforward:
a) Set up the Master with the additional tape drive.
b) Place the source tape in the default drive (e.g.,
c) Place the destination tape in the second drive
d) Copy the mini-root and load script from the source
tape to the destination tape by executing the following
a Bourne shell on the Master:
mt -f $d rewind
dd if=$s of=$d bs=1024
dd if=$s of=$d bs=1024
e) Copy the filesystem dumps from the source tape
to the destination tape by executing the following commands
Bourne shell on the Master:
dd if=$s of=$d bs=10240
dd if=$s of=$d bs=10240
Note the tape device drivers (in the variables s
and d) in the above commands are no-rewind. The filesystem
dumps must be written with a block size of 10240 bytes,
as this is
the size the dump(8) command uses to create the dump
and the size the restore(8) command uses when restoring
7. Create Slaves from the Production Tape
Once the production tapes have been made, creating Slaves
and easy. From each Slave, perform the following steps:
a) Place the Slave in console (maintenance) mode
(some machines can be placed in console mode with the
command shutdown -h now; others may require some other
command or cycling power).
b) Put the production tape into the Slave tape drive.
c) At the Slave console mode prompt, boot the mini-root
from the production tape by executing the following
(This is a DEC 5000/240 console command to boot the
mini-root from the tape drive at SCSI ID#5; consult
maintenance documentation for details about your system.)
d) Once in the mini-root Bourne shell, set your preferred
erase keystroke by entering the mini-root command:
stty erase '^?'
Note: some mini-roots may boot into a utility menu.
If this is the case, choose an option from that menu
that will place
you in a mini-root Bourne shell.
e) Make the special files for the tape and boot-disk
drives by entering the mini-root commands:
MAKEDEV tz5 rz0
f) Position the production tape at the load script
by entering the mini-root command:
mt fsf 1
Forward-spacing the production tape one file (i.e.,
skipping past the mini-root to the load script) is necessary
booting the mini-root usually rewinds the tape.
g) Copy the load script from the production tape
to the mini-root filesystem by entering the mini-root
dd if=/dev/nrmt0h of=/loadscript \
ibs=1024 obs=8192 conv=sync
Note the use of the no-rewind device.
h) Execute the load script by entering the mini-root
i) Answer any load script questions appropriately.
When the load script is finished executing, it will
shut the machine down, at which point you can boot it
This is the end of the procedure.
At HSSC, our system load for one boot-disk is about
354Mb on one 660Mb
disk. Our serial-based method of copying the Master
disk took about
30 minutes, so one operator could generate two Slaves
The parallel procedure presented here also takes about
to create one Slave. But with five copies of the production
one operator can load five machines in parallel in about
which is about ten machines per hour, with practically
About the Author
Packey Velleca graduated from Floria Institute of Technology
in Melbourne, FL with a BSEE in 1988 and is employed
by Harris Space
Systems Corp. He currently works with a group of administrators
a small system of real-time computers with UNIX-based
He can be reached via email at firstname.lastname@example.org.