Booting a SPARC Based 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 14, Managing Services (Overview).

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 the boot ( 1M ) man page.

  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:

Example 10.3.  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: /pci@1f,0/pci@1,1/ide@3/disk@0,0:a  File and args: kernel/sparcv9/unix
SunOS Release 5.10 Version s10_60 64-bit
Copyright 1983-2004 Sun Microsystems, Inc.  All rights reserved.
Use is subject to license terms.
configuring IPv4 interfaces: hme0.
add net default: gateway 172.20.27.248
Hostname: starlite
The system is coming up.  Please wait.
NIS domain name is example.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 starlite
syslog service starting.The system is ready.
Starting Sun(TM) Web Console Version 2.1-dev..
volume management starting.
The system is ready.
starlite console login: 

In the preceding example, sparcv9 was used as an example only. This string matches the output of the isainfo k command.

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. This run level is used for system maintenance tasks, such as backing up a file system.

  1. Boot the system to run level S.

    ok boot -s
    
  2. Type the superuser password when the following message is displayed:

    SINGLE USER MODE
    
    Root password for system maintenance (control-d to bypass): xxxxxx
    
  3. Verify that the system is at run level S.

    # who -r
    .       run-level S  Jun 10 15:27     3      0 
  4. Perform the maintenance task that required the run level change to S.

  5. After you complete the system maintenance task, type Control-D to bring the system to the multiuser state.

Example 10.4.  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.10
Copyright 1983-2003 Sun Microsystems, Inc.  All rights reserved.
Use is subject to license terms.
configuring IPv4 interfaces: hme0.
Hostname: starlite

SINGLE USER MODE

Root password for system maintenance (control-d to bypass): xxxxxx
single-user privilege assigned to /dev/console.
Entering System Maintenance Mode
Oct 14 15:01:28 su: 'su root' succeeded for root on /dev/console
Sun Microsystems Inc.   SunOS 5.10
# who -r
   .       run-level S  Sep 19 08:49     S      0  ?
(Perform some maintenance task)
# ^D

How to Boot a System Interactively

Use this boot option when you need to specify an alternate kernel or /etc/system file.

  1. Boot the system interactively.

    ok boot -a
    
  2. Answer the following system prompts:

    1. When prompted, enter the name of the kernel to use for booting.

      Press enter to use the default kernel file name. Otherwise, provide the name of an alternate kernel, press Enter.

    2. When prompted, provide an alternate path for the modules directories.

      Press enter to use the default module directories. Otherwise, provide the alternate paths to module directories, press Enter.

    3. When prompted, provide the name of an alternate system file.

      Type /dev/null if your /etc/system file has been damaged.

    4. When prompted, enter the root filesystem type.

      Press enter to select UFS for local disk booting, which is the default, or enter NFS for network booting.

    5. When prompted, enter the physical name of root device.

      Provide an alternate device name or press return to use the default.

  3. If you are not prompted to answer these questions, verify that you typed the boot a command correctly.

Example 10.5.  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.10 Version S10_60 64-bit
Copyright (c) 1983-2004 by Sun Microsystems, Inc. All rights reserved
Use is subject to license terms.
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: starlite
The system is coming up.  Please wait.
checking ufs filesystems
.
.
.
The system is ready.
starlite console login:

How to Boot a System From the Network

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

Two network configuration boot strategies are available on sun–4u systems:

  • RARP – Reverse Address Resolution Protocol and ONC+ RPC Bootparams Protocol

  • DHCP – Dynamic Host Configuration Protocol

The default network boot strategy is set to RARP. You can use either protocol, 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 determining your PROM version, see How to Find the PROM Revision Number for a System.

If both protocols are available, you can temporarily specify which protocol to use in the boot command. 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

As a result, when you type boot net, the system boots by using the DHCP network book strategy.

Note

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.

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

  1. If necessary, shut down the system.

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

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

      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 strategy.

      ok boot net[:rarp]

      Because 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.

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 again.

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

    For more information, see the boot ( 1M ) man page.

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

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

Example 10.6.  Stopping the System for Recovery Purposes

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

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.

Use the stop sequence described in this procedure if you do not know the root password or if you can't log in to the system. For more information, see How to Stop the System for Recovery Purposes.

Substitute the device name of the file system to be repaired for the device-name variable in the following procedure. If you need help identifying a system's device names, refer to Displaying Device Configuration Information in System Administration Guide: Devices and File Systems .

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

  2. Boot the system in single-user mode.

    • Boot the system from the Solaris Software 1 CD or DVD,

      • Insert the Solaris installation media into the drive.

      • Boot from the installation media in single-user mode.

        ok boot cdrom -s
        
    • Boot the system from the network if an installation server or remote CD or DVD drive is not available.

      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:

Example 10.7.  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

Example 10.8.  Booting a System if You Forgot the root Password

The following example shows how to boot the system from the network when you have forgotten the root password. 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

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 Chapter 24, Managing System Crash Information (Tasks), in System Administration Guide: Advanced Administration .

How to Force a Crash Dump and Reboot of the System

Use this procedure to force a crash dump of the system. The example that follows this procedure shows how to use the halt d command to force a crash dump of the system. You will need to manually reboot the system after running this command.

  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:

Example 10.9.  Forcing a Crash Dump and Reboot of the System by Using the halt d Command

This example shows how to force a crash dump and reboot of the system jupiter by using the halt d and boot command. Use this method to force a crash dump and reboot of the system.

# halt -d
Jul 21 14:13:37 jupiter halt: halted by root

panic[cpu0]/thread=30001193b20: forced crash dump initiated at user request

000002a1008f7860 genunix:kadmin+438 (b4, 0, 0, 0, 5, 0)
  %l0-3: 0000000000000000 0000000000000000 0000000000000004 0000000000000004
  %l4-7: 00000000000003cc 0000000000000010 0000000000000004 0000000000000004
000002a1008f7920 genunix:uadmin+110 (5, 0, 0, 6d7000, ff00, 4)
  %l0-3: 0000030002216938 0000000000000000 0000000000000001 0000004237922872
  %l4-7: 000000423791e770 0000000000004102 0000030000449308 0000000000000005

syncing file systems... 1 1 done
dumping to /dev/dsk/c0t0d0s1, offset 107413504, content: kernel
100% done: 5339 pages dumped, compression ratio 2.68, dump succeeded
Program terminated
ok boot
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.

Rebooting with command: boot
Boot device: /pci@1f,0/pci@1,1/ide@3/disk@0,0:a
File and args: kernel/sparcv9/unix
SunOS Release 5.10 Version s10_60 64-bit
Copyright 1983-2004 Sun Microsystems, Inc.  All rights reserved.
Use is subject to license terms.
configuring IPv4 interfaces: hme0.
add net default: gateway 172.20.27.248
Hostname: jupiter
The system is coming up.  Please wait.
NIS domain name is example.com
.
.
.
System dump time: Wed Jul 21 14:13:41 2004
Jul 21 14:15:23 jupiter savecore: saving system crash dump
in /var/crash/jupiter/*.0
Constructing namelist /var/crash/jupiter/unix.0
Constructing corefile /var/crash/jupiter/vmcore.0
100% done: 5339 of 5339 pages saved

Starting Sun(TM) Web Console Version 2.1-dev...
.
.
.

How to Boot the System With the Kernel Debugger (kmdb)

This procedure shows you the basics for loading the kernel debugger (kmdb). For more detailed information, see the Solaris Modular Debugger Guide.

  1. Halt the system, causing it to display the ok prompt.

    To halt the system gracefully, use the /usr/sbin/halt command.

  2. Type either boot kmdb or boot k to request the loading of the kernel debugger. Press return.

  3. Enter the kernel debugger.

    The method used to enter the debugger is dependent upon the type of console that is used to access the system:

    • If a locally attached keyboard is being used, press Stop-A or L1–A, depending upon the type of keyboard.

    • If a serial console is being used, send a break by using the method that is appropriate for the type of serial console that is being used.

    A welcome message is displayed when you enter the kernel debugger for the first time.

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

Example 10.10.  Booting the System With the Kernel Debugger (kmdb)

ok boot kmdb
Resetting...

Executing last command: boot kmdb -d
Boot device: /pci@1f,0/ide@d/disk@0,0:a File and args: kmdb -d
Loading kmdb...