Certification Objective 5.03Listing and Reconfiguring Devices


Certification Objective 5.03—Listing and Reconfiguring Devices

Exam Objective 2.3: Use the prtconf and format commands to list devices, explain critical issues of the /etc/path_to_inst file, and reconfigure devices by performing a reconfiguration boot or using the devfsadm command for SPARC, x64, and x86-based systems.

As a system administrator, you will need to know the list of devices that the system recognizes. While the system is up and running, you may need to add a new device to the system and configure it. We explore these issues in this section.

Listing Devices

The commands listed in Table 5-5 display the information about system and device configuration, and their output includes the device names.

Table 5-5: Commands that generate the output that includes a list of devices

Command

Displays

dmesg

A list of devices attached to the system since last reboot along with system diagnostic messages.

format

The product name, vendor name, and revision level of the current disk, if the inquiry option of the format menu is selected.

prtconf

System configuration information that includes total amount of memory and the device configuration information from, the system's device hierarchy.

sysdef

Device configuration information that includes loadable modules, pseudo devices, selected kernel parameters, and system hardware.

The prtconf command displays the system configuration information including the device configuration information, and its syntax is as follows:

    /usr/sbin/prtconf [<options>] [<devPath>] 

If <devPath> is specified, the command will display information only about this device. Some common options for both SPARC and x86 are listed here:

  • -a. Display all the ancestor nodes of the device specified by <devPath> up to the root node of the device tree.

  • -c. Display the device subtree whose root is the device specified by <devPath>.

  • -v. Verbose mode.

  • -V. Display version information about PROM (for SPARC) or booting system (for x86).

  • -x. Report whether the firmware on this system is 64-bit ready.

Note that the prtconf command offers a great deal of flexibility. You can get information about just: one device or about a subtree of devices. If you issue the command without any option or argument, it will display information about all the devices attached to the system. For example, on a SPARC-based system the prtconf command will generate an output like the following:

    # prtconf    System Configuration: Sun Microsystems sun4u    Memory size: 512 Megabytes    System Peripherals (Software Nodes):    SUNW,Sun-Blade-1000    scsi_vhci, instance #0    packages (driver not attached)    SUNW,builtin-drivers (driver not attached)    deblocker (driver not attached)    disk-label (driver not attached)    terminal-emulator (driver not attached)    obp-tftp (driver not attached)    dropins (driver not attached)    kbd-translator (driver not attached)    ufs-file-system (driver not attached)    chosen (driver not attached)    openprom (driver not attached)    client-services (driver not attached)    options, instance #0    aliases (driver not attached)    memory (driver not attached)    virtual-memory (driver not attached)    SUNW,UltraSPARC-III, instance #0    memory-controller, instance #0    SUNW,UltraSPARC-III, instance #1    memory-controller, instance #1    pci, instance #0    ebus, instance #0 

The output is truncated.

On the Job 

The "driver not attached" message displayed by the prtconf command does not necessarily mean that the driver is not available for this device; it means that the driver is not currently attached to the device instance because the device is not in use. The driver is loaded automatically when a device is accessed, and unloaded when the device is no longer in use.

You can use a number of commands such as dmesg, prtconf, and sysdef to get information about devices attached to the system. The dmesg command displays the mapping between the physical device names and the instance names. Of course, you can see the mapping by displaying the content of the /etc/path_to_inst file as well—for example, by issuing the following command:

    less /etc/path_to_inst 

However, take extra precautions while handling the path_to_inst file, because the system uses this file in a very important way.

Issues with the path_to_inst File

As you already know from a previous section, the instance names, which are the abbreviations used by the kernel for referring to the devices, are mapped to physical device names in the /etc/path_to_inst file. Once an instance name has been assigned to a device, the system records the mapping in the /etc/path_to_inst file in order to stay consistent across reboots.

The system counts on this file to find the root, usr, and swap devices; it cannot start up without it. In other words, do not remove the /etc/path_to_inst file and make changes to it unless you've thought through those changes. In general, you will not need to make changes to this file, because the file is maintained by the system.

If due to a problem with the /etc/path_to_inst file you cannot start the system from the startup disk, remember that the CD-ROM still has the /etc/path_to_inst file. You can perform the following steps:

  • Start up from the CD-ROM by using the boot -sw cdrom at the OpenBoot prompt.

  • Mount the root file system from the startup disk on /a.

  • Copy the /etc/path_to_inst contained on the CD-ROM to /a/etc/path_to_inst on the startup disk.

  • Start with the startup disk.

Now you know how to find information about the devices currently attached to the system. What if you add a new device when the system is up and running? What would you need to do so that the system can recognize the newly added device? Let's explore this issue next.

Exercise 5-1: Displaying Information on Devices Attached to the Solaris System

image from book
  1. Determine the mapping between the instance names and the physical device names by issuing the following command:

        dmesg 

  2. If the output is too long and it quickly rolls over, you can browse the output by issuing the command in the following way:

        demesg | more 

    Browse the output page by page by pressing the space bar.

  3. Determine the mapping between the instance device names and the physical device names from the output. The mapping entries for the devices will be similar to the following:

        simba0 is /pci@lf,0/pci@l,1 

  4. Now, use the prtconf command to see how much memory is installed on your Solaris system:

        prtconf | grep Memory 

    The output will look like the following:

        Memory size: 128 Megabytes 

image from book

Reconfiguring Devices

In the earlier versions of Solaris, you had to reboot the system in order to recognize the devices newly added to the system. The devfsadm command eliminates the need for reboot in order to discover new devices.

The devfsadm command manages the device files in the /dev and /devices directories. This command, by default, attempts to load all drivers in the system and attach to all possible device instances. Subsequently, devfsadm creates the device files in the /devices directory and also creates links in the /dev directory that point to the files in the /devices directory. Furthermore, the devfsadm command maintains another device-related file, the /etc/path_to_inst file. The syntax for this command is as follows:

    /usr/sbin/devfsadm [<options>] 

Some common options are described here:

  • -c <deviceClass>. Restrict operation to devices of the class specified by <deviceClass> with acceptable values: disk, tape, port, audio, and pseudo.

  • -C. Cleanup mode. Cleanup dangling /dev links.

  • -i <driverName>. Load only the driver specified by <driverName>, and configure the devices only for this driver.

  • -n. Do not attempt to load drivers or add new nodes to the device tree.

  • -s. Suppress reporting any changes to /dev.

  • -v. Display changes to /dev in verbose mode. Use this option if you need more information for troubleshooting purpose.

If you want to specify more than one class of device, you will need to repeat the -c option as shown here:

    devfsadm -c disk -c audio 

You format and partition a disk so that the file systems can reside in partitions. After creating a file system in a partition, you make it available to users by mounting it, which we explore next.




Sun Certified System Administrator for Solaris 10 Study Guide Exams 310-XXX & 310-XXX
Sun Certified System Administrator for Solaris 10 Study Guide Exams 310-XXX & 310-XXX
ISBN: N/A
EAN: N/A
Year: 2005
Pages: 168

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net