System Administration Guide, Volume I
  Search only this book
Download this book in PDF

Booting a SPARC System

8

This chapter describes procedures for using the OpenBoot(TM) PROM monitor and procedures for booting a SPARC system to different run levels.
This is a list of the step-by-step instructions in this chapter.
SPARC: How to Switch to the ok Promptpage 148
SPARC: How to Find the PROM Release for a Systempage 148
SPARC: How to Change the Default Boot Devicepage 149
SPARC: How to Reset the Systempage 151
SPARC: How to Boot a System to Run Level 3 (Multiuser State)page 153
SPARC: How to Boot a System to Run Level S (Single-User State)page 155
SPARC: How to Boot a System Interactivelypage 156
SPARC: How to Boot a System for Recovery Purposespage 158
SPARC: How to Stop the System for Recovery Purposespage 160
SPARC: How to Force a Crash Dump and Reboot the Systempage 161
SPARC: How to Boot the System Using the Kernel Debugger (kadb)page 162
For overview information about the boot process, see Chapter 10, "The Boot Process."

Using the Boot PROM

System administrators typically use the PROM level to boot a system but occasionally may need to change the way the system works, such as setting which device to boot from or running hardware diagnostics, before the system is brought to a multiuser state.
Changing the default boot device is necessary when you want to add a new drive to the system either permanently or temporarily, or if you convert a standalone system to a diskless client that needs to boot from the network.
See monitor(1M) or eeprom(1M) for a complete list of PROM commands.

· SPARC: How to Switch to the ok Prompt

When the system is halted, the PROM monitor prompt is either the greater than sign (>) or ok.
Switch from the > prompt to the ok prompt on SPARC systems by typing the following command.

  > n  
  ok  

All examples in this section use the ok prompt.

· SPARC: How to Find the PROM Release for a System

Display a system's PROM release level with the banner command.

  ok banner  
  SPARCstation 2, Type 4 Keyboard  
  ROM Rev. 2.2, 16 MB memory installed, Serial #nnnnnn  
  Ethernet address 8:0:20:f:fd:6c HostID nnnnnnnn  

Hardware configuration information, including the release number of the PROM, is displayed. The PROM release level is indicated by the ROM Rev. number.

· SPARC: How to Change the Default Boot Device

Use this procedure when you need to change the default boot device.
  1. Become root.

  2. Halt the system by using the init command.


  # init 0  

The PROM prompt is displayed.
  1. If the > PROM prompt is displayed, type n and press Return.


  > n  
  ok  

The ok PROM prompt is displayed.
  1. Change the boot-device setting by using the setenv command.


  ok setenv boot-device disk[n]  

In this command,
boot-deviceIdentifies the parameter for setting the device from which to boot.
disk[n]Identifies the boot-device value and in this case, n is the disk number.
Use the probe-scsi-all command if you need help identifying the disk number.
  1. Verify the change by using the printenv command.


  ok printenv boot-device  

  1. Save the new boot-device value by using the reset command.


  ok reset  

The boot-device setting is written to the PROM.

Example--Changing the Default Boot Device


  # init 0  
  #  
  INIT: New run level: 0  
  .  
  .  
  .  
  The system is down.  
  syncing file systems... [11] [10] [5] done  
  Program terminated  
  Type  help  for more information  
  ok setenv boot-device disk  
  boot-device =         disk  
  ok printenv boot-device  
  boot-device           disk                    disk  
  ok reset  
  SPARCstation IPC, No Keyboard  
  ROM Rev. 2.9, 12 MB memory installed, Serial #32522.  
  Ethernet address 8:0:20:b:40:e9, Host ID: 52007f0a.  
  Testing   1 megs of memory. Still to go    0  
  Boot device: /sbus/esp@0,800000/sd@3,0   File and args:  
  .  
  .  
  .  
  pluto console login:  

· SPARC: How to Reset the System

Run the reset command from the ok prompt.

  ok reset  

The self-test program, which runs diagnostic tests on the hardware, is executed and the system is rebooted.

Booting a SPARC System

Table 8-1 describes the boot scenarios covered in this chapter.
Table 8-1
Booting the System ...Is Usually Done ...See an Example On ...
To run level 3 (multiuser state with NFS resource shared)After halting the system or performing some system hardware maintenance task. This is the default boot level where all resources are available and users can log into the system.page 154
To run level S (single-user state)After performing some system maintenance task such as backing up a file system. At this level only some file systems are mounted and users cannot log into the system.page 155
InteractivelyAfter making temporary changes to a system file or the kernel for testing purposes. This type of boot allows you to recover easily if there are problems with the system file or kernel by supplying an alternative pathname to these files when prompted. Use the default settings for the other system prompts.page 157
From local CD-ROM or the network for recovery purposesTo repair an important system file that is preventing the system from booting successfully. This type of boot is also used for installing (or upgrading) a new release of the operating system.page 159
Using kadbTo troubleshoot system problems by running the kernel debugger.page 162
If a system is turned off, turning it on starts the multiuser boot sequence. The following procedures show how to boot to different run levels from the ok PROM prompt.
Use the who -r command to verify that the system is brought to the specified run level.
See Chapter 6, "Run Levels and Boot Files," for a description of run levels.

· SPARC: How to Boot a System to Run Level 3 (Multiuser State)

Boot to run level 3 by using the boot command.

  ok boot  

The automatic boot procedure displays a series of startup messages, and brings the system to run level 3.

Verification--Booting a System to Run Level 3 (Multiuser State)

If the system successfully boots to run level 3 if the login prompt is displayed.

  hostname console login:  

Example--Booting a System to Run Level 3 (Multiuser State)

The following example displays the messages from booting a system to run level 3.

  ok boot  
  Resetting ...  
  SPARCstation 10 (1 X 390Z50), Keyboard Present  
  ROM Rev. 2.14, 32 MB memory installed, Serial #number.  
  Ethernet address 8:0:20:1f:21:be, Host ID: number.  
  Rebooting with command:  
  Boot device: /iommu/sbus/espdma@f,400000/esp@f,800000/sd@3,0  
  File and args:  
  SunOS Release 5.5 Version [UNIX(R) System V Release 4.0]  
  Copyright (c) 1983-1995, Sun Microsystems, Inc.  
  configuring network interfaces: le0.  
  Hostname: venus  
  The system is coming up.  Please wait.  
  checking ufs filesystems  
  /dev/rdsk/c0t3d0s7: is clean.  
  /dev/rdsk/c0t3d0s5: is clean.  
  NIS domainname is solar.com  
  starting rpc services: rpcbind keyserv nis_cachemgr kerbd done.  
  Setting netmask of le0 to 255.255.255.0  
  Setting default interface for multicast: add net 224.0.0.0:  
  gateway venus  
  syslog service starting.  
  volume management starting.  
  The system is ready.  
  venus console login:  

· SPARC: How to Boot a System to Run Level S (Single-User State)

  1. Boot the system to run level S by using the boot -s command.


  ok boot -s  

  1. Enter the root password when the following message is displayed.


  INIT: SINGLE USER MODE  
  Type Ctrl-d to proceed with normal startup,  
  (or give root password for system maintenance):            xxx  

  1. To bring the system up to multiuser state after the system maintenance task is performed, press Control-d.

Verification--Booting a System to Run Level S (Single-User State)

Use the who -r command to verify the system is at run level S.

Example--Booting a System to Run Level S (Single-User State)

The following example displays a system booted to run level S.

  ok boot -s  
  .  
  .  
  .  
  SunOS Release 5.5 Version [UNIX(R) System V Release 4.0]  
  Copyright (c) 1983-1995, Sun Microsystems, Inc.  
  configuring network interfaces: le0.  
  Hostname: mars  
  INIT: SINGLE USER MODE  
  Type Ctrl-d to proceed with normal startup,  
  (or give root password for system maintenance): xxx  
  Sun Microsystems Inc.   SunOS 5.5 October 1995  
  # who -r  
     .       run-level S  Aug  4 13:11     S      0  ?  
  Perform some maintenance task  
  # <Control-d>  

· SPARC: How to Boot a System Interactively

  1. Boot the system interactively by using the boot -a command.


  ok boot -a  

  1. Answer the system prompts as described in Table 8-2.

Table 8-2
If the System Displays ... Do the Following ...
Enter filename [kernel/unix]: Provide the name of another kernel to use for booting.

Or, press Return to use the default kernel (/platform/'uname -m'/kernel/unix).

Name of default directory for modules [/platform/'uname -m'/kernel /kernel /usr/kernel]: Provide an alternate path for the modules directory and press Return. Or, press Return to use the default modules directory path.
Name of system file [/etc/system]: Provide the name of an alternate system file and press Return.

Or, press Return to use the default /etc/system file.

root filesystem type [ufs]: Press Return to use the default root file system type: UFS for local disk booting or NFS for diskless clients.
Enter physical name of root device
[physical_device_name]:
Provide an alternate device name and press
Return.
Or, press Return to use the default physical name
of the root device.

Verification--Booting a System Interactively

The system booted interactively if you are prompted to answer the questions listed in Table 8-2.

Example--Booting a System Interactively

In following example, the default choices (shown in square brackets []) are accepted.

  ok boot -a  
  .  
  .  
  .  
  Resetting ...  
  Rebooting with command: -a  
  Boot device: /iommu/sbus/espdma@f,400000/esp@f,800000/sd@3,0  
  File and args: -a  
  Enter filename [kernel/unix]: Retur  
  Enter default directory for modules  
  [/platform/SUNW,SPARCstation-10/kernel /kernel /usr/kernel]:  
  Return  
  SunOS Release 5.5 Version [UNIX(R) System V Release 4.0]  
  Copyright (c) 1983-1995, Sun Microsystems, Inc.  
  Name of system file [etc/system]:         Return  
  root filesystem type [ufs]: Return  
  Enter physical name of root device  
  [/iommu@f,e0000000/sbus@f,e0001000/espdma@f,400000/esp@f,800000  
  /sd@3,0:a]: Return  
  configuring network interfaces: le0.  
  Hostname: earth  
  The system is coming up.  Please wait.  
  .  
  .  
  .  
  The system is ready.  
  earth console login:  

· SPARC: How to Boot a System for Recovery Purposes

This procedure is needed when an important file, such as /etc/passwd, has an invalid entry and is causing the boot process to fail.
If you need help identifying a system's device names, refer to Chapter 26, "Accessing Devices."
  1. Follow the instructions below depending on whether you are booting from the Solaris 2.x installation CD or the network.

If You are Booting From ...Then ...
Solaris 2.x installation CD 1. Insert the Solaris 2.x installation CD
into the CD caddy.
2. Insert the CD caddy into the CD-ROM
drive.
3. Boot from the installation CD in single-
user mode:
ok boot cdrom -s
The network and an installation server or remote CD drive are available Use the following command: ok boot net -s
  1. Mount the file system that has the file with an invalid entry.


  # mount /dev/dsk/device-name /a  

  1. Change to the newly mounted directory.


  # cd /a/directory  

  1. Set the terminal type.


  # TERM=sun  
  # export TERM  

  1. Remove the invalid entry from the file using an editor.


  # vi filename  

  1. Change to the root (/) directory.


  # cd /  

  1. Unmount the /a directory.


  # umount /a  

  1. Reboot the system.


  # init 6  

Verification--Booting a System for Recovery Purposes

The procedure is successful if the system successfully boots to run level 3.

Example--Booting a System for Recovery Purposes

The following example uses the /etc/passwd as an example of repairing an important system file, after booting from a local CD-ROM.

  ok boot cdrom -s  
  # mount /dev/dsk/rdsk/c0t3d0s0 /a  
  # cd /a/etc  
  # TERM=sun  
  # export TERM  
  # vi passwd  
  # cd /  
  # umount /a  
  # init 6  

· SPARC: How to Stop the System for Recovery Purposes

The specific stop key sequence depends on your keyboard type. For example, you can press Stop-A or L1-A. On terminals, press the Break key.
  1. Type the abort key sequence for your system.

    The monitor displays the ok PROM prompt.


  ok  

  1. Use the sync command to synchronize the disks.


  ok sync  

  1. When you see the syncing file systems... message, press the abort key sequence for your system again.

  2. Type the appropriate boot command to start the boot process.

Verification--Stopping the System for Recovery Purposes

Stopping the system was successful when you see the syncing file systems... message and the ok prompt.

Example--Stopping the System for Recovery Purposes


  Press <Stop-A>  
  ok sync  
  syncing file systems...  
  Press <Stop-A>  
  ok boot  

Forcing a Crash Dump and Rebooting the System

Saving crash dumps of the operating system is sometimes necessary for troubleshooting purposes. The savecore command is used to enable this feature. It can be turned on automatically by editing the /etc/init.d/sysetup script.
The savecore feature and how to set it up is described in "Managing System Resources" the System Administration Guide, Volume II. This section only describes how to reboot the system if the savecore feature is enabled.

· SPARC: How to Force a Crash Dump and Reboot the System

  1. Type the stop key sequence for your system. The specific stop key sequence depends on your keyboard type. For example, you can press Stop-A or L1-A. On terminals, press the Break key.

    The monitor displays the ok PROM prompt.

  2. Use the sync command at the ok prompt to synchronize the disk and write the crash dump.


  > n  
  ok sync  

Verification--Forcing a Crash Dump and Rebooting the System

After the crash dump is written to disk, the system will continue to reboot.

Example--Forcing a Crash Dump and Rebooting the System


  Press <Stop-A>  
  ok sync  

· SPARC: How to Boot the System Using the Kernel Debugger (kadb)

  1. Type the stop key sequence for your system. The specific stop key sequence depends on your keyboard type. For example, you can press Stop-A or L1-A. On terminals, press the Break key.

    The monitor displays the ok PROM prompt.

  2. Use the sync command at the ok prompt to synchronize the disk and write the crash dump.


  > n  
  ok sync  

  1. When you see the syncing file systems... message, press the abort key sequence for your system again.

  2. Boot the system using the kernel debugger.


  ok boot kadb  

Example--Booting the System using the Kernel Debugger (kadb)


  Press <Stop-A>  
  ok sync  
  syncing file systems...  
  Press <Stop-A>  
  ok boot kadb  

SPARC: Troubleshooting System Problems

Problem -- The System is Hung ...How to Fix the Problem
At run level 2 or 3.Log in remotely and attempt to identify and kill the process that is hanging the system.
And you can't log in remotely from anotherSee "SPARC: How to Stop the System for Recovery Purposes" on
machine to attempt recovery.page 160.
Problem -- The System Won't Boot Because ... How to Fix the Problem
It can't find /platform/'uname -.....See "SPARC: How to Change the Default Boot Device" on page 149.
m'/kernel/unix , you may need to change the boot-device setting in the PROM.
A process or an external event like a power See "SPARC: How to Reset the System" on page 151.
failure has caused the system to "hang."
An important system file like /etc/passwdSee "SPARC: How to Boot a System for Recovery Purposes" on
has an invalid entry.page 158.