Booting a SystemObjective: Boot the system; access detailed information.
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:
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.
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 CommandThe 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.
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. 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:
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:
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. |