Home > Articles

  • Print
  • + Share This
This chapter is from the book

Summary

This chapter provides a description of the OpenBoot environment, the PROM, NVRAM, and the kernel. It describes how to access OpenBoot and the various commands that are available to test and provide information about the hardware.

This chapter describes the OpenBoot architecture, and it explains how OpenBoot controls many of the hardware devices. By using the programmable user interface available in OpenBoot, you can set several parameters that control system hardware and peripherals.

The device tree and OpenBoot device names are explained in this chapter. Throughout this book, the text refers to various device names used in Solaris. It’s important that you understand each one of them. Along with device names, this chapter explains how to set temporary and permanent device aliases.

The system startup phases are described in this chapter, and you have learned how Solaris processes and services are started, from bootup, to loading and initializing the two-part kernel, to continuing to the multi-user milestone. You can further control these services through the Service Management Facility.

This chapter describes how important it is to shut down the system properly because the integrity of the data can be compromised if the proper shutdown steps are not performed. All the various commands used to shut down a system in an orderly manner are outlined.

Chapter 4, "User and Security Administration," describes how to protect your system and data from unauthorized access.

Key Terms

  • Autoconfiguration
  • Boot
  • Bootblock
  • Bootstrapping
  • Service Contract
  • Dependency
  • Sub-dependencies
  • Device alias
  • Device tree
  • Dynamic kernel
  • Full device name
  • init state
  • Interactive boot
  • Kernel
  • Loadable module
  • Multiuser mode
  • NVRAM
  • OBP
  • OpenBoot
  • POST
  • PROM
  • Reconfiguration boot
  • Run control script
  • Run level
  • Service Management Facility (SMF)
  • Service
  • Service Instance Object
  • Single-user mode
  • ufsboot

Exercises

3.1 Using OpenBoot Commands

In this exercise, you will halt the system and use the OpenBoot commands to set parameters and gather basic information about your system.

Estimated time: 30 minutes

  1. Issue the OpenBoot command to display the banner, as follows:
  2. banner
  3. Set parameters to their default values, as follows:
  4. reset-all
  5. Set the auto-boot? parameter to false to prevent the system from booting automatically after a reset. From the OpenBoot ok prompt, type the following:
  6. setenv auto-boot? false

    Verify that the parameter has been set by typing the following:

    printenv auto-boot?
  7. Display the list of OpenBoot help topics, as follows:
  8. help
  9. Use the banner command to get the following information from your system:
    • ROM revision

      Amount of installed memory

      System type

      System serial number

      Ethernet address

      Host ID

  10. Display the following list of OBP parameters by using the printenv command:
  11. output-device
    input-device
    auto-boot?
    boot-device
  12. Use the following commands to display the list of disk devices attached to your system:
  13. probe-scsi
    probe-scsi-all
    probe-ide

    Explain the main differences between these commands.

  14. List the target number and the device type of each SCSI device attached to your system by using the OpenBoot commands in step 7.
  15. From the OpenBoot prompt, identify your default boot device as follows:
  16. printenv boot-device
  17. Use the show-disks OpenBoot command to get a listing of the disk drives on your system, as follows:
  18. show-disks
  19. Create a permanent device alias named bootdisk that points to the IDE master disk, as follows:
  20. nvalias bootdisk /pci@1f,0/pci@1,1/ide@3/disk@0,0

    You'll need to select a SCSI disk if your system does not have IDE disks attached to it.

  21. Reset the system and verify that the device alias is set properly by typing the following:
  22. reset-all

    After the system resets, type the following:

    devalias bootdisk
  23. Now, set the system up so that it boots into single-user mode without any user intervention:
  24. setenv boot-command 'boot -s'
  25. I suggest changing the auto-boot? parameter back to true and resetting the system to validate that your boot-command parameter is set properly as follows:
  26. setenv auto-boot? true
    reset-all
  27. Boot the system, log on as root, and use the eeprom command to list all NVRAM parameters.
  28. Use the eeprom command to list only the setting of the boot-device parameter, as follows:
  29. eeprom boot-device
  30. Reset boot-device to its default parameter from the OpenBoot prompt, as follows:
  31. set-default boot-device
  32. From the OpenBoot prompt, remove the alias bootdisk, as follows:
  33. nvunalias bootdisk
  34. Reset the system and verify that bootdisk is no longer set, as follows:
  35. reset-all
    printenv
  36. Set all the OpenBoot parameters back to their default values, as follows:
  37. set-defaults

3.2 Booting the System

This exercise takes you through the steps of powering on and booting the system.

Estimated time: 5 minutes

  1. Turn on power to all the peripheral devices, if any exist.
  2. If the OpenBoot parameter auto-boot is set to false, you should see the ok prompt shortly after you power on the system. If the system is set to auto-boot, you should see a message similar to the following displayed onscreen:
  3. SunOS Release 5.10 Version Generic 64-bit
    Copyright 1983-2005 Sun Microsystems, Inc. All rights reserved.
    Use is subject to license terms.

    You should see the system begin the boot process. Interrupt the boot process by pressing Stop+A. The ok prompt appears.

  4. At the ok prompt, type boot to boot the system.

3.3 Booting an Alternate Kernel

In this exercise, you'll practice booting from a backup copy of the /etc/system file. You should use this process if your /etc/system file ever becomes corrupt or unbootable.

Estimated time: 15 minutes

  1. Log in as root.
  2. Create a backup copy of the /etc/system file by typing this:
  3. cp /etc/system /etc/system.orig
  4. Now remove the /etc/system file by typing this:
  5. rm /etc/system
  6. Halt the system by typing this:
  7. /usr/sbin/shutdown -y -g0 -i0
  8. At the ok prompt, boot the system by using the interactive option to supply the backup name of the /etc/system file. You do that by typing this:
  9. boot -a
  10. You are prompted to enter a filename for the kernel and a default directory for modules. Press Return to answer each of these questions. When you are prompted with this message to use the default /etc/system file
  11. Name of system file [etc/system]: 

    enter the following:

    /etc/system.orig
  12. Later you'll be asked to enter the root file system type and the physical name of the root device. At that point, press Return to answer both questions.
  13. When the system is ready, log in as root and put the original /etc/system file back in place:
  14. cp /etc/system.orig/etc/system

Review Questions

  1. The hardware-level user interface that you see before the operating system has been started is called what?
    1. OpenBoot
    2. EEPROM
    3. Firmware
    4. Boot PROM
  2. Which of the following is where the system identification information, such as the hostid, is stored?
    1. Firmware
    2. OpenBoot
    3. NVRAM
    4. Kernel
  3. What tasks are performed by OpenBoot? (Select the two best answers.)
    1. Executing POST
    2. Loading bootblk
    3. Executing ufsboot
    4. Loading the operating system kernel
  4. Which of the following is not a task of the OpenBoot firmware?
    1. Testing and initializing the system hardware
    2. Loading the kernel
    3. Starting up the operating system from either a mass storage device or from a network
    4. Allowing modification and management of system startup configuration, such as NVRAM parameters
  5. Which of the following is attached to a host computer through a hierarchy of interconnected buses on the device tree?
    1. SBus cards
    2. SCSI peripherals
    3. Plug-in device drivers
    4. Nodes
  6. What is /pci@1f,0/pci@1,1/ide@3/disk@0,0?
    1. Full device pathname
    2. Physical device
    3. Logical device
    4. Instance
  7. Which of the following is used to obtain information about devices and to display device pathnames in OpenBoot?
    1. show-devs
    2. dmesg
    3. pwd
    4. sysdef
  8. Which of the following commands creates a temporary device alias named bootdisk?
    1. setenv bootdisk /pci@1f,0/pci@1,1/ide@3/disk@0,0
    2. set bootdisk /pci@1f,0/pci@1,1/ide@3/disk@0,0
    3. nvalias bootdisk /pci@1f,0/pci@1,1/ide@3/disk@0,0
    4. devalias bootdisk /pci@1f,0/pci@1,1/ide@3/disk@0,0
  9. If you want to create permanent aliases in NVRAM (that show up after a reboot), which of the following commands should you use?
    1. devalias
    2. nvalias
    3. setenv
    4. eeprom
  10. Which NVRAM variable specifies the device from which to start up?
    1. boot-device
    2. boot-file
    3. output-device
    4. input-device
  11. If a system will not start due to a bad NVRAM variable, which of the following, performed before you see the OpenBoot prompt, resets the NVRAM variables to their default settings?
    1. set-default <variable>
    2. Stop+N
    3. set-defaults
    4. Ctrl+N
  12. Which of the following can restrict the set of operations that users are allowed to perform at the OpenBoot prompt?
    1. security-password
    2. security-mode
    3. set-secure
    4. set-security
  13. Which of the following is used in OpenBoot to test all devices that have built-in self-test methods below the specified device tree node?
    1. diag
    2. probe-scsi
    3. test-all
    4. test
  14. Which option do you use with the OpenBoot boot command so that you are prompted for the name of the standalone program to load?
    1. -v
    2. -f
    3. -s
    4. -a
  15. What resides in blocks 1–15 of the startup device?
    1. bootblk
    2. superblock
    3. kernel
    4. ufsboot
  16. Which of the following loads the operating system kernel?
    1. ufsboot
    2. openBoot
    3. bootblk
    4. init
  17. Which of the following commands lists all hardware devices, system devices, loadable modules, and the values of selected kernel tunable parameters?
    1. more /var/adm/messages
    2. adb
    3. dmesg
    4. sysdef
  18. What key combination would you enter to interrupt a system that is not responding?
    1. Ctrl+B
    2. Ctrl+C
    3. Stop+A
    4. Ctrl+Alt+Delete
    5. m E. Ctrl+Break
  19. What is the function of the auto-boot parameter that is set in the OpenBoot PROM?
    1. Boots automatically after power-on or reset
    2. Sets the default boot device
    3. Reboots after a watchdog reset
    4. Automatically performs a system reboot when a system core file has been generated
  20. Which of the following commands is used to set the auto-boot parameter?
    1. setenv auto-boot?=false
    2. set auto-boot=false
    3. eeprom auto-boot?=false
    4. nvset
  21. To display all OpenBoot parameter settings, such as boot-device and ttya-mode, what should you type?
    1. nvalias
    2. devalias
    3. printenv
    4. show all
  22. To check the target IDs on all the SCSI devices connected to all the SCSI controllers, what should you type?
    1. test-all
    2. probe-scsi
    3. probe-scsi-all
    4. test-scsi
  23. The kernel reads which of the following files when loading? (This is where system configuration information is stored.)
    1. /etc/system
    2. kernel/sparcv9/unix
    3. /etc/inittab
    4. /kernel/unix
  24. Select the sequence of events that best describes the boot process.
    1. Boot PROM phase, boot program phase, kernel initialization phase, init phase, and svc.startd phase
    2. Boot program phase, boot PROM phase, kernel initialization phase, svc.startd phase, and init phase
    3. Boot program phase, boot PROM phase, init phase, kernel initialization phase, svc.startd phase
    4. Boot PROM phase, boot program phase, svc.startd phase, kernel initialization phase
  25. What consists of a small static core and many dynamically loadable modules?
    1. The kernel
    2. ufsboot
    3. The shell
    4. The bootblock
  26. After reading the /etc/inittab file, which daemon does the init process startup?
    1. sched
    2. /sbin/rc1
    3. ufsboot
    4. svc.startd
  27. How can system messages displayed at bootup be viewed later?
    1. By issuing the dmesg command
    2. By viewing the /var/adm/messages file
    3. By issuing the sysdef command
    4. By viewing logs in the /var/svc/log directory
  28. To boot a system into a single-user state, which commands are entered at the ok prompt?
    1. boot
    2. boot -s
    3. boot -a
    4. boot -m milestone=single-user
  29. Which command, typed at the ok prompt, stops and asks for boot information during the boot process?
    1. boot -i
    2. boot -a
    3. boot -v
    4. boot -s
  30. Which of the following programs is responsible for executing ufsboot?
    1. bootblk
    2. kernel
    3. init
    4. boot
  31. What command do you use to change run levels?
    1. run
    2. init
    3. kill
    4. su
  32. This XML-based file contains a complete set of properties that are associated with a SMF service or a service instance. Where are these files stored?
    1. /var/svc/method
    2. /lib/svc/method
    3. /var/svc/manifest
    4. /var/svc/profile
  33. Which command is used to transition your system into the single-user milestone from the multi-user milestone?
    1. svcadm milestone single-user
    2. svcadm milestone/single-user
    3. init -s
    4. init single-user
  34. Which of the following is NOT the valid FMRI name of a service instance?
    1. svc://localhost/network/inetd:default
    2. lrc:/etc/rc3_d/S90samba
    3. network/inetd:default
    4. svc:/inetd:default
  35. Which command is used to obtain a detailed view of the service state of all service instances in the configuration repository?
    1. inetadm -a
    2. svcs -a
    3. svcadm -a
    4. svcprop -l
  36. Which of the following service states indicates that the service is configured to run, but is not yet running or available to run?
    1. offline
    2. maintenance
    3. disabled
    4. degraded
  37. Which SMF command displays the services that must be running before the multi-user milestone is reached?
    1. svcs -d milestone/multi-user
    2. svcs -D milestone/multi-user
    3. svcs -p milestone/multi-user
    4. svcs -l milestone/multi-user

Answers to Review Questions

  1. A. The hardware-level user interface that you see before the operating system starts is called the OpenBoot PROM (OBP). For more information, see the section "The OpenBoot Environment."
  2. C. Non-Volatile RAM (NVRAM) is where the system identification information—such as the host ID, Ethernet address, and TOD clock—is stored. For more information, see the section "The OpenBoot Environment."
  3. A, B. The two primary tasks of the OpenBoot firmware are to run the POST and to load the bootblock. For more information, see the section "The OpenBoot Environment."
  4. B. OpenBoot runs POSTs to initialize the system hardware. It also loads the primary startup program, bootblk, from the default startup device. The bootblk program finds and executes the secondary startup program, ufsboot, and loads it into memory. From that point, the ufsboot program loads the operating system kernel. For more information, see the section "The OpenBoot Environment."
  5. D. Devices called nodes are attached to a host computer through a hierarchy of interconnected buses on the device tree. A node that represents the host computer's main physical address bus forms the tree's root node. For more information, see the section "The OpenBoot Architecture."
  6. A. A full device pathname is a series of node names separated by slashes (/). The root of the tree is the machine node, which is not named explicitly but is indicated by a leading slash. Each device pathname has this form:
  7. driver-name@unit-address:device-arguments

    For more information, see the section "PROM Device Tree (Full Device Pathnames)."

  8. A. The OpenBoot command show-devs is used to obtain information about devices and to display device pathnames. For more information, see the section "PROM Device Tree (Full Device Pathnames)."
  9. D. You use the devalias command as follows to create a temporary device alias named bootdisk:
  10. devalias bootdisk /pci@1f,0/pci@1,1/ide@3/disk@0,0

    For more information, see the section "OpenBoot Device Aliases."

  11. B. or D. You use the nvalias command from the OpenBoot PROM or the eeprom command from the Unix prompt to create a permanent alias in NVRAM that remains in effect even after a reboot. For more information, see the section "OpenBoot Device Aliases."
  12. A. The NVRAM variable named boot-device contains the name of the default startup device. For more information, see the section "Booting a System."
  13. B. To reset the NVRAM variables to their default settings, you hold down the Stop+N keys simultaneously while the machine is powering up. For more information, see the section "OpenBoot NVRAM."
  14. B. The OpenBoot command security-mode restricts the set of operations that users are allowed to perform at the OpenBoot prompt. For more information, see the section "OpenBoot Security."
  15. C. The OpenBoot command test-all tests all devices that have built-in self-test methods below the specified device tree node. For more information, see the section "OpenBoot Diagnostics."
  16. D. You issue the OpenBoot boot command with the -a option to be prompted for the name of the standalone program to load. For more information, see the section "The boot Command."
  17. A. The bootblock resides in blocks 1–15 of the startup device. For more information, see the section "The boot Command."
  18. A. The secondary startup program, ufsboot, loads the two-part operating system kernel. For more information, see the section "Booting a System."
  19. D. You use the sysdef command to list all hardware devices, system devices, and loadable modules, as well as the values of selected kernel tunable parameters. For more information, see the section "The Kernel."
  20. C. You interrupt a system that is not responding by pressing Stop+A. For more information, see the section "Stopping the System for Recovery Purposes."
  21. A. 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. For more information, see the section "OpenBoot NVRAM."
  22. C. eeprom auto-boot?=false is used to set the auto-boot? parameter from the Unix shell. Option A is wrong because the "=" sign should not be used with the setenv command. Option B is wrong because there is not a set command at the OpenBoot prompt, and using set from the Unix shell will not set an OpenBoot parameter. Option D is wrong because there is not an nvset command. For more information, see the section "OpenBoot NVRAM."
  23. C. At the OpenBoot prompt, you use the printenv command to display all OpenBoot parameter settings. For more information, see the section "OpenBoot NVRAM."
  24. C. You use the probe-scsi-all command to check the target IDs on all the SCSI devices that are connected to all the SCSI controllers. For more information, see the section "OpenBoot Diagnostics."
  25. A. When the kernel is loading, it reads the /etc/system file, where system configuration information is stored. This file modifies the kernel's parameters and treatment of loadable modules. For more information, see the section "The Kernel."
  26. A. The boot process goes through the following five phases: boot PROM phase, boot programs phase, kernel initialization phase, init phase, and svc.startd phase. For more information, see the section "Booting a System."
  27. A. The kernel consists of a two-piece static core that is made up of genunix and unix. genunix is the platform-independent generic kernel file, and unix is the platform-specific kernel file. When the system boots, ufsboot combines these two files and many dynamically loadable modules into memory to form the running kernel. For more information, see the section "The Kernel."
  28. D. The init process reads the /etc/inittab file and executes any process entries that have sysinit in the action field, so that any special initializations can take place before users log in. After reading the /etc/inittab file, init starts the svc.startd daemon, which is responsible for starting and stopping other system services such as mounting file systems and configuring network devices. In addition, svc.startd will execute legacy run control (rc) scripts. For more information, see the section "The init Phase."
  29. B. The boot process creates fewer messages. All of the information that was provided by the boot messages in previous versions of Solaris is now located in the /var/svc/log directory. For more information, see the section "The Solaris Management Facility (SMF) Service."
  30. B, D. You issue the boot -s command or the boot -m milestone=single-user at the OpenBoot ok prompt to boot the system into single-user mode. For more information, see the section "Booting a System." You can also boot to a specific milestone using the boot -m command.
  31. B. The boot -a command performs an interactive boot. With this option, you are prompted to enter the name of the kernel, the default modules directory, the name of the system file, the root file system type, and the device name for the root device. For more information, see the section "Booting a System."
  32. A. The bootblk program finds and executes the secondary boot program, called ufsboot, from the UFS and loads it into memory. For more information, see the section "Booting a System."
  33. B. You use the init command to change run levels. For more information, see the section "System Run States."
  34. C. An SMF manifest is an XML (Extensible Markup Language) file that contains a complete set of properties that are associated with a service or a service instance. The properties are stored in files and subdirectories located in /var/svc/manifest. For more information, see the section "The Solaris Management Facility (SMF) Service."
  35. A. Use the svcadm milestone single-user command to switch into the single-user milestone. For more information, see the section "Starting Services During Boot."
  36. D. A valid FMRI instance names take the form of:
  37. svc://localhost/network/inetd:default 
    svc:/network/inetd:default
    network/inetd:default

    svc:/inetd:default does not contain the service category name.

    lrc:/etc/rc3_d/S90samba is an FMRI for a legacy run control script not managed by SMF.

    For more information, see the section "The Solaris Management Facility (SMF) Service."

  38. B. Running the svcs command without options will display the status of all enabled services. Use the -a option to list all services, including disabled services. For more information, see the section "SMF Command-line Administration Utilities."
  39. A. The offline status indicates that a service instance is enabled (configured to run), but the service is not yet running or available to run. A disabled service is configured not to start. For more information, see the section "SMF Command-line Administration Utilities."
  40. A. The -d option for the svcs command lists the services or service instances upon which the multi-user service instance is dependent on. For more information, see the section "SMF Command-line Administration Utilities."
  • + Share This
  • 🔖 Save To Your Account