Solaris 10 System Administration Part I

From Got Opinion Wiki
Jump to navigation Jump to search

My Solaris 10 System Administration Part I notes.

Credits

My main source of information came from Oracle System Administration of Solaris 10 Part I from Oracle University (excellent training) & Solaris 10 man pages.

Solaris 10 OS Directory Hierarchy

File systems

Unix File System (UFS) is the default file system

Directory starts with root directory (/)

Solaris 10 OS includes alternate file system called zettabyte file system (ZFS)

Logically all directories fall below root directory (/)

Physically directories can be located on one or spread over multiple file systems

<insert graphics to show this>

Refer to filesystem man page for more information on file system organization.

$ man -s 5 filesystem

Important directories

Directory Notes
/ root of file system
/bin symbolic link to /usr/bin & location for binary files of standard system commands
/dev primary directory for logical device names & contents of directory are symbolic links to device files in /devices directory
/etc directory holds host-specific config files & databases for system administration
/export default directory for commonly shared file systems (like user home directories)
/home default directory or mount point for user home directories
/kernel
/lib
/mnt
/opt
/platform
/sbin
/usr
/var

Important in-memory system directories

/dev/fd
/devices
/etc/mnttab
/etc/svc/volatile
/proc
/system/contract
/system/object
/tmp directory for temporary files (cleared during boot sequence)
/var/run

Subdirectories of note under /dev

/dev/dsk block disk devices
/dev/fd file descriptors
/dev/md logical volume management metadisk drives
/dev/pts pseudo terminal devices
/dev/rdsk raw disk devices
/dev/rmt raw magnetic devices
/dev/term serial devices

Important subdirectories under /etc

/etc/acct config info for accounting system
/etc/cron.d config info for cron utility
/etc/default default info for various programs
/etc/inet config files for network services
/etc/init.d scripts for starting & stopping services
/etc/lib
/etc/lp config info for printer subsystem
/etc/mail config info for mail subsystem
/etc/nfs config file for NFS server logging
/etc/opt config info for optional packages
/etc/rc#.d legacy scripts that are executed when entering or leaving a specific run level
/etc/security controls files for Role Based Access Control & security privileges
/etc/skel default shell initialization files for new users
/etc/svc Service Management Facility database & log files

Important subdirectories of /usr

/usr/bin standard system commands
/usr/ccs C-compilation programs & libraries
/usr/demo demo programs & data
/usr/dt Java Desktop System (JDS) software directory or mount point
/usr/include Header files
/usr/jdk directory contains Java technology programs & libraries
/usr/kernel loadable kernel modules not generally required during boot process
/usr/lib architecture-dependent databases, libraries, & binaries that are not invoked directly by user
/usr/opt config info for optional packages
/usr/sbin sys admin coomands
/usr/spool symbolic link to /var/spool directory

Important subdirectories of /var

/var/adm log files for syslog, system accounting, etc
/var/crash crash dump storage
/var/spool spool files storage
/var/svc Service Management Facility control files and logs
/var/tmp long term storage of temp files (survives reboot)

File components

Generally a file name is associated with an inode & an inode provides access to data blocks.

<insert figure of relationship>

file names

File names are objects frequently used to manage files. A file must have a name that is associated with an inode.

inodes

Inodes are objects that Solaris OS uses to maintain info about a file. In general an inode contains:

  1. file info = file owner, permissions, & size
  2. pointers to data blocks associated with file content

inodes are numbered & each file system contains its own inode list

At UFS creation a new inode list is created

data blocks

data blocks are units of disk space that store data

Regular files, directories, & symbolic links make use of data blocks

Device files do not hold data therefore do not use data blocks

ZFS uses the following data structures: dnode data structure: the data structure contains pointers to data blocks znode data structure: this data structure contains info about file (owner, permissions, & size)

Dnode & znode data structures are called metadata & stored dynamically by ZFS. ZFS implements ZFS POSIX layer (ZPL) which is a primary interface for ZFS. ZPL allows commands you use with UFS to work with ZFS. ZFS emulates UFS inode number mechanism

Identifying file types

Solaris has four main file types:

regular or ordinary files store one or more types of data
directories store one or more types of data
symbolic links store one or more types of data
device files does not store data

Use ls command with -l option to distinguish different file types

The first character of each line indicates file type

<insert image of ls -l output with dictionary>

- regular files
d directories
l symbolic links
b block-special device files
c character-special device files

Examples on v240:

# cd /etc
# ls -l
total 650
lrwxrwxrwx   1 root     root          14 May  3 15:34 TIMEZONE -> ./default/init
drwxr-xr-x   6 root     other        512 May  3 16:15 X11
drwxr-xr-x   2 adm      adm          512 May  3 16:19 acct
-rw-r--r--   1 root     sys          253 Aug  6  2010 aggregation.conf
lrwxrwxrwx   1 root     root          14 May  3 16:03 aliases -> ./mail/aliases
drwxr-xr-x   7 root     bin          512 May  3 16:11 apache
drwxr-xr-x   2 root     bin          512 May  3 15:54 apache2
*****output truncated*****
# pwd
/devices/pci@1c,600000/scsi@2
# ls -l
total 8
drwxr-xr-x   2 root     sys          512 May  3 16:25 sd@0,0
brw-r-----   1 root     sys       32,  0 Jul  7 13:54 sd@0,0:a
crw-r-----   1 root     sys       32,  0 Jul 14 16:50 sd@0,0:a,raw

directories

directories only store information on file name to inode number relationships


A directory contains data for files that are logically located within directory

Regular files

Most common file types found in Solaris are regular files. Regular files can store different types of data including ASCII text or binary data.

Symbolic links

a symbolic link is a file that points to another file & contain only one type of data

a symbolic link contains the path name of the file to which it points & the file can be located on other file systems

the size of a symbolic link always matches the number of characters in the path name it contains

Example:

after the '->' there are 19 characters & the 19 before May is the file size.

# ls -l /etc/prtvtoc
lrwxrwxrwx   1 root     root          19 May  3 15:34 prtvtoc -> ../usr/sbin/prtvtoc

symbolic links can point to regular files, directories, other symbolic links, & device files.

symbolic links can be absolute or relative path names

ln command

ln command with -s option creates a symbolic link

<insert example of creating symbolic link>

<insert picture of relationship between link & file>

device files

device file provides access to a device

When using long listing on file the size field is populated by two numbers separated by comma

The two numbers are called major & minor device numbers

major device # identifies the specific device driver required to access device minor device # identifies specific unit of the type that the device driver controls

Long listing:

bash-3.00$ ls -l | grep pci
drwxr-xr-x   4 root     sys          512 May  3 16:25 pci@1c,600000
crw-------   1 root     sys      109, 767 Jul 14 16:50 pci@1c,600000:devctl
crw-------   1 root     sys      109, 764 Jul 14 16:50 pci@1c,600000:intr
crw-------   1 root     sys      109, 765 Jul 14 16:50 pci@1c,600000:reg
drwxr-xr-x   5 root     sys          512 May  3 16:25 pci@1d,700000
crw-------   1 root     sys      109, 1023 Jul 14 16:50 pci@1d,700000:devctl
crw-------   1 root     sys      109, 1020 Jul 14 16:50 pci@1d,700000:intr
crw-------   1 root     sys      109, 1021 Jul 14 16:50 pci@1d,700000:reg
drwxr-xr-x   6 root     sys          512 May  3 16:25 pci@1e,600000
crw-------   1 root     sys      109, 511 Jul 14 16:50 pci@1e,600000:devctl
crw-------   1 root     sys      109, 508 Jul 14 16:50 pci@1e,600000:intr
crw-------   1 root     sys      109, 509 Jul 14 16:50 pci@1e,600000:reg
drwxr-xr-x   4 root     sys          512 May  3 16:25 pci@1f,700000
crw-------   1 root     sys      109, 255 Jul 14 16:50 pci@1f,700000:devctl
crw-------   1 root     sys      109, 252 Jul 14 16:50 pci@1f,700000:intr
crw-------   1 root     sys      109, 253 Jul 14 16:50 pci@1f,700000:reg

File pci@1c,600000:devctl refers to major device # 109 & minor device # 767

You can also use the file command:

bash-3.00$ file pci@1c,600000:devctl
pci@1c,600000:devctl:   character special (109/767)

Use devfsadm command to create new device files

A relationship exists between device file & device it controls. Major & minor device #s contained in inode establish relationship

<image showing relationship from above example>

Verify device driver is available as kernel module:

bash-3.00# modinfo -w | grep -w scsi
 22  1313a40  122a8   -   1  scsi (SCSI Bus Utility Routines)
bash-3.00# modinfo -c | grep -w scsi
 22          1 scsi                             LOADED/INSTALLED
bash-3.00# modinfo -w | grep -w iscsi            
 96 7b600000  328c8 279   1  iscsi (Sun iSCSI Initiator v20100714-0)
bash-3.00# modinfo -c | grep -w iscsi
 96          1 iscsi                            LOADED/INSTALLED

device files are categorized as character-special [character or raw devices] or block-special devices [block devices]

device files in each category interact with devices differently

character-special device files

File type of "c" is character-special device file & data is accessed as a data stream

crw-------   1 root     sys      109, 767 Jul 14 16:50 pci@1c,600000:devctl

Result of file command:

bash-3.00# file pci@1c,600000:devctl
pci@1c,600000:devctl:   character special (109/767)
block-special device files

File type of "b" is a block-special device file & for disk devices, block-special device files call for I/O operations based on a defined block size

Block size depends on particular device file

<example of long listing of block file>

data transferred between process & block-special device is first stored in kernel-managed memory-based cache

block devices allow random seeks to be performed [character devices do not]

hard links

hard link is association between file name & an inode

inode keeps count # of file names associated with it (hard links)

output of long listing will show link count or total # of hard links to a file

bash-3.00# ls -l mnttab
-r--r--r--   5 root     root        1539 Jul  7 13:55 mnttab

/etc/mnttab file has 5 link counts or hard links [between file permissions & owner]

creating new hard links

ln command creates new hard links to regular files

$ ln file5 file6
$ ln file5 file7
$ ln file7 file8
$ ls -il
total 64868
        54 -rw-------   1 paul     labnet    555969 May  6 13:52 file.7z
        55 -rw-r--r--   1 paul     labnet        53 May  6 13:23 file1.gz
        39 -rw-r--r--   1 paul     labnet    739704 May  6 13:42 file2.gz
        41 -rw-r--r--   1 paul     labnet         0 May  5 12:35 file3
        50 -rw-r--r--   1 paul     labnet   3976616 May  6 13:37 file4
        52 -rw-r--r--   4 paul     labnet   3976541 May  6 13:43 file5
        52 -rw-r--r--   4 paul     labnet   3976541 May  6 13:43 file6
        52 -rw-r--r--   4 paul     labnet   3976541 May  6 13:43 file7
        52 -rw-r--r--   4 paul     labnet   3976541 May  6 13:43 file8
        53 -rw-r--r--   1 paul     labnet   11934208 May  6 13:48 filetar.tar
        42 drwxr-xr-x   2 paul     labnet       512 May  5 12:45 subdir1
$

The ln command created files 6-8. Now files 5-8 refer to same inode [52]. Notice link count is now 4 for each of the files. You must use -i option with ls command to view inodes

Use find command with -inum option to find files with same inode

$ find . -inum 52
./file6
./file7
./file5
./file8

<insert image showing file name to inode association>

deleting hard links

delete files normally & link count will decrease automatically

$ rm file8
$ ls -li
total 57076
        54 -rw-------   1 paul     labnet    555969 May  6 13:52 file.7z
        55 -rw-r--r--   1 paul     labnet        53 May  6 13:23 file1.gz
        39 -rw-r--r--   1 paul     labnet    739704 May  6 13:42 file2.gz
        41 -rw-r--r--   1 paul     labnet         0 May  5 12:35 file3
        50 -rw-r--r--   1 paul     labnet   3976616 May  6 13:37 file4
        52 -rw-r--r--   3 paul     labnet   3976541 May  6 13:43 file5
        52 -rw-r--r--   3 paul     labnet   3976541 May  6 13:43 file6
        52 -rw-r--r--   3 paul     labnet   3976541 May  6 13:43 file7
        53 -rw-r--r--   1 paul     labnet   11934208 May  6 13:48 filetar.tar
        42 drwxr-xr-x   2 paul     labnet       512 May  5 12:45 subdir1
$

Once all files with same inode are deleted the inode will be deleted

Examples

Find files that match inode on same file system

# ls -l /etc/init.d/apache
-rwxr--r--   6 root     sys         2452 Jun 23  2010 /etc/init.d/apache

/etc/init.d/apache file has a 6 link count

# ls -i /etc/init.d/apache
      2955 /etc/init.d/apache

/etc/init.d/apache inode is 2955

# find /etc -inum 2955 -exec ls -i {} \;
      2955 /etc/init.d/apache
      2955 /etc/rc0.d/K16apache
      2955 /etc/rc1.d/K16apache
      2955 /etc/rc2.d/K16apache
      2955 /etc/rc3.d/S50apache
      2955 /etc/rcS.d/K16apache

The find command with -inum option allows you to search by inode. Now I know which files are pointing to same location as /etc/init.d/apache

Local disk devices

disk device has physical & logical components

physical disk components

See other sites for more details on physical disk components.

components include spindle, platters, heads, head actuator arm

logical disk components

sector - smallest addressable unit on a platter, one sector can hold 512 bytes of data

track - series of sectors positioned end-to-end in a circular path, # of sectors per track varies due to size of tracks

cylinder - a stack of concentric tracks

<insert pic>

a disk platter [physical component] is divided into sectors, tracks, & cylinders [logical components]

disks present a fixed number of sectors per track to the Solaris OS even though # of sectors is different per track

disk labels & partition tables

disk slices are groups of cylinders used to organize data

typically, administrators will use slices to organize data by function so a slice may store user's home directories, binaries, swap space, or system files

a beginning & ending cylinder define each slice

  1. of cylinders determines the size of a slice

A disk label is a defined area of disk space used to store information about disk controller, geometry, & slices

A disk label also contains a partition table which holds partition, cylinder, & slice information

Label a disk = write slice info to disk [label a disk after changes are made]

Solaris 10 supports two disk labels

  • Sun Microsystems, Inc (SMI) disk label
    • SPARC-based Solaris OS
    • SPARC volume table of contents (VTOC) label for disks (SMI VTOC)
    • supports disks <1 terabyte in size
    • resides in 1st sector of disk on SPARC
    • includes partition table which enables you to define 0-7 disk partitions (slices)
      • slice 2 represents entire disk
      • slice 2 maintains important data regarding entire disk, like total # cylinders, size of total disk
    • Must be used for SPARC-based & Solaris x86/x64-based systems boot disks
    • Solaris x86/x64-based systems maintain two partition tables on each disk
      • 1st sector contains a fixed disk (fdisk) partition table
      • 2nd sector contains partition table with slice info within Solaris fdisk partition
    • fdisk partition defines up to four fdisk partitions
  • extensible firmware interface (EFI) disk label
    • supports disks >1 terabyte in size on 64-bit kernel
    • supports virtual disk volumes
    • partition table defines 0-9 disk partitions (slices)
    • compatible with UFS & can create UFS >1 terabyte
    • Solaris OS systems do not currently boot from disks using EFI labels

<insert some pics of physical disks>

x86/x64 partitions & slices

recommended that you use fdisk menu & format utility to create or modify fdisk partition table

2nd sector of Solaris fdisk partition contains a partition table that defines slices within Solaris fdisk partition, the label that contains this partition table is known as x84/x64 VTOC

using format utility Solaris fdisk partition can be divided into ten slices [0-9]. Slices 0-7 are used for the same purposes as SPARC SMI labels. Slice 2 represents entire disk drive. Slice 8 & 9 are used for purposes relating to x86/x64 hardware

format utility automatically creates slice 8 & 9 when x86/x64 VTOC is defined within Solaris fdisk partition. slice 8 is always required, slice 9 exists, unassigned, on SCSI or Fibre-Channel disks. format utility prevents modifying slices 8 & 9

Solaris OS systems on x86/x64 platforms create device files to support 16 slices for each disk [0-15]. format utility limits to slices 0-7. Solaris x86/x64 systems also create device files that represent four possible fdisk partitions

slice 8 is boot slice by default & contains GRUB stage1 program in sector 0, the Solaris disk label & VTOC in sectors 1 & 2, & GRUB stage2 program beginning at sector 50. Slice 8 occupies the 1st cylinder [0] of Solaris fdisk partition

IDE/SATA disk drives slice 9 is tagged alternates slice. If slice 9 is defined it occupies 2nd & 3rd cylinder [1-2] of Solaris fdisk partition & contains blocks used to store bad block info

disk naming conventions

disk device names identify a series of components that together specify a particular disk device

<insert image of naming convention>

Disk device name format: controller, target, disk (or LUN), fdisk partition, & slice that a particular disk device uses

disk device names represent full name of a slice or fdisk partition

Controller #: identifies host bus adapter (HBA), HBA controls command & data communication between system & disk unit, [system <-HBA-> disk unit], #s are assigned sequentially

Target #: identifies a unique hardware address assigned to SCSI target controller of a disk, tape, or optical drive. IDE & SATA drives typically do not use target #s (some do), Fibre-Channel attached disks may use World Wide Name (WWN) instead of a target #

Disk #: unique identifier for each disk per controller # & target # pair. also known as logical unit number (LUN)

fdisk partition #: number ranging from p0 to p4, number p0 represents whole physical disk, device names that include p# are only found on x86/x64 systems

slice #: a # ranging from s0-s7 on SPARC systems & s0-s15 on x86/x64 systems

SCSI disk device names

SCSI specification allows multiple disks to one target controller

  • In some cases, SCSI disk & target controller are combined into one physical unit
  • also known as embedded SCSI configuration
  • disk # is always set to d0 with embedded SCSI disks

<insert pic of embedded SCSI & regular configurations>


iSCSI disk devices

Solaris 10 8/07 release included support for iSCSI target devices

The targets can be disk or tape

systems with dedicated arrays can now export replicated storage with ZFS or UFS

use iscsitadm command to set up & manage iSCSI target devices

use iscsiadm command to identify iSCSI targets, which will discover & use iSCSI target devices

IDE & SATA disk device names

IDE & SATA disks do not use target controllers

device names for IDE & SATA disks have controller #, disk #, & slice (fdisk partition) #

Example: c#d#s#

<insert image showing overview>

Ultra 10 systems are different & use a target # to represent identify of disks on primary & secondary IDE buses

  • t0 = master device on primary IDE bus
  • t1 = slave device on primary IDE bus
  • t2 = master device on secondary IDE bus
  • t3 = slave device on secondary IDE bus

<insert image example>

Solaris OS device naming conventions

Solaris OS uses three different types of names depending on how the device is being referenced

  • logical device names
  • physical device names
  • instance names

logical device names

logical device names are symbolic links to physical device names in /devices directory

logical devices are primarily used when entering commands on command line

all logical device names are in /dev directory

logical device names contain controller #, target # (if required), disk #, & [slice or fdisk partition #]

every disk has entries in /dev/dsk & /dev/rdsk directories

/dev/dsk is for block disk devices

/dev/rdsk is for character disk devices

physical device names

uniquely identifies physical location of hardware devices on system

physical device names are located in /devices directory

physical device name contains hardware information, separated by slashes, that represent the path through the system's physical device tree to the device

symbolic links in /dev/dsk & /dev/rdsk point to physical device files, use ls -l

use ls -lL

The use of ls command with -L option will, if file is a symbolic link, evaluate the file info & file type of the file or directory that the symbolic link references, rather than those of the link itself. However, the name of the link is displayed, rather than the referenced file or directory.

Example:

# ls -l /dev/dsk/c1t1d0s0
lrwxrwxrwx   1 root     root          43 May  3 16:19 /dev/dsk/c1t1d0s0 -> ../../devices/pci@1c,600000/scsi@2/sd@1,0:a
# ls -lL /dev/dsk/c1t1d0s0
brw-r-----   1 root     sys       32,  8 Jul 14 16:50 /dev/dsk/c1t1d0s0

<insert pic of sample device tree>

Two categories of device trees include devices recognized by hardware at boot time & known by Solaris OS kernel [managed by software controls available to Solaris OS.

If no device file exists for a powered-on & connected physical device then Solaris OS kernel doesn't recognize the device in its device tree

Top directory in hierarchy is called root node of the device tree. The bus nexus nodes & leaf nodes below root object have device drivers associated to them

A device driver is software that communicates with physical device & device driver must be available to Solaris OS kernel so system can use device

During system initialization the Solaris OS kernel identifies physical location of a device. The kernel relates a node with an address [nodename@address] which is the physical device name

<insert pic of example>

instance names

instance names are shortened names for a physical device

instance names are abbreviated names assigned by the Solaris OS kernel for each system device

instance names are usually used to display on console or in /var/adm/messages log file

Example instance names:

  • sd# = SCSI disk name & # is the number, such that sd1 would be 2nd SCSI disk device
  • cmdk# = common disk driver is the disk name & # is the number, such that cmdk0 would be first SATA disk device
  • dad# = direct access device name & # is the number, such that dad1 would be 2nd IDE disk device
  • ata# = Advanced Technology Attachment (ATA) is disk name & # is the number, such that ata0 would be first
  • qfe# = quad fast ethernet & # is the number, such that qfe2 is 3rd interface on quad fast ethernet device

listing device names

Some ways in Solaris OS to list system devices:

  • /etc/path_to_inst file
  • prtconf command
  • format utility

/etc/path_to_inst file

Solaris system maps physical name <-> instance name in /etc/path_to_inst file

Solaris kernel uses the names in file to identify every possible device

  • file is read only at boot time
  • maintained by kernel

Example file from v240:

# cat /etc/path_to_inst 
#
#       Caution! This file contains critical kernel state
#
"/iscsi" 0 "iscsi"
"/pseudo" 0 "pseudo"
"/scsi_vhci" 0 "scsi_vhci"
"/options" 0 "options"
"/ramdisk-root" 0 "ramdisk"
"/pci@1f,700000" 0 "pcisch"
"/pci@1f,700000/network@2" 0 "bge"
"/pci@1f,700000/network@2,1" 1 "bge"
"/pci@1e,600000" 1 "pcisch"
"/pci@1e,600000/isa@7" 0 "ebus"
"/pci@1e,600000/isa@7/power@0,800" 0 "power"
"/pci@1e,600000/isa@7/rmc-comm@0,3e8" 0 "rmc_comm"
"/pci@1e,600000/isa@7/i2c@0,320" 0 "pcf8584"
"/pci@1e,600000/isa@7/i2c@0,320/motherboard-fru-prom@0,a2" 0 "seeprom"
"/pci@1e,600000/isa@7/i2c@0,320/chassis-fru-prom@0,a8" 1 "seeprom"
"/pci@1e,600000/isa@7/i2c@0,320/power-supply-fru-prom@0,b0" 2 "seeprom"
"/pci@1e,600000/isa@7/i2c@0,320/power-supply-fru-prom@0,a4" 3 "seeprom"
"/pci@1e,600000/isa@7/i2c@0,320/dimm-spd@0,b6" 4 "seeprom"
"/pci@1e,600000/isa@7/i2c@0,320/dimm-spd@0,b8" 5 "seeprom"
"/pci@1e,600000/isa@7/i2c@0,320/dimm-spd@0,ba" 6 "seeprom"
"/pci@1e,600000/isa@7/i2c@0,320/dimm-spd@0,bc" 7 "seeprom"
"/pci@1e,600000/isa@7/i2c@0,320/dimm-spd@0,c6" 8 "seeprom"
"/pci@1e,600000/isa@7/i2c@0,320/dimm-spd@0,c8" 9 "seeprom"
"/pci@1e,600000/isa@7/i2c@0,320/dimm-spd@0,ca" 10 "seeprom"
"/pci@1e,600000/isa@7/i2c@0,320/dimm-spd@0,cc" 11 "seeprom"
"/pci@1e,600000/isa@7/i2c@0,320/nvram@0,50" 12 "seeprom"
"/pci@1e,600000/isa@7/i2c@0,320/gpio@0,44" 0 "pca9556"
"/pci@1e,600000/isa@7/i2c@0,320/gpio@0,46" 1 "pca9556"
"/pci@1e,600000/isa@7/i2c@0,320/gpio@0,4a" 2 "pca9556"
"/pci@1e,600000/isa@7/i2c@0,320/gpio@0,68" 3 "pca9556"
"/pci@1e,600000/isa@7/i2c@0,320/gpio@0,88" 4 "pca9556"
"/pci@1e,600000/isa@7/i2c@0,320/gpio@0,70" 5 "pca9556"
"/pci@1e,600000/isa@7/serial@0,3f8" 0 "su"
"/pci@1e,600000/isa@7/serial@0,2e8" 1 "su"
"/pci@1e,600000/pmu@6" 0 "pmubus"
"/pci@1e,600000/pmu@6/gpio@80000000" 0 "pmugpio"
"/pci@1e,600000/pmu@6/i2c@0,0" 0 "smbus"
"/pci@1e,600000/usb@a" 0 "ohci"
"/pci@1e,600000/ide@d" 0 "uata"
"/pci@1e,600000/ide@d/sd@0,0" 3 "sd"
"/memory-controller@0,0" 0 "mc-us3i"
"/memory-controller@1,0" 1 "mc-us3i"
"/pci@1c,600000" 2 "pcisch"
"/pci@1c,600000/scsi@2" 0 "glm"
"/pci@1c,600000/scsi@2/sd@0,0" 0 "sd"
"/pci@1c,600000/scsi@2/sd@1,0" 1 "sd"
"/pci@1c,600000/scsi@2/sd@2,0" 2 "sd"
"/pci@1c,600000/scsi@2/sd@3,0" 4 "sd"
"/pci@1c,600000/scsi@2,1" 1 "glm"
"/pci@1d,700000" 3 "pcisch"
"/pci@1d,700000/network@2" 2 "bge"
"/pci@1d,700000/network@2,1" 3 "bge"
"/pci@1d,700000/pci@1" 0 "pci_pci"
"/pci@1d,700000/pci@1/pci@0" 1 "pci_pci"
"/pci@1d,700000/pci@1/pci@0/network@0" 0 "ce"
"/pci@1d,700000/pci@1/pci@0/network@1" 1 "ce"
"/pci@1d,700000/pci@1/pci@4" 2 "pci_pci"
"/pci@1d,700000/pci@1/pci@4/network@2" 2 "ce"
"/pci@1d,700000/pci@1/pci@4/network@3" 3 "ce"
#

Instance names correlate values in the last two fields, for example an entry for SCSI disk 3 on Sun v240 from file is "/pci@1c,600000/scsi@2/sd@2,0" 2 "sd"

this line & sd2 identify the same device

physical device path /pci@1c,600000/scsi@2/sd@2,0 identifies the path through the device tree to the device

different systems have different physical device names

prtconf command

  • use prtconf command to display system configuration info
  • prtconf lists all possible instances of devices (whether attached or not)
  • use prtconf | grep -v not to list only attached devices on system


example prtconf output on Sun v240:

# prtconf | grep -v not
System Configuration:  Sun Microsystems  sun4u
Memory size: 8192 Megabytes
System Peripherals (Software Nodes):

SUNW,Sun-Fire-V240
    scsi_vhci, instance #0
    options, instance #0
    memory-controller, instance #0
    memory-controller, instance #1
    pci, instance #0
        network, instance #0
        network, instance #1
    pci, instance #1
        isa, instance #0
            i2c, instance #0
                motherboard-fru-prom, instance #0
                chassis-fru-prom, instance #1
                power-supply-fru-prom, instance #2
                power-supply-fru-prom, instance #3
                dimm-spd, instance #4
                dimm-spd, instance #5
                dimm-spd, instance #6
                dimm-spd, instance #7
                dimm-spd, instance #8
                dimm-spd, instance #9
                dimm-spd, instance #10
                dimm-spd, instance #11
                nvram, instance #12
                gpio, instance #0
                gpio, instance #1
                gpio, instance #2
                gpio, instance #3
                gpio, instance #4
                gpio, instance #5
            power, instance #0
            serial, instance #0
            serial, instance #1
            rmc-comm, instance #0
        pmu, instance #0
            i2c, instance #0
            gpio, instance #0
        usb, instance #0
        ide, instance #0
            sd, instance #3
    pci, instance #2
        scsi, instance #0
            sd, instance #0
            sd, instance #1
            sd, instance #2
            sd, instance #4
        scsi, instance #1
    pci, instance #3
        network, instance #2
        network, instance #3
        pci, instance #0
            pci, instance #1
                network, instance #0
                network, instance #1
            pci, instance #2
                network, instance #2
                network, instance #3
    iscsi, instance #0
    pseudo, instance #0
#

format utility

use format utility to display both logical & physical device names for all currently available disks

Example from Sun v240

# format
Searching for disks...done


AVAILABLE DISK SELECTIONS:
       0. c1t0d0 <SUN72G cyl 14087 alt 2 hd 24 sec 424>
          /pci@1c,600000/scsi@2/sd@0,0
       1. c1t1d0 <SUN72G cyl 14087 alt 2 hd 24 sec 424>
          /pci@1c,600000/scsi@2/sd@1,0
       2. c1t2d0 <SUN72G cyl 14087 alt 2 hd 24 sec 424>
          /pci@1c,600000/scsi@2/sd@2,0
       3. c1t3d0 <SUN72G cyl 14087 alt 2 hd 24 sec 424>
          /pci@1c,600000/scsi@2/sd@3,0
Specify disk (enter its number):

prtdiag command

use prtdiag command to display system configuration & system info

reconfiguring devices

Solaris system can recognize devices that were just added by using various methods, including a reconfiguration boot, or devfsadm command

reconfiguration boot

reconfiguration boot process adds new device entries to /etc/path_to_inst file & symbolic links & device files to /dev & /devices directories

Example of a reconfiguration boot:

  1. create /reconfigure file, this file causes system to check for presence of newly installed devices at next boot/power on
    1. # touch /reconfigure
  2. shutdown system (reboot if device is already installed)
  3. install new device
  4. power on & boot system
  5. log in to system & use prtconf command to verify newly installed device

Note: On SPARC-based systems you can invoke a manual reconfiguration boot with open boot PROM (OBP) level command "boot -r". On x86/x64 systems use GRUB & edit kernel command associated with desired boot selection & add "-r" option then boot system

use devfsadm command

devfsadm command attempts to load every driver in the system & attach all possible device instances

For new devices devfsadm will:

  • create physical device files in /devices directory
  • create symbolic links in /dev directory
  • manage entries in /etc/path_to_inst file

use devfsadm -c option to limit devfsadm to a particular device class

format: devfsadm -c device_class [-c device_class1 -c device_class2 etc]

values for device_class include disk, tape, port, audio, & pseudo

use devfsadm -i option to limit devfsadm to the name of a specific driver

format: devfsadm -i driver_name

example: devfsadm -i sd limits devfsadm to those disks supported by the sd driver

Include -v option to devfsadm to display verbose output of changes to device tree

Run cleanup routines to remove unreferenced symbolic links & device files for devices no longer attached to system by using devfsadm -C [capital C]

partitioning hard disk

To Solaris