System Administration Guide: Basic Administration

Chapter 10 SPARC: Booting a System (Tasks)

This chapter describes the procedures for using the OpenBootTM PROM monitor and the procedures for booting a SPARC based system to different run levels.

For information on the procedures associated with booting a SPARC system, see SPARC: Booting a System (Task Map).

For overview information about the boot process, see Chapter 7, Shutting Down and Booting a System (Overview). To troubleshoot boot problems, see “What to Do If Rebooting Fails” in System Administration Guide: Advanced Administration.

For step-by-step instructions on booting an x86 based system, see Chapter 11, x86: Booting a System (Tasks).

SPARC: Booting a System (Task Map)

Task 

Description 

For Instructions 

Use the Boot PROM 

The boot PROM is used to boot a system. You might need to do one of the following: 

 

 

Identify the PROM revision number. 

SPARC: How to Find the PROM Revision for a System

 

Identify devices on the system to boot from. 

SPARC: How to Identify Devices on a System

 

Change the default boot device when a new disk is added or when you need to change the system boot method. 

SPARC: How to Change the Default Boot Device

Boot the system 

Select one of the following boot methods: 

 

 

Boot to run level 3 - Used after shutting down the system or performing some system hardware maintenance task.  

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

 

Boot to run level S - Used after performing some system maintenance task such as backing up a file system. At this level, only local file systems are mounted and users cannot log into the system. 

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

 

Boot interactively - Used after making temporary changes to a system file or the kernel for testing purposes. 

SPARC: How to Boot a System Interactively

 

Boot from the network - Used to boot a system from the network. This method is used for booting a diskless client. 

SPARC: How to Boot a System From the Network

 

Boot for recovery purposes - Used to boot the system when a damaged file or file system is preventing the system from booting. You might need to do one or both of the following to boot for recovery purposes: 

 

 

First, stop the system to attempt recovery. 

SPARC: How to Stop the System for Recovery Purposes

 

Boot to repair an important system file that is preventing the system from booting successfully. 

SPARC: How to Boot a System for Recovery Purposes

 

Boot kadb - Used to troubleshoot system problems.

SPARC: How to Stop the System for Recovery Purposes

 

Force a crash dump and reboot the system - Used to force a crash dump for troubleshooting purposes. 

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

SPARC: Using the Boot PROM

System administrators typically use the PROM level to boot a system. Occasionally, however, you might need to change the way the system boots. For example, you might want to reset the device to boot from or run hardware diagnostics before you bring the system to a multiuser level.

You need to change the default boot device to do the following:

For a complete list of PROM commands, see monitor(1M) or eeprom(1M).

SPARC: How to Find the PROM Revision for a System

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


ok banner
Sun Ultra 5/10 UPA/PCI (UltraSPARC-IIi 333MHz), No Keyboard
OpenBoot 3.15, 128 MB memory installed, Serial #number.
Ethernet address number, Host ID: number.

Hardware configuration information, including the revision number of the PROM, is displayed. In this example, the PROM revision number is 3.15.

SPARC: How to Identify Devices on a System

You might need to identify the devices on the system to figure out what are the appropriate devices to boot from.

Before you can safely use the probe commands to find out what devices are attached to the system, you need to do the following:

You can the probe commands that are available on your system by using the sifting probe command, as follows:


ok sifting probe

If you run the probe commands without clearing the system registers, the following message is displayed:


ok probe-scsi
This command may hang the system if a Stop-A or halt command
has been executed.  Please type reset-all to reset the system 
before executing this command. 
Do you wish to continue? (y/n) n
  1. Change the PROM auto-boot? parameter to false.


    ok setenv auto-boot? false
    
  2. Clear the system's registers.


    ok reset-all
    
  3. Identify the devices on the system.


    ok probe-device
    
  4. (Optional) If you want the system to reboot after a power failure or after using the reset command, then change the auto-boot? parameter back to true.


    ok setenv auto-boot? true
    auto-boot? =          true
  5. Boot the system back to multiuser mode.


    ok reset
    

SPARC: Examples—Identifying the Devices on a System

The following example shows how to identify the devices connected to an Ultra10 system.


ok setenv auto-boot? false
auto-boot? =          false
ok reset-all
Resetting ... 

Sun Ultra 5/10 UPA/PCI (UltraSPARC-IIi 333MHz), No Keyboard
OpenBoot 3.15, 128 MB memory installed, Serial #10933339.
Ethernet address 8:0:20:a6:d4:5b, Host ID: 80a6d45b.

ok probe-ide
  Device 0  ( Primary Master ) 
          ATA Model: ST34321A                                

  Device 1  ( Primary Slave ) 
         Not Present

  Device 2  ( Secondary Master ) 
         Removable ATAPI Model: CRD-8322B                               

  Device 3  ( Secondary Slave ) 
         Not Present

ok setenv auto-boot? true
auto-boot? =          true

You can use the devalias command to identify the device aliases and the associated paths of devices that might be connected to the system.


ok devalias
screen                   /pci@1f,0/pci@1,1/SUNW,m64B@2
net                      /pci@1f,0/pci@1,1/network@1,1
cdrom                    /pci@1f,0/pci@1,1/ide@3/cdrom@2,0:f
disk                     /pci@1f,0/pci@1,1/ide@3/disk@0,0
disk3                    /pci@1f,0/pci@1,1/ide@3/disk@3,0
disk2                    /pci@1f,0/pci@1,1/ide@3/disk@2,0
disk1                    /pci@1f,0/pci@1,1/ide@3/disk@1,0
disk0                    /pci@1f,0/pci@1,1/ide@3/disk@0,0
ide                      /pci@1f,0/pci@1,1/ide@3
floppy                   /pci@1f,0/pci@1,1/ebus@1/fdthree
ttyb                     /pci@1f,0/pci@1,1/ebus@1/se:b
ttya                     /pci@1f,0/pci@1,1/ebus@1/se:a
keyboard!                /pci@1f,0/pci@1,1/ebus@1/su@14,3083f8:forcemode
keyboard                 /pci@1f,0/pci@1,1/ebus@1/su@14,3083f8
mouse                    /pci@1f,0/pci@1,1/ebus@1/su@14,3062f8
name                     aliases

SPARC: How to Change the Default Boot Device

You might need to identify the devices on the system before you can change the default boot device to some other device. For information on identifying devices on the system, see SPARC: How to Identify Devices on a System.

  1. Become superuser.

  2. Change to run level 0.


    # init 0
    

    The ok PROM prompt is displayed.

    For more information, see init(1M).

  3. Change the value of the boot-device parameter.


    ok setenv boot-device device[n]

    boot-device

    Identifies the parameter for setting the device from which to boot. 

    device[n]

    Identifies the boot-device value such as a disk or the network. The n can be specified as the disk number.

    Use one of the probe commands if you need help with identifying the disk number.

  4. Verify that the default boot device is changed.


    ok printenv boot-device
    
  5. Save the new boot-device value.


    ok reset
    

    The new boot-device value is written to the PROM.

SPARC: Examples—Changing the Default Boot Device

In this example, the default boot device is set to disk.


# init 0
# 
INIT: New run level: 0
.
.
.
The system is down.
syncing file systems... done
Program terminated
ok setenv boot-device disk
boot-device =         disk
ok printenv boot-device
boot-device           disk                    disk
ok reset
Sun Ultra 5/10 UPA/PCI (UltraSPARC-IIi 333MHz), No Keyboard
OpenBoot 3.15, 128 MB memory installed, Serial #number.
Ethernet address number, Host ID: number.

Boot device: disk  File and args:
SunOS Release 5.9 Version 64-bit
.
.
.
pluto console login:

In this example, the default boot device is set to the network.


# init 0
# 
INIT: New run level: 0
.
.
.
The system is down.
syncing file systems... done
Program terminated
ok setenv boot-device net
boot-device =         net
ok printenv boot-device
boot-device           net                    disk
ok reset
Sun Ultra 5/10 UPA/PCI (UltraSPARC-IIi 333MHz), No Keyboard
OpenBoot 3.15, 128 MB memory installed, Serial #number.
Ethernet address number, Host ID: number.



Boot device: net  File and args:
.
.
.
pluto console login:

SPARC: How to Reset the System

Run the reset command from the ok prompt.


ok reset

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

SPARC: Booting a System

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. These procedures assume that the system has been cleanly shut down, unless stated otherwise.

Use the who -r command to verify that the system is brought to the specified run level. For a description of run levels, see Chapter 8, Run Levels and Boot Files (Tasks).

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

Use this procedure to boot a system that is currently at run level 0 to run level 3.

  1. Boot the system to run level 3.


    ok boot
    

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

    For more information, see boot(1M).

  2. Verify that the system has booted to run level 3.

    The login prompt is displayed when the boot process has finished successfully.


    hostname console login:

SPARC: Example—Booting a System to Run Level 3 (Multiuser Level)

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


ok boot
Sun Ultra 5/10 UPA/PCI (UltraSPARC-IIi 333MHz)
OpenBoot 3.15, 128 MB memory installed, Serial #number.
Ethernet address number, Host ID: number.

Rebooting with command: boot
Boot device: disk:a  File and args: 
SunOS Release 5.9 Version Generic 64-bit
Copyright (c) 1983-2002 by Sun Microsystems, Inc.
configuring IPv4 interfaces: hme0.
Hostname: starbug
The system is coming up.  Please wait.
checking ufs filesystems
/dev/rdsk/c0t0d0s7: is clean.
/dev/rdsk/c0t0d0s4: is clean.
NIS domainname is Solar.COM
starting rpc services: rpcbind keyserv ypbind done.
Setting netmask of hme0 to 255.255.255.0
Setting default IPv4 interface for multicast: add net 224.0/4: 
gateway starbug
syslog service starting.
Print services started.
volume management starting.
The system is ready.

starbug console login: 

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

Use this procedure to boot a system that is currently at run level 0 to run level S.

  1. Boot the system to run level S.


    ok boot -s
    
  2. Type the superuser 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
    
  3. Verify that the system is at run level S.


    # who -r
    .       run-level S  Jun 10 15:27     3      0 
  4. To bring the system up to multiuser state after you completed the system maintenance task, press Control-D.

SPARC: Example—Booting a System to Run Level S (Single-User Level)

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


ok boot -s
.
.
.
Sun Microsystems Inc.   SunOS 5.9  Generic May 2002
Copyright 1983-2003 Sun Microsystems, Inc.  All rights reserved.
Use is subject to license terms.
configuring IPv4 interfaces: hme0.
Hostname: starbug

INIT: SINGLE USER MODE

Type control-d to proceed with normal startup,
(or give root password for system maintenance): xxx
Sun Microsystems Inc.   SunOS 5.9  Generic May 2002
# who -r
   .       run-level S  Sep 19 08:49     S      0  ?
(Perform some maintenance task)
# Press Control-D

SPARC: How to Boot a System Interactively

Use this procedure to boot a system and you need to specify an alternate kernel or /etc/system file.

  1. Boot the system interactively.


    ok boot -a
    
  2. Answer the system prompts as described in the following table.

    System Prompt 

    Action 

    Enter filename [kernel/[sparcv9]/unix]:

    Provide the name of kernel to use for booting. Or, press Return to use the default kernel. 

    Enter default directory for modules [/platform/`uname -i`/kernel /platform/`uname -m/kernel /kernel /usr/kernel]:

    Provide an alternate path for the modules directory. Or, press Return to use the default kernel modules directory.

    Name of system file [etc/system]:

    Provide the name of an alternate system file and press Return. Type /dev/null if your /etc/system file has been damaged. 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 network booting.

    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.  

  3. If you are not prompted to answer the questions in the preceding table, verify that you typed the boot -a command correctly.

SPARC: Example—Booting a System Interactively

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


ok boot -a
.
.
.
Rebooting with command: boot -a
Boot device: /pci@1f,0/pci@1,1/ide@3/disk@0,0:a  File and args: -a
Enter filename [kernel/sparcv9/unix]: Press Return
Enter default directory for modules [/platform/SUNW,Ultra-5_10/kernel 
/platform/sun4u/kernel /kernel /usr/kernel]: Press Return
Name of system file [etc/system]: Press Return
SunOS Release 5.9 Version Generic 64-bit
Copyright (c) 1983-2002 by Sun Microsystems, Inc.
root filesystem type [ufs]: Press Return
Enter physical name of root device
[/pci@1f,0/pci@1,1/ide@3/disk@0,0:a]: Press Return
configuring IPv4 interfaces: hme0.
Hostname: starbug
The system is coming up.  Please wait.
checking ufs filesystems
.
.
.
The system is ready.
starbug console login:

SPARC: How to Boot a System From the Network

Any system can boot from the network if there is a boot server available. You might want to boot a standalone system from the network temporarily if the system cannot boot from the local disk. For information on changing or resetting the default boot device, see SPARC: How to Change the Default Boot Device.

Two network configuration boot strategies are available on sun4u systems:

The default network boot strategy is set to RARP. You can use either strategy depending on whether a RARP boot server or a DHCP boot server is available on your network.


Note –

Sun Ultra systems must have PROM version 3.25.nn or later to use the DHCP network boot strategy. For information on finding your PROM version, see SPARC: How to Find the PROM Revision for a System.


If both methods are available, you can specify which service to use in the boot command temporarily. Or, you can save the network boot strategy across system reboots at the PROM level, by setting up an NVRAM alias. The following example uses the nvalias command to set up a network device alias for booting DHCP by default on a Sun Ultra 10 system.


ok nvalias net	 /pci@1f,4000/network@1,1:dhcp

This alias means that when you type boot net, the system boots by using the DHCP network book strategy.


Caution – Caution –

You should not use the nvalias command to modify the NVRAMRC file unless you are very familiar with the syntax of this command and the nvunalias command. For information on using these commands, see the OpenBoot 3.x Command Reference Manual.


  1. If necessary, shut down the system.

  2. Determine the method for booting from the network and select one of the following:

    You must have already set up a RARP or DHCP boot server in your network to use either method to boot successfully.

    1. Boot the system from the network by using the DHCP method.


      ok boot net[:dhcp]

      If you have changed the PROM setting to boot DHCP by default, as in the preceding nvalias example, you only have to specify boot net.

    2. Boot the system from the network by using the RARP method.


      ok boot net[:rarp]

      Since RARP is the default network boot strategy, you only have to specify boot net:rarp if you have changed the PROM value to boot DHCP.

SPARC: How to Stop the System for Recovery Purposes

  1. Type the stop key sequence for your system.

    The monitor displays the ok PROM prompt.


    ok

    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.

  2. Synchronize the file systems.


    ok sync
    
  3. When you see the syncing file systems... message, press the stop key sequence for your system again.

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

    For more information, see boot(1M).

  5. Verify that the system is booted to the specified run level.


    # who -r
     .       run-level 3  May  2 07:39     3      0  S 

SPARC: Example—Stopping the System for Recovery Purposes


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

SPARC: How to Boot a System for Recovery Purposes

Use this procedure when an important file, such as /etc/passwd, has an invalid entry and causes the boot process to fail.

Substitute the device name of the file system to be repaired for the devicename variable in the following procedures. If you need help identifying a system's device names, refer to “Accessing Devices (Overview)” in System Administration Guide: Devices and File Systems.

  1. Stop the system by using the system's stop key sequence.

    Use the stop sequence for your system if you don't know the root password or if you can't log in to the system. For more information, see SPARC: How to Stop the System for Recovery Purposes.

  2. Follow the instructions in the table, depending on whether you are booting from the Solaris installation CD or DVD or from the network.

    Boot Type 

    Action 

    Solaris installation CD or DVD 

    1. Insert the Solaris installation media into the drive. 

    2. Boot from the installation media in single-user mode: 

    ok boot cdrom -s

    The network if an installation server or remote CD or DVD drive are available 

    Use the following command: 

    ok boot net -s

  3. Mount the file system that contains the file with an invalid entry.


    # mount /dev/dsk/device-name /a
    
  4. Change to the newly mounted file system.


    # cd /a/file-system
    
  5. Set the terminal type.


    # TERM=sun
    # export TERM
    
  6. Remove the invalid entry from the file by using an editor.


    # vi filename
    
  7. Change to the root (/) directory.


    # cd /
    
  8. Unmount the /a directory.


    # umount /a
    
  9. Reboot the system.


    # init 6
    
  10. Verify that the system booted to run level 3.

    The login prompt is displayed when the boot process has finished successfully.


    hostname console login:

SPARC: Example—Booting a System for Recovery Purposes (Damaged Password File)

The following example shows how to repair an important system file (in this case, /etc/passwd) after booting from a local CD-ROM.


ok boot cdrom -s
# mount /dev/dsk/c0t3d0s0 /a
# cd /a/etc
# TERM=vt100
# export TERM
# vi passwd
(Remove invalid entry)
# cd /
# umount /a
# init 6

SPARC: Example—Booting a System if You Forgot Root Password

The following example shows how to recover when you forget the root password by booting from the network. This example assumes that the network boot server is already available. Be sure to apply a new root password after the system has rebooted.


ok boot net -s
# mount /dev/dsk/c0t3d0s0 /a
# cd /a/etc
# TERM=vt100
# export TERM
# vi shadow
(Remove root's encrypted password string)
# cd /
# umount /a
# init 6

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

  1. If you need to stop the system, 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 PROM displays the ok prompt.

  2. Synchronize the file systems and write the crash dump.


    > n
    ok sync
    
  3. When you see the syncing file systems... message, press the stop key sequence for your system again.

  4. Boot the system with the kernel debugger.


    ok boot kadb
    
  5. Check kadb boot messages to verify that the system has booted with the kernel debugger.


    Rebooting with command: kadb
    Boot device: /iommu/sbus/espdma@4,800000/esp@4,8800000/sd@3,0
    .
    .
    .

SPARC: Example—Booting the System With the Kernel Debugger (kadb)


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

SPARC: Forcing a Crash Dump and Rebooting the System

Forcing a crash dump and rebooting the system is sometimes necessary for troubleshooting purposes. The savecore feature is enabled by default.

For more information on system crash dumps, see “Managing System Crash Information (Tasks)” in System Administration Guide: Advanced Administration.

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

Use this procedure to force a crash dump and reboot the system when the savecore feature is enabled.

  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 PROM displays the ok prompt.

  2. Synchronize the file systems and write the crash dump.


    > n
    ok sync
    

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

  3. Verify the system boots to run level 3.

    The login prompt is displayed when the boot process has finished successfully.


    hostname console login:

SPARC: Example—Forcing a Crash Dump and Rebooting the System


Press Stop-A
ok sync