Go to main content

Managing Devices in Oracle® Solaris 11.3

Exit Print View

Updated: April 2018
 
 

Obtaining Disk Information

To facilitate disk identification, assign aliases to the disks. Use the following command:

# fmadm add-alias chassis-name.chassis-serial alias-id

You can set a naming standard so that the alias name maps to a specific disk's chassis name and chassis serial number. The following example maps the disk with chassis name SUN-Storage-J4200 and serial number 0905QAJ00E to an alias.

# fmadm add-alias SUN-Storage-J4200.0905QAJ00E J4200@RACK10:U24-25

For more information about assigning aliases to disks, see the fmadm(1M) man page.

Identifying Disks on a System

To identify disks, launch the Format utility by issuing the format command. The command displays the disks in the system similar to the following example:

# format
AVAILABLE DISK SELECTIONS:
0. c2t0d0 <SUN36G cyl 14087 alt 2 hd 24 sec 424>
/pci@1c,600000/scsi@2/sd@0,0
/dev/chassis/J4200@RACK10:U24-25/SCSI_Device__0/disk
1. c2t1d0 <SUN72G cyl 14087 alt 2 hd 24 sec 424>
/pci@1c,600000/scsi@2/sd@1,0
/dev/chassis/J4200@RACK10:U24-25/SCSI_Device__1/disk
Specify disk (enter its number): 

The command displays a list of recognized disks under AVAILABLE DISK SELECTIONS. In the example's first entry, disk 0 or target 0 is connected to the second SCSI host adapter (scsi@2). In turn, the host adapter is connected to the second PCI interface (/pci@1c,600000/...). The output also associates both the physical and logical device name to the disk's marketing name, SUN36G, which is always listed in angle brackets <>.

The association enables you to identify which logical device names represent the disks that are connected to your system. For a description of logical and physical device names, see Device Naming Conventions.

Some disks do not have marketing names. In this case, use the utility to label the disk and, if necessary, identify its type. See Creating Disk Labels.

You can use a wildcard to display disk information. For example, to display the disks that are connected to controller 0 in the previous sample output, type the following:

# format /dev/rdsk/c2t*

If the Format utility does not recognize a disk, connect the disk to the system by consulting your disk hardware documentation. Or, use the alternative procedures in the following sections to identify disks:

Displaying Slice or Partition Information

Two options in the Format utility enable you to administer disk partitions or slices, namely partition and fdisk. The fdisk option is used specifically to manage partitions on x86 based systems. Thus, these partitions are also called fdisk partitions.


Note -  Solaris slices are also called partitions. Certain interfaces might refer to a slice as a partition. To avoid confusion, Oracle Solaris documentation tries to distinguish between fdisk partitions and the entities within the Solaris fdisk partition. These entities might be called slices or partitions.

For easier management, use whole disks for creating ZFS storage non-root pools instead of disk slices . You only need to use a disk slice if the disk is intended for the ZFS root pool. When you create a pool with whole disks, an EFI label is applied. If you need to prepare a disk for use as a root pool disk, create a slice 0 that contains the entire disk capacity, as shown in Example 31, Slice Information on a Disk With a VTOC Label.

For information about setting up disks for use with ZFS storage pools, see Setting Up ZFS on Disks.

To display slice or partition information, perform the following general steps after you launch the Format utility:

  1. At the Format Menu format > prompt, type partition.

    If you are using an x86 based system, you can also type fdisk.

  2. At the partition > prompt, type print.

    If you typed fdisk at the format > prompt, you do not need to type print

The following list explains the meaning of the partition information. The actual partition information that is displayed varies depending on the label.

Part

Partition or slice number. For VTOC labeled disks, the partitions range from 0–7. For EFI labeled disks, the partitions range from 0–6.

Tag

File system that is mounted on the partition.

Flag

Any combination of the following states that apply to a specific partition: writable (w), mountable (m), readable (r), and unmountable (u). wu_rm for example are the flags for partitions reserved for swap areas.

Cylinders

Applies only to VTOC-labeled disks and refers to the starting and ending cylinder number for the slice.

Size

Slice or partition size in MB.

Blocks

Applies only to VTOC-labeled disks and refers to the total number of cylinders and the total number of sectors per slice.

First Sector

Applies only to EFI labeled disks and refers to the starting block number.

Last Sector

Applies only to EFI labeled disks and refers to the ending block number.

Example 31  Slice Information on a Disk With a VTOC Label

This example assumes that the disk being administered is c2t3d0.

format> partition
partition> print
Current partition table (c2t3d0):
Total disk cylinders available: 14087 + 2 (reserved cylinders)

Part      Tag    Flag     Cylinders         Size            Blocks
0       root    wm       0 - 14086      136.71GB    (14087/0/0) 286698624
1       swap    wu       0                0         (0/0/0)             0
2     backup    wu       0 - 14086      136.71GB    (14087/0/0) 286698624
3 unassigned    wm       0                0         (0/0/0)             0
4 unassigned    wm       0                0         (0/0/0)             0
5 unassigned    wm       0                0         (0/0/0)             0
6        usr    wm       0                0         (0/0/0)             0
7 unassigned    wm       0                0         (0/0/0)             0
partition> q
format> q
Example 32  Slice Information on a Disk With an EFI Label

This example assumes that the disk being administered is c2t3d0.

format> partition
partition> print
Current partition table (default):
Total disk sectors available: 286722878 + 16384 (reserved sectors)

Part      Tag    Flag     First Sector         Size         Last Sector
0        usr    wm                34      136.72GB          286722911
1 unassigned    wm                 0           0               0
2 unassigned    wm                 0           0               0
3 unassigned    wm                 0           0               0
4 unassigned    wm                 0           0               0
5 unassigned    wm                 0           0               0
6 unassigned    wm                 0           0               0
7   reserved    wm         286722912        8.00MB          286739295
partition> q
format> q
Example 33  Slice Information on a Disk With an EFI (GPT) Label

This example assumes that the disk being administered is c2t0d0.

format> partition
partition> print
Current partition table (original):
Total disk sectors available: 27246525 + 16384 (reserved sectors)
Part      Tag    Flag     First Sector        Size        Last Sector
0  BIOS_boot    wm               256     256.00MB         524543
1        usr    wm            524544      12.74GB         27246558
2 unassigned    wm                 0          0              0
3 unassigned    wm                 0          0              0
4 unassigned    wm                 0          0              0
5 unassigned    wm                 0          0              0
6 unassigned    wm                 0          0              0
7   reserved    wm          27246559       8.00MB         27262942
partition> q
format> q
Example 34  Partition Information From the fdisk Command

The fdisk option of the Format utility shows similar partition information as the partition option but also includes partition types. In the following example, the disk has an EFI and a Solaris partition, and the Solaris partition is active.

format> fdisk
Part      Tag    Flag     First Sector         Size         Last Sector
  0  BIOS_boot    wm               256      256.00MB          524543
  1        usr    wm            524544       68.11GB          143358320
  2 unassigned    wm                 0           0               0
  3 unassigned    wm                 0           0               0
  4 unassigned    wm                 0           0               0
  5 unassigned    wm                 0           0               0
  6 unassigned    wm                 0           0               0
            
             Total disk size is 8924 cylinders
             Cylinder size is 16065 (512 byte) blocks

                                               Cylinders
      Partition   Status    Type          Start   End   Length    %
      =========   ======    ============  =====   ===   ======   ===
          1                 EFI               1     6       6      0
          2       Active    Solaris2          7  8925    8919    100

Displaying Disk Label Information

To display disk label information, use the prtvtoc command.

# prtvtoc path/device-name

where device-name is the raw disk device in the patch that you want to examine.


Note -  To use this command, you must have the appropriate administrative rights. Refer to Using Your Assigned Administrative Rights in Securing Users and Processes in Oracle Solaris 11.3.

The information varies depending on the current label of the disk. On VTOC labeled disks, information about tracks and cylinders is included. On EFI labeled disk, no track or cylinder information is provided.

Example 35  Label Information on a Disk With a VTOC Label
# prtvtoc /dev/rdsk/c2t3d0s0
* /dev/rdsk/c2t3d0s0 partition map
*
* Dimensions:
*     512 bytes/sector
*     848 sectors/track
*      24 tracks/cylinder
*   20352 sectors/cylinder
*   14089 cylinders
*   14087 accessible cylinders
*
* Flags:
*   1: unmountable
*  10: read-only
*
*                          First     Sector    Last
* Partition  Tag  Flags    Sector     Count    Sector  Mount Directory
0      2    00          0 286698624 286698623
2      5    01          0 286698624 286698623
Example 36  Label Information on a Root Pool Disk With an EFI Label
# prtvtoc /dev/dsk/c7t0d0s1
* /dev/dsk/c7t0d0s1 partition map
*
* Dimensions:
*     512 bytes/sector
* 156301488 sectors
* 156301421 accessible sectors
*
* Flags:
*   1: unmountable
*  10: read-only
*
* Unallocated space:
*       First     Sector    Last
*       Sector     Count    Sector
*          34       222       255
*
*                          First     Sector    Last
* Partition  Tag  Flags    Sector     Count    Sector  Mount Directory
0     24    00        256    524288    524543
1      4    00     524544 155760527 156285070
8     11    00  156285071     16384 156301454
~#
Example 37  Label Information on a Non-root Pool Disk With an EFI Label
# prtvtoc /dev/dsk/c8t3d0
* /dev/dsk/c8t3d0 partition map
*
* Dimensions:
*     512 bytes/sector
* 143374738 sectors
* 143374671 accessible sectors
*
* Flags:
*   1: unmountable
*  10: read-only
*
* Unallocated space:
*       First     Sector    Last
*       Sector     Count    Sector
*          34       222       255
*
*                          First     Sector    Last
* Partition  Tag  Flags    Sector     Count    Sector  Mount Directory
0      4    00        256 143358065 143358320
8     11    00  143358321     16384 143374704

Displaying Disk Physical Locations

To display physical locations of disks, use the croinfo command which provides information about the chassis, receptacle, and occupant relative to the specific disk.

$ croinfo
D:devchassis-path                 t:occupant-type   c:occupant-compdev
-----------------------------------------------------  ------------------
/dev/chassis/SYS/HDD0/disk        disk              c2t0d0
/dev/chassis/SYS/HDD1/disk        disk              c2t1d0
/dev/chassis/SYS/HDD2/disk        disk              c2t2d0

You can use different options with the croinfo command to display information only about a specific disk.

  • croinfo –c disk displays information only about a specific disk. disk refers to the component listed under the c:occupant-compdev column.

  • croinfo –c disk –o cp displays the path which the specific disk occupies when it was installed on the system.

For other options, see the croinfo(1M) man page.


Note -  The format command also provides physical device location information. See the sample output in Identifying Disks on a System.

Other commands display locations of devices as well. The following examples show how these commands are used to identify and locate devices.

Example 38  Using the diskinfo Command

This example assumes that you assigned the alias J4200@RACK10:U24-25 to the disk SUN-Storage-J4200.0905QAJ00E. For more information about disk aliases, see Obtaining Disk Information.

$ diskinfo
D:devchassis-path                                      c:occupant-compdev
-----------------------------------------------------  ------------------
/dev/chassis/J4200@RACK10:U24-25/SCSI_Device__0/disk   c2t0d0
/dev/chassis/J4200@RACK10:U24-25/SCSI_Device__1/disk   c2t1d0
/dev/chassis/J4200@RACK10:U24-25/SCSI_Device__2/disk   c2t2d0
Example 39  Using the prtconf Command
$ prtconf -l | more
System Configuration:  Oracle Corporation  sun4v
Memory size: 523776 Megabytes
System Peripherals (Software Nodes):

ORCL,SPARC-T3-4 location: /dev/chassis//SYS/MB/HDD0/disk
scsi_vhci, instance #0 location: /dev/chassis//SYS/MB/HDD0/disk
disk, instance #4 location: /dev/chassis//SYS/MB/HDD4/disk
disk, instance #5 location: /dev/chassis//SYS/MB/HDD5/disk
disk, instance #6 location: /dev/chassis//SYS/MB/HDD6/disk
Example 40  Using the zpool Command
% zpool status -l export
pool: export
state: ONLINE
scan: none requested
config:

NAME                            STATE     READ WRITE CKSUM
export                          ONLINE       0     0     0
mirror-0                        ONLINE       0     0     0
/dev/chassis//SYS/MB/HDD0/disk  ONLINE       0     0     0
/dev/chassis//SYS/MB/HDD1/disk  ONLINE       0     0     0
mirror-1                        ONLINE       0     0     0
/dev/chassis//SYS/MB/HDD2/disk  ONLINE       0     0     0
/dev/chassis//SYS/MB/HDD3/disk  ONLINE       0     0     0
mirror-2                        ONLINE       0     0     0
/dev/chassis//SYS/MB/HDD4/disk  ONLINE       0     0     0
/dev/chassis//SYS/MB/HDD5/disk  ONLINE       0     0     0

errors: No known data errors