C H A P T E R  4

Mapping Between Logical and Physical Device Names

This chapter contains procedures for translating between the various logical and physical names used to identify internal disk drives in a Sun Ultra 450 workstation or Ultra Enterprise 450 server running the Solaris 9 operating environment.


Overview

Both the Sun Ultra 450 workstation and the Ultra Enterprise 450 server can accommodate up to 20 internal UltraSCSI disk drives. Each drive is labeled with a disk slot number between 0 and 19.

In order to perform a disk hot-plug procedure, you must know the slot number of the faulty disk (0 through 19) and its logical device name (for example, c2t3d0 ). If you know the disk slot number, it is possible to determine the logical device name, and vice versa. It is also possible to determine both the disk slot number and the logical device name if you know the physical device name (such as /devices/pci@6,4000/scsi@4,1/sd@3,0 ). Physical device names are typically provided in SCSI error messages generated by software.

This chapter provides procedures for:


Mapping From Error Message to Disk Slot Number and UNIX Logical Name

This section describes how to translate a UNIX physical device name provided in a SCSI error message to a UNIX logical device name and a disk slot number.

1. Determine the UNIX physical device name from the SCSI error message.

SCSI error messages are typically displayed in the system console and logged in the /usr/adm/messages file.

WARNING: /pci@6,4000/scsi@4,1/sd@3,0 (sd228)
Error for Command: read(10)     Error level: Retryable
Requested Block: 3991014        Error Block: 3991269
Vendor: FUJITSU                 Serial Number: 9606005441
Sense Key: Media Error
ASC: 0x11 (unrecovered read error), ASCQ: 0x0, FRU: 0x0

In the example SCSI error message above, the UNIX physical device name is /pci@6,4000/scsi@4,1/sd@3 .

2. Determine the UNIX logical device name by listing the contents of the /dev/rdsk directory.

Use the grep command to filter the output for any occurrence of the UNIX physical device name determined in Step 1 :

% ls -l /dev/rdsk | grep /pci@6,4000/scsi@4,1/sd@3
lrwxrwxrwx   1 root     root        45 Jan 30 09:07 c12t3d0s0 -> ../../devices/pci@6,4000/scsi@4,1/sd@3,0:a,raw
lrwxrwxrwx   1 root     root        45 Jan 30 09:07 c12t3d0s1 -> ../../devices/pci@6,4000/scsi@4,1/sd@3,0:b,raw
lrwxrwxrwx   1 root     root        45 Jan 30 09:07 c12t3d0s2 -> ../../devices/pci@6,4000/scsi@4,1/sd@3,0:c,raw
lrwxrwxrwx   1 root     root        45 Jan 30 09:07 c12t3d0s3 -> ../../devices/pci@6,4000/scsi@4,1/sd@3,0:d,raw
lrwxrwxrwx   1 root     root        45 Jan 30 09:07 c12t3d0s4 -> ../../devices/pci@6,4000/scsi@4,1/sd@3,0:e,raw
lrwxrwxrwx   1 root     root        45 Jan 30 09:07 c12t3d0s5 -> ../../devices/pci@6,4000/scsi@4,1/sd@3,0:f,raw
lrwxrwxrwx   1 root     root        45 Jan 30 09:07 c12t3d0s6 -> ../../devices/pci@6,4000/scsi@4,1/sd@3,0:g,raw
lrwxrwxrwx   1 root     root        45 Jan 30 09:07 c12t3d0s7 -> ../../devices/pci@6,4000/scsi@4,1/sd@3,0:h,raw

The resulting output indicates the associated UNIX logical device name. In this example, the logical device name is c12t3d0 .

3. Determine the disk slot number using the prtconf command.

Substitute the string disk@ for sd@ in the physical device name determined in Step 1 . The result in this example is /pci@6,4000/scsi@4,1/disk@3 .

Use the grep command to find this name in the output of the prtconf command:

% prtconf -vp | grep /pci@6,4000/scsi@4,1/disk@3
slot#11:  '/pci@6,4000/scsi@4,1/disk@3'

The resulting output indicates the corresponding disk slot number. In this example, the disk slot number is 11.

If the output does not provide a slot number, the device is either a removable media device (CD-ROM or tape drive) or an external device.


Mapping From UNIX Logical Name to Disk Slot Number

This section describes how to translate from a known UNIX logical device name such as c0t0d0s0 to a disk slot number (0 through 19).

This example assumes a known UNIX logical device name of c0t0d0s0 .

1. Determine the UNIX physical device name from the UNIX logical device name.

Use the ls -l command to display the link for the logical device name in the /dev/dsk directory:

% ls -l /dev/dsk/c0t0d0s0
lrwxrwxrwx   1 root   root   41 Jan 30 09:07 /dev/dsk/c0t0d0s0 -> ../../devices/pci@1f,4000/scsi@3/sd@0,0:a

The resulting output shows the UNIX physical device name associated with the logical device name. In this case, the corresponding physical device name is /pci@1f,4000/scsi@3/sd@0 .

2. Determine the disk slot number using the prtconf command.

Substitute the string disk@ for sd@ in the physical device name determined in Step 1 . The result in this example is /pci@1f,4000/scsi@3/disk@0 .

Use the grep command to find this name in the output of the prtconf command:

% prtconf -vp | grep /pci@1f,4000/scsi@3/disk@0
bootpath:  '/pci@1f,4000/scsi@3/disk@0,0:a'
disk:  '/pci@1f,4000/scsi@3/disk@0,0'
disk0:  '/pci@1f,4000/scsi@3/disk@0,0'
    slot#0:  '/pci@1f,4000/scsi@3/disk@0'

The resulting output indicates the corresponding disk slot number. In this example, the disk slot number is 0.

If the output does not provide a slot number, the device is either a removable media device (CD-ROM or tape drive) or an external device.


Mapping From Disk Slot Number to UNIX Logical Name

This section describes how to translate from a known disk slot number (0 through 19) to a UNIX logical device name such as c2t3d0 .

The example in this procedure assumes a known disk slot number of 3.

1. Determine the UNIX physical device name using the prtconf command.

Use the grep command to filter the prtconf output for any occurrence of the disk slot number:

% prtconf -vp | grep slot#3
slot#3:  '/pci@1f,4000/scsi@3/disk@3'
slot#3:  '/pci@1f,4000/ebus@1/i2c@14,600000/bits@40/wo@3'

In this example, the physical name associated with disk slot number 3 is /pci@1f,4000/scsi@3/disk@3 . To translate this to a UNIX physical device name, substitute sd@ for disk@ . The resulting UNIX physical device name is /pci@1f,4000/scsi@3/sd@3 .

2. Determine the UNIX logical device name by listing the contents of the /dev/rdsk directory.

Use the grep command to filter the output for any occurrence of the UNIX physical device name determined in Step 1 :

% ls -l /dev/rdsk | grep /pci@1f,4000/scsi@3/sd@3
lrwxrwxrwx   1 root     root         45 Jan 30 09:07 c0t3d0s0 -> ../../devices/pci@1f,4000/scsi@3/sd@3,0:a,raw
lrwxrwxrwx   1 root     root         45 Jan 30 09:07 c0t3d0s1 -> ../../devices/pci@1f,4000/scsi@3/sd@3,0:b,raw
lrwxrwxrwx   1 root     root         45 Jan 30 09:07 c0t3d0s2 -> ../../devices/pci@1f,4000/scsi@3/sd@3,0:c,raw
lrwxrwxrwx   1 root     root         45 Jan 30 09:07 c0t3d0s3 -> ../../devices/pci@1f,4000/scsi@3/sd@3,0:d,raw
lrwxrwxrwx   1 root     root         45 Jan 30 09:07 c0t3d0s4 -> ../../devices/pci@1f,4000/scsi@3/sd@3,0:e,raw
lrwxrwxrwx   1 root     root         45 Jan 30 09:07 c0t3d0s5 -> ../../devices/pci@1f,4000/scsi@3/sd@3,0:f,raw
lrwxrwxrwx   1 root     root         45 Jan 30 09:07 c0t3d0s6 -> ../../devices/pci@1f,4000/scsi@3/sd@3,0:g,raw
lrwxrwxrwx   1 root     root         45 Jan 30 09:07 c0t3d0s7 -> ../../devices/pci@1f,4000/scsi@3/sd@3,0:h,raw

The resulting output indicates the associated UNIX logical device name. In this example, the logical device name is c0t3d0 .