xref: /original-bsd/share/doc/smm/01.setup/2.t (revision 2c7ae287)
Copyright (c) 1980 Regents of the University of California.
All rights reserved. The Berkeley software License Agreement
specifies the terms and conditions for redistribution.

@(#)2.t 6.1 (Berkeley) 5/14/86

.bp .nr H1 2 .nr H2 0 .bp

2. BOOTSTRAP PROCEDURE .R

This section explains the bootstrap procedure that can be used to get the kernel supplied with this distribution running on your machine. If you are not currently running 4.2BSD you will have to do a full bootstrap. Chapter 3 describes how to upgrade an existing 4.2BSD system. An understanding of the operations used in a full bootstrap is very helpful in performing an upgrade as well. In either case, it is highly desirable to read and understand the remainder of this document before proceeding. Booting from tape

The tape bootstrap procedure used to create a working system involves the following major steps:

1)
Format a disk pack with the vdformat program.
2)
Copy a ``mini root'' file system from the tape onto the swap area of the disk.
3)
Boot the UNIX system on the ``mini root''.
4)
Restore the full root file system using restore\|(8).
5)
Reboot the completed root file system.
6)
Label the disks with the disklabel\|(8) program.
7)
Build and restore the /usr file system from tape with tar\|(1).
8)
Extract the system and utility files and contributed software as desired.

The following sections describe the above steps in detail. In these sections references to disk drives are of the form xx\|(n,m) and references to files on tape drives are of the form yy\|(n,m) where xx and yy are names described in section 1.4 and n and m are the unit and offset numbers described in section 1.4. Commands you are expected to type are shown in Roman, while that information printed by the system is shown emboldened.

If you encounter problems while following the instructions in this part of the document, refer to Appendix B for help in troubleshooting. Step 1: formatting the disk

All disks used with \*(4B should be formatted to insure the proper handling of physically corrupted disk sectors. The vdformat program included in the distribution, or a vendor supplied formatting program, may be used to format disks if this has not already been done. The vdformat program is capable of formatting any of the disk drives listed in \(sc1.1.

To load the vdformat program, perform the following steps.

(machine powered up)
MIB POC
Type '#' to cancel boot
# (cancel automatic reboot)
CP [a10.h0]#>\|h (halt the cpu)
#>\|y (initialize the machine)
#>\|fd cyp(0,0) (make cypher default device)
#>\|p23 3. 00000000 (set boot flags)
#>\|fb (boot machine)
cyp(0,0)/etc/fstab
CP cold boot
4 way interleave set
CPU memory test
ECC CPU memory test
cyp(0,0)/.
CPU POC1
cyp(0,0)/poc1
CPU POC2
cyp(0,0)/poc2
FPP POC (only if floating point processor present)
cyp(0,0)/fppoc
FPP WCS (only if floating point processor present)
cyp(0,0)/fppwcs
BOOT SYSTEM cyp(0,0)/boot
Boot
:cy(0,0)stand/vdformat (load and run from first tape file)

The vdformat program should now be running and awaiting your input: :cy(0,0)stand/vdformat 50176+14336+776780 start 0x1000 VDFORMAT Version 3.0 controller 0: smd controller 1: smd-e Type `Help' for help, `Start' to execute operations. vdformat> If you made a mistake loading the program off the tape you should get either the ``:'' prompt again from the boot program or the ``#>'' prompt from the console processor. In either case you can retype the appropriate command to try again. If something else happened, you may have a bad distribution tape, or your hardware may be broken; refer to Appendix B for help in troubleshooting.

Vdformat will create sector headers and verify the integrity of each sector formatted. The program starts up by identifying the disk controllers installed in the machine. Old VDDC controllers which support only SMD drives are indicated as ``smd'' while newer controllers capable of supporting both SMD and extended-SMD drives are tagged as ``smd-e''. Remember vdformat works only with the drives listed above. Vdformat will prompt for the information required as shown below. If you err in answering questions, ``Delete'' erases the last character typed, and ``^U'' erases the current input line. At any point you can ask for assistance by typing ``help''; vdformat will list the possible answers to the current question. vdformat>\|format Format on which controllers?\|1 Drives on controller 1?\|0 Number of patterns to use while verifying?\|1 Drive type for controller 1, drive 0?\|egl Module serial number for controller 1, drive 0?\|1 vdformat>\|list The following operations will occur when Start is issued: Format: Controller 1, drive 0, type EGL. vdformat>\|start Starting format on controller 1, drive 0, type EGL. (bad sectors will be indicated) vdformat> Once the root device has been formatted, vdformat will prompt for another command. Return to the bootstrap by typing vdformat>\|exit or halt the machine by typing ``~h''. vdformat> ~h #>\|

It may be necessary to format other drives before constructing file systems on them; this can be done at a later time with the steps just performed, or vdformat may be brought in off a disk drive as described in \(sc6.1. Step 2: copying the mini-root file system

The second step is to run a simple program, copy, which copies a small root file system into the second partition of the disk. This file system will serve as the base for creating the actual root file system to be restored. The version of the operating system maintained on the ``mini-root'' file system understands that it should not swap on top of itself, thereby allowing double use of the disk partition. Disk 0 is normally used for this operation when doing an initial boot. Another disk may be substituted if necessary, although several modifications to the procedure may be needed to create special files for the alternate disk. The actual disk number should be substituted for the x below. Copy is loaded just as the vdformat program was loaded; if you don't have the bootstrap running, repeat the above instructions until you see the prompt from Boot (a colon), and then:

(copy mini root file system)
:\|cy(0,0)copy (load and run copy program)
From: cy(0,1) (unit 0, second tape file)
To: dk(x,1) (mini root is on drive x; second partition)
Copy completed: 205 records copied
Boot
:
(As above, `delete' erases characters and `^U' erases lines.) Step 3: booting from the mini-root file system

You now have the minimal set of tools necessary to create a root file system and restore the file system contents from tape. To access this file system load the bootstrap program and boot the version of unix that has been placed in the ``mini-root.'' As before, load the bootstrap if you do not already have it running. At the colon prompt:

: dk(x,1)vmunix (bring in vmunix off mini root)
The standalone boot program should then read the system from the mini root file system you just created, and the system should boot: 271944+78848+92812 start 0x12e8 4.3 BSD UNIX #1: Wed Apr 9 23:33:59 PST 1985 sam@okeeffe.berkeley.edu:/usr/src/sys/GENERIC real mem = xxx avail mem = yyy ... information about available devices ... root device? .R

The first three numbers are printed out by the bootstrap programs and are the sizes of different parts of the system (text, initialized and uninitialized data). The system also allocates several system data structures after it starts running. The sizes of these structures are based on the amount of available memory and the maximum count of active users expected, as declared in a system configuration description. This will be discussed later.

UNIX itself then runs for the first time and begins by printing out a banner identifying the release and version of the system that is in use and the date that it was compiled.

Next the mem messages give the amount of real (physical) memory and the memory available to user programs in bytes. For example, if your machine has only 512K bytes of memory, then xxx will be 520192, 4096 bytes less than 512K. The system reserves the last 4096 bytes of memory for use in error logging and doesn't count it as part of real memory.

The messages that come out next show what devices were found on the current processor. These messages are described in autoconf\|(4). The distributed system may not have found all the communications devices you have (vioc's), or all the mass storage peripherals you have, especially if you have more than two of anything. You will correct this soon, when you create a description of your machine from which to configure UNIX. The messages printed at boot here contain much of the information that will be used in creating the configuration. In a correctly configured system most of the information present in the configuration description is printed out at boot time as the system verifies that each device is present.

The \*(lqroot device?\*(rq prompt was printed by the system and is now asking you for the name of the root file system to use. This happens because the distribution system is a generic system, i.e. it can be bootstrapped on a Tahoe cpu with its root device and paging area on any available disk drive. You should respond to the root device question with xx0*. This response supplies two pieces of information: first, xx0 shows that the disk it is running on is drive 0 of type xx, secondly the \*(lq*\*(rq shows that the system is running \*(lqatop\*(rq the paging area. The latter is most important, otherwise the system will attempt to page on top of itself and chaos will ensue. You will later build a system tailored to your configuration that will not ask this question when it is bootstrapped. root device? xx0* WARNING: preposterous time in file system -- CHECK AND RESET THE DATE! erase ^?, kill ^U, intr ^C #

The \*(lqerase ...\*(rq message is part of the /.profile that was executed by the root shell when it started. This message is present to inform you as to what values the character erase, line erase, and interrupt characters have been set. Step 4: restoring the root file system

UNIX is now running, and the `UNIX Programmer's manual' applies. The `#' is the prompt from the shell, and lets you know that you are the super-user, whose login name is \*(lqroot\*(rq. To complete installation of the bootstrap system one step remains: the root file system must be created.

If the root file system is to reside on a disk other than unit 0 (as the information printed out during autoconfiguration shows), you will have to create the necessary special files in /dev and use the appropriate value. For example, if the root should be placed on dk1, you must create /dev/rdk1a and /dev/dk1a using mknod(8) or the MAKEDEV script in /dev.

To create the root file system the shell script \*(lqxtr\*(rq should be run: #\|disk=dkx tape=cy xtr This will generate many messages regarding the construction of the file system and the restoration of the tape contents, but should eventually stop with the messages: ... Root filesystem extracted # Step 5: rebooting the completed root file system

With the above work completed, all that is left is to reboot: #\|sync (synchronize file system state) #\|~h (halt cpu) #>\|y (initialize machine) #>\|p23 2 (set boot flags) #>\|fr boot ...(boot program is eventually loaded)... Boot : dk(x,0)vmunix (vmunix brought in off root) 271944+78848+92812 start 0x12e8 4.3 BSD UNIX #1: Wed Apr 9 23:33:59 PST 1985 karels@okeeffe.berkeley.edu:/usr/src/sys/GENERIC real mem = xxx avail mem = yyy ... information about available devices ... root on xx0 WARNING: preposterous time in file system -- CHECK AND RESET THE DATE! erase ^?, kill ^U, intr ^C #

If the root device selected by the kernel is not correct, it is necessary to reboot again using the option to ask for the root device. On the Tahoe use ``p23 3''. At the prompt from the bootstrap, use the same device specification above: dk(x,0)vmunix. Then, to the question ``root device?,'' respond with dk0. See section 6.1 and appendix C if the system does not reboot properly.

The system is now running single user on the installed root file system. The next section tells how to complete the installation of distributed software on the /usr file system. Step 6: placing labels on the disks

4.3BSD uses disk labels in the first sector of each disk to contain information about the geometry of the drive and the partition layout. This information is written with disklabel\|(8). Note that recent CCI releases, and apparently Harris releases, may use a different form of disk label, also in the first sector. As the formats of these labels are incompatible, skip this step if your machine is using disk labels already. Recent firmware for the console processor (CP) may use these labels, and thus the labels must be retained. Eventually, it will be possible to use both formats simultaneously.

For each disk that you wish to label, run the following command: #\|disklabel -w dkx type "optional_pack_name" The type is the CCI disk device name as listed in section 1.3, or any other name listed in /etc/disktab. The optional information may contain any descriptive name for the contents of a disk, and may be up to 16 characters long. This procedure will place the label on the disk using the information found in /etc/disktab for the disk type named. The default disk partitions in \*(4B are the mostly the same as those in the CCI 1.21 release, except for CDC 340Mb xfd drives; see section 4.3.2 for details. If you have changed the disk partition sizes, you may add entries for the modified configuration in /etc/disktab before labeling the affected disks. Step 7: setting up the /usr file system

The next thing to do is to extract the rest of the data from the tape. You might wish to review the disk configuration information in section 4.4 before continuing; the partitions used below are those most appropriate in size.

For the Cypher tape drive, execute the following commands: # cd /dev; MAKEDEV cy0; sync Then perform the following:

# date yymmddhhmm (set date, see date\|(1))
....
# passwd root (set password for super-user)
New password: (password will not echo)
Retype new password:
# hostname mysitename (set your hostname)
# newfs dk0c (create empty user file system)
(this takes a few minutes)
# mount /dev/dk0c /usr (mount the usr file system)
# cd /usr (make /usr the current directory)
# mt fsf
# tar xpbf 20 /dev/rmt12 (extract all of usr except usr/src)
(this takes about 15-20 minutes)
If the tape had been rewound or positioned incorrectly before the tar, it may be repositioned by the following commands. # mt rew # mt fsf 3 The data on the fourth tape file has now been extracted. If you are using 1600bpi tapes, the first reel of the distribution is no longer needed; the remainder of the installation procedure uses the second reel of tape that should be mounted in place of the first. The first instruction below should be ignored if using 1600bpi tapes. The installation procedure continues from this point on the 6250bpi tape.
# mt fsf (do not do on 1600bpi tapes)
# mkdir src (make directory for source)
# mkdir src/sys (make directory for system source)
# cd src/sys (make /usr/sys the current directory)
# tar xpbf 20 /dev/rmt12 (extract the system source)
(this takes about 5-10 minutes)
# cd / (back to root)
# chmod 755 / /usr /usr/src /usr/src/sys
# rm -f sys
# ln -s usr/src/sys sys (make a symbolic link to the system source)
# umount /dev/dk0c (unmount /usr)

You can check the consistency of the /usr file system by doing # fsck /dev/rdk0c The output from fsck should look something like: ** /dev/rdk0c ** Last Mounted on /usr ** Phase 1 - Check Blocks and Sizes ** Phase 2 - Check Pathnames ** Phase 3 - Check Connectivity ** Phase 4 - Check Reference Counts ** Phase 5 - Check Cyl groups 671 files, 3497 used, 137067 free (75 frags, 34248 blocks) .R

If there are inconsistencies in the file system, you may be prompted to apply corrective action; see the document describing fsck for information.

To use the /usr file system, you should now remount it by saying # /etc/mount /dev/dk0c /usr You can then extract the source code for the commands: # cd /usr/src # mt fsf # tar xpb 20 If you get an error at this point, most likely it was a problem with tape positioning. You can reposition the tape by rewinding it and then skipping over the files already read (see mt\|(1)). Additional software

There are three extra tape files on the distribution tape(s) which have not been installed to this point. They are a font library for use with Varian and Versatec printers, the Ingres database system, and user contributed software. All three tape files are in tar\|(1) format and can be installed by positioning the tape using mt\|(1) and reading in the files as was done for /usr/src above. As distributed, the fonts should be placed in a directory /usr/lib/vfont, the Ingres system should be placed in /usr/ingres, and the user contributed software should be placed in /usr/src/new. The exact contents of the user contributed software is given in a separate document. Additional conversion information

After setting up the new \*(4B filesystems, you may restore the user files that were saved on tape before beginning the conversion. Note that the \*(4B restore program does its work on a mounted file system using normal system operations (unlike the older restor that accessed the raw file system device and deposited inodes in the appropriate locations on disk). This means that file system dumps may be restored even if the characteristics of the file system changed. To restore a dump tape for, say, the /a file system something like the following would be used: # mkdir /a # newfs dk1c eagle # mount /dev/dk1c /a # cd /a # restore x

If tar images were written instead of doing a dump, you should be sure to use the `p' option when reading the files back. No matter how you restore a file system, be sure and check its integrity with fsck when the job is complete.