Previous Page
Next Page

Booting a System

Objective:

Boot the system; access detailed information.

  • Explain how to perform a system boot.

Up to this point, this chapter describes the OpenBoot diagnostic utilities, variables, and parameters. At the OpenBoot PROM, the operating system is not yet running. In fact, the OpenBoot PROM will work fine if the operating system is not even loaded. The primary function of the OpenBoot firmware is to start up the system. Starting up is the process of loading and executing a standalone program (for example, the operating system or the diagnostic monitor). In this discussion, the standalone program that is being started is the two-part operating system kernel. After the kernel is loaded, the kernel starts the Unix system, mounts the necessary file systems, and runs /sbin/init to bring the system to the initdefault state that is specified in /etc/inittab. This process is described in the "System Run States" section, later in this chapter.

Starting up can be initiated either automatically or with a command entered at the user interface. On most SPARC-based systems, the bootstrap process consists of the following basic phases:

  1. The system hardware is powered on.

  2. The system firmware (the PROM) executes a POST. (The form and scope of POSTs depend on the version of the firmware in the system.)

  3. After the tests have been completed successfully, the firmware attempts to autoboot if the appropriate OpenBoot configuration variable (auto-boot?) has been set.

The OpenBoot startup process is shown here:

Sun Ultra 5/10 UPA/PCI (UltraSPARC-IIi 333MHz), No Keyboard
OpenBoot 3.31, 128 MB (50 ns) memory installed, Serial #12599081.
Ethernet address 8:0:20:c0:3f:29, Host ID: 80c03f29.

Initializing Memory
Rebooting with command: boot
Boot device: disk  File and args:
SunOS Release 5.10 Version Generic 64-bit
Copyright 1983-2005 Sun Microsystems, Inc.  All rights reserved.
Use is subject to license terms.
Hostname: smokey
checking ufs filesystems
/dev/rdsk/c0t0d0s5: is logging.
/dev/rdsk/c0t0d0s7: is logging.
/dev/rdsk/c0t0d0s4: is logging.
smokey console login:

The startup process is controlled by a number of configuration variables, as described in Table 3.19.

Table 3.19. Boot Configuration Variables

Variable

Description

auto-boot?

Controls whether the system automatically starts up after a system reset or when the power is turned on. The default for this variable is true. When the system is powered on, the system automatically starts up to the default run level.

boot-command

Specifies the command to be executed when auto-boot? is true. The default value of boot-command is boot, with no command-line arguments.

diag-switch?

Causes the system to run in diagnostic mode if the value is TRue. This variable is false by default.

boot-device

Contains the name of the default startup device used when OpenBoot is not in diagnostic mode.

boot-file

Contains the default startup arguments used when OpenBoot is not in diagnostic mode. The default is no arguments. (See Table 3.20 for details on when this variable is used.)

diag-device

Contains the name of the default diagnostic mode startup device. The default is net. (See Table 3.20 for details on when this variable is used.)

diag-file

Contains the default diagnostic mode startup arguments. The default is no arguments. (See Table 3.20 for details on when this variable is used.)


Typically, auto-boot? is set to TRue, boot-command is set to boot, and OpenBoot is not in diagnostic mode. Consequently, the system automatically loads and executes the program and arguments described by boot-file from the device described by boot-device when the system is first turned on or following a system reset.

The boot Command

The boot command has the following syntax:

boot <device specifier> [arguments]

All arguments and options are optional.

The boot command and its options are described in Table 3.20.

Table 3.20. boot Command Arguments and Options

Argument

Description

<device specifier>

The full device name or devalias of the boot device. Typically this boot device is

<full device name> For example, /sbus/esp@0,800000/sd@3,0:a indicates a SCSI disk (sd) at target 3, lun0 on the SCSI bus, with the esp host adapter plugged in to slot 0.

cdrom Boot from CD in the CDROM drive.

disk Boot from the hard drive.

net Boot from the network

[arguments]

The name of the program to be booted (for example, stand/diag) and any program arguments. You can also specify the name of the standalone program to be started up (for example, kernel/sparcv9/unix). The default on a Sun SPARC system is to start up kernel/sparcv9/unix from the root partition.

The following options control the behavior of the boot command:

Option

Description

-a

The startup program interprets this flag to mean "Ask me," so it prompts for the name of the standalone program to load.

-m verbose

Allows customization of the boot console output.

-m milestone <level>

Allows the operator to enter which milestone to enter upon bootup.

-r

Triggers device reconfiguration during startup.

-s

Boots to the single-user milestone.

-v

Boots in verbose mode. When this option is set, all system messages are displayed.

flags

The boot program passes all startup flags to [argument]. The startup flags are not interpreted by boot. (See the section "The Kernel," later in this chapter, for information on the options that are available with the default standalone program, kernel/sparcv9/unix.)


A noninteractive boot (boot) automatically boots the system by using default values for the boot path. You can initiate a noninteractive boot by typing the following command from the OpenBoot prompt:

ok boot

The system boots without requiring any additional interaction.

An interactive boot (boot -a) stops and asks for input during the boot process. The system provides a dialog box in which it displays the default boot values and gives you the option of changing them. You might want to boot interactively to make a temporary change to the system file or kernel. Booting interactively enables you to test your changes and recover easily if you have problems. To do this, follow the process in Step by Step 3.1.

Tip

The Interactive Boot Process For the exam, you should make sure you understand what each step of an interactive boot process is asking for. For example, you should know the name of the default kernel, know what the default modules are and where they are located, understand what the /etc/system file is used for, and what is meant by the default root file system. Each of these are described in the section "The Kernel," later in this chapter.


Step By Step 3.1: The Interactive Boot Process

1.
At the ok prompt, type boot -a and press Enter. The boot program prompts you interactively.

2.
Press Enter to use the default kernel as prompted, or type the name of the kernel to use for booting and then press Enter.

3.
Press Enter to use the default modules directory path as prompted, or type the path for the modules directory and then press Enter.

4.
Press Enter to use the default /etc/system file as prompted, or type the name of the system file and then press Enter.

Note

A Missing /etc/system File If the /etc/system file is missing at bootup, you see this message:

Warning cannot open system file!

The system still boots, however, using all "default" kernel parameters. Because by default the lines in the /etc/system file are all commented by the asterisk (*) character, /etc/system is actually an "empty" file. The kernel doesn't use anything from this file until you edit this file and enter an uncommented line. You can specify /dev/null (an empty file) for the system filename, and the system still boots. In fact, if the /etc/system file gets corrupted and the system won't boot from the /etc/system file, you can specify a file named /dev/null to get the system to boot.

5.
Press Enter to use the default root file system type as prompted (that is, ufs for local disk booting or nfs for diskless clients).

6.
Press Enter to use the default physical name of the root device as prompted or type the device name.


The following output shows an example of an interactive boot session:

ok boot -a
Resetting ...



Sun Ultra 5/10 UPA/PCI (UltraSPARC-IIi 270MHz), No Keyboard
OpenBoot 3.31, 128 MB (60 ns) memory installed, Serial #10642306.
Ethernet address 8:0:20:a2:63:82, Host ID: 80a26382.


Rebooting with command: boot -a
Boot device: /pci@1f,0/pci@1,1/ide@3/disk@0,0  File and args: -a
Enter filename [kernel/sparcv9/unix]:
Enter default directory for modules [/platform/SUNW,Ultra-5_10/kernel /platform/
sun4u/kernel /kernel /usr/kernel]:
Name of system file [etc/system]:
SunOS Release 5.10 Version Generic 64-bit
Copyright 1983-2005 Sun Microsystems, Inc.  All rights reserved.
Use is subject to license terms.
root filesystem type [ufs]:
Enter physical name of root device
[/pci@1f,0/pci@1,1/ide@3/disk@0,0:a]:
Hostname: ultra5
/dev/rdsk/c0t0d0s5: is logging.
/dev/rdsk/c0t0d0s7: is logging.
/dev/rdsk/c0t0d0s4: is logging.
ultra5 console login:

To view more detailed information during the boot process, you use the boot -v or boot -m verbose options to the boot command:

ok boot -m verbose

The system outputs more detailed boot messages as follows:

Boot device: /pci@1f,0/pci@1,1/ide@3/disk@0,0:a  File and args: -m verbose
SunOS Release 5.10 Version Generic 64-bit
Copyright 1983-2005 Sun Microsystems, Inc.  All rights reserved.
Use is subject to license terms.
[ network/loopback:default starting (loopback network interface) ]
[ system/filesystem/root:default starting (root file system mount) ]
[ network/pfil:default starting (packet filter) ]
Sep 20 11:15:54/74: system start time was Tue Sep 20 11:15:39 2005
[ milestone/name-services:default starting (name services milestone) ]
[ network/physical:default starting (physical network interfaces) ]
[ system/filesystem/usr:default starting (read/write root file systems mounts) ]
[ system/device/local:default starting (Standard Solaris device configuration.) ]
[ system/filesystem/minimal:default starting (minimal file system mounts) ]
[ milestone/devices:default starting (device configuration milestone) ]
[ system/identity:domain starting (system identity (domainname)) ]
[ system/manifest-import:default starting (service manifest import) ]
[ milestone/network:default starting (Network milestone) ]
[ system/cryptosvc:default starting (cryptographic services) ]
[ system/identity:node starting (system identity (nodename)) ]
[ network/initial:default starting (initial network services) ]
[ system/sysevent:default starting (system event notification) ]
Hostname: ultra5
[ system/device/fc-fabric:default starting (Solaris FC fabric device configuration.) ]
[ system/coreadm:default starting (system-wide core file configuration) ]
[ system/keymap:default starting (keyboard defaults) ]
[ system/name-service-cache:default starting (name service cache) ]
[ system/rmtmpfiles:default starting (remove temporary files) ]
[ milestone/single-user:default starting (single-user milestone) ]
[ system/picl:default starting (platform information and control) ]
[ network/service:default starting (layered network services) ]
[ system/power:default starting (power management) ]
[ application/print/cleanup:default starting (print cleanup) ]
[ system/filesystem/local:default starting (local file system mounts) ]
checking ufs filesystems
/dev/rdsk/c0t0d0s5: is logging.
/dev/rdsk/c0t0d0s7: is logging.
[ system/cron:default starting (clock daemon (cron)) ]
[ application/font/fc-cache:default starting (FontConfig Cache Builder) ]
[ system/sysidtool:net starting (sysidtool) ]
[ network/rpc/bind:default starting (RPC bindings) ]
[ system/sysidtool:system starting (sysidtool) ]
[ network/nfs/status:default starting (NFS status monitor) ]
[ network/nfs/mapid:default starting (NFS ID mapper) ]
[ milestone/sysconfig:default starting (Basic system configuration milestone) ]
[ network/inetd:default starting (inetd) ]
[ network/nfs/nlockmgr:default starting (NFS lock manager) ]
[ system/sac:default starting (SAF service access controller) ]
[ system/utmp:default starting (utmpx monitoring) ]
[ system/console-login:default starting (Console login) ]

ultra5 console login: Sep 20 11:16:38/214: network/nfs/client:default starting
Sep 20 11:16:40/216: system/filesystem/autofs:default starting
Sep 20 11:16:43/220: network/ssh:default starting
Sep 20 11:16:43/221: system/dumpadm:default starting
Sep 20 11:16:44/223: system/system-log:default starting
Sep 20 11:16:45/227: system/fmd:default starting
Sep 20 11:16:45/229: network/smtp:sendmail starting
Sep 20 11:16:46/231: milestone/multi-user:default starting
Sep 20 11:17:00/235: system/zones:default starting

ultra5 console login: ultra5 console login:

If you are not at the system console to watch the boot information, you can use the Unix dmesg command to redisplay information that was displayed during the boot process, or you can view the information in the /var/adm/messages file. The dmesg command displays the contents of a fixed-size buffer. Therefore, if the system has been up for a long time, the initial boot messages may have been overwritten with other kernel log entries.

To view messages displayed during the boot process, you can use one of the following methods:

  • At a Unix prompt, type /usr/sbin/dmesg and press Enter.

    Note

    Viewing dmesg Output Several pages of information are displayed when you use this method, so I recommend that you pipe the dmesg command to more, as shown here: /usr/sbin/dmesg|more.


  • At a Unix prompt, type more /var/adm/messages and press Enter.

New in Solaris 10 is the concept of services, described in the Service Management Facility (SMF) section of this chapter. With SMF, there are additional tools for viewing system startup messages. Refer to the section on SMF for additional information.

When you specify an explicit device alias, such as disk3, with the boot command, the machine starts up from the specified startup device, using no startup arguments. Here's an example:

boot disk3

In this case, the system boots from the disk drive defined by the device alias named disk3. It then loads kernel/sparcv9/unix as the default standalone startup program.

Various options affect the behavior of the boot command. You use the following syntax to specify any of the options listed in Table 3.20 with the boot command:

boot [options]

When you specify options with the boot command, the machine starts up from the default startup device. Here's an example:

boot -a

The -a option instructs the boot command to ask for the name of the standalone program to load. If you specify kernel/sparcv9/unix, which is the default, you are prompted to enter the directory that contains the kernel modules. (See the section "The Kernel," later in this chapter, for details on kernel modules.)

You can mix options and arguments with the boot command by using the following syntax:

boot [argument]<program filename> - <flags>

When you specify the boot command with an explicit startup device and option, the machine starts up from the specified device using the specified option. Here's an example:

boot disk3 -a

This gives the same prompts as the previous example, except that you are specifying the boot device and not using the default boot device. The system starts up the bootblock from the disk drive defined by the device alias named disk3.

During the startup process, OpenBoot performs the following tasks:

  1. The firmware resets the machine if a client program has been executed since the last reset. The client program is normally an operating system or an operating system's loader program, but boot can also be used to load and execute other kinds of programs, such as diagnostics programs. For example, if you have just issued the test net command, when you next type boot, the system resets before starting up.

  2. The boot program is loaded into memory, using a protocol that depends on the type of selected device. You can start up from disk, CD-ROM, or the network.

  3. The loaded boot program is executed. The behavior of the boot program can be controlled by the argument string, if one is passed to the boot command on the command line.

The program that is loaded and executed by the startup process is a secondary boot program, the purpose of which is to load the standalone program. The second-level program is either ufsboot, when you're starting up from a disk, or inetboot, when you're starting up from the network.

If you're starting up from disk, the bootstrap process consists of two conceptually distinct phases: primary startup and secondary startup. The PROM assumes that the program for the primary startup (bootblk) is in the primary bootblock, which resides in sectors 1 through 15 of the startup device. The bootblock is created by using the installboot command. The software installation process typically installs the bootblock for you, so you don't need to issue this command unless you're recovering a corrupted bootblock.

To install a bootblock on disk c0t3d0s0, for example, you type the following:

installboot /usr/platform/'uname -i'/lib/fs/ufs/bootblk \
 /dev/rdsk/c0t3d0s0

You cannot see the bootblock, as it resides outside the file system area. It resides in a protected area of the disk and will not be overwritten by a file system. The program in the bootblock area loads the secondary startup program, ufsboot.

When you're executing the boot command, if you specify a filename, that filename is the name of the standalone startup program to be loaded. If the pathname is relative (that is, it does not begin with a slash), ufsboot looks for the standalone program in a platform-dependent search path which is /platform/'uname-m' and /platform/'uname -i'.

Note

Determining Your System's Platform Name You can use the uname -i command to determine your system's platform name. For example, on a Sun Ultra 5, the path is /platform/SUNW,Ultra-5_10. You use the command uname -m to find the hardware classname of a system; for an Ultra 5, the hardware classname is sun4u.ufsboot will search in both the /platform/'uname-m' and /platform/'uname -i' directories for the kernel files.


On the other hand, if the path to the filename is absolute, boot uses the specified path. The startup program then loads the standalone program and transfers control to it.

The following example shows how to specify the standalone startup program from the OpenBoot ok prompt:

ok boot disk5 kernel/sparcv9/unix -s

In this example, the PROM looks for the primary boot program (bootblk) on disk5 (/pci@1f,0/pci@1,1/ide@3/disk@5,0). The primary startup program then loads /platform/'uname -m'/ufsboot.ufsboot loads the appropriate two-part kernel. The core of the kernel is two pieces of static code called genunix and unix, where genunix is the platform-independent generic kernel file and unix is the platform-specific kernel file. When ufsboot loads these two files into memory, they are combined to form the running kernel. On systems running the 64-bit mode OS, the two-part kernel is located in the directory:

/platform/'uname -m'/kernel/sparcv9

Typical secondary startup programs, such as kernel/sparcv9/unix, accept arguments of the form <filename> -<flags>, where filename is the path to the standalone startup program and -<flags> is a list of options to be passed to the standalone program. The example starts up the operating system kernel, which is described in the next section. The -s flag instructs the kernel to start up in single-user mode.


Previous Page
Next Page