lsdev Command

Purpose

Displays devices in the system and their characteristics.

Syntax

lsdev [ -C ][ -c Class ] [ -s Subclass ] [ -t Type ] [ -f File ] [ -F Format | -r ColumnName ] [ -h ] [ -H ] [ -l { Name | - } ] [ -p Parent ] [ -S State ] [ -x ]

lsdev -P [ -c Class ] [ -s Subclass ] [ -t Type ] [ -f File ] [ -F Format | -r ColumnName ] [ -h ] [ -H ] [ -x ]

Description

The lsdev command displays information about devices in the Device Configuration database. You can display information about all devices in the Customized Devices object class using the -C flag. Any combination of the -c Class, -s Subclass, -t Type, -l Name, -p Parent, and -S State flags selects a subset of the customized devices. You can display information about all devices in the Predefined Devices object class using the -P flag. Any combination of the -c Class, -s Subclass, and -t Type flags selects a subset of the predefined devices.

You can display the default output one of the following ways:
  • From the Customized Devices object class by using the -C flag
  • From the Predefined Devices object class by using the -P flag

To override these two default outputs, use the -F Format flag to display the output in a format that you specify by using the Format parameter. The Format parameter is a quoted list of column names that are separated and possibly ended by non-alphanumeric characters or white space.

The lsdev command shows information only about devices that are based upon information in the Customized Devices (Cudv) object class or the Predefined Devices (PdDv) object class. Other object classes (such as the Customized Path (CuPath) object class) are not examined. This situation means that there might be conditions where a device might not be displayed. For example, if the -p Parent flag is used, but the parent that is identified in the Customized Devices object for a device does not match the Parent that is specified through the -p flag, the device is not displayed. However, the device might have a path to thespecified Parent that is defined in the Customized Paths object class. Use the lspath command to show all MPIO-capable child devices of the specified parent.

You can also use the Devices application in Web-based System Manager, or the System Management Interface Tool (SMIT) smit lsdev fast path to change device characteristics.

Flags

Item Description
-C Lists information about a device that is in the Customized Devices object class. The default information that is displayed is name, status, location, and description. The -C flag is not required, but is maintained for compatibility reasons. The -C flag cannot be specified with the -P flag. If neither is specified, the lsdev command behaves as if the -C flag was specified.
-c Class Specifies a device class name. This flag can be used to restrict output to devices in a specified class.
-f File Reads the necessary flags from the File parameter.
-F Format Displays the output in a user-specified format, where the Format parameter is a quoted list of column names from the Predefined or Customized Devices object class, separated and possibly ended by nonalphanumeric characters or white space. If white space is used as the separator, the lsdev command displays the output in aligned columns.

If you specify the -F Format flag with the -C flag, you can specify column names from both the Customized and Predefined Devices object classes. If you specify the -F Format flag with the -P flag, you can specify only column names from the Predefined Devices object class. In addition to the column names, the special purpose name description can be used to obtain a display of device descriptions. This flag cannot be used with the -r ColumnName flag. Also, the physloc special purpose name can be used to display a physical location code of the device.

-H Displays headers above the column output.
-h Displays the command usage message.
-l Name Specifies the device logical name from the Customized Devices object class of the device for which information is listed. The Name argument to the -l flag can contain the same wildcard characters that can be used with the odmget command. If the Name argument is a dash, names are read from STDIN. Names on STDIN must be separated by a comma, a tab, a space, or a "newline" character. Names cannot contain wildcard characters. This flag cannot be used with the -P flag.
-p Parent Specifies the device logical name from the Customized Devices object class for the parent of devices to be displayed. The -p Parent flag can be used to show the child devices of the specified Parent. The Parent argument to the -p flag might contain the same wildcard characters that can be used with the odmget command. This flag cannot be used with the -P flag.
-P Lists information about a device that is in the Predefined Devices object class. The default information that is displayed is class, type, subclass, and description. This flag cannot be used with the -C, -l, or -S flags.
-r ColumnName Displays the set of values in a column. For example, the ColumnName parameter takes the value of the Class parameter to list all of the classes. If you specify the -r ColumnName flag with the -C flag, you can specify column names from both the Customized and Predefined Devices object classes. If you specify the -r ColumnName flag with the -P flag, you can specify only column names from the Predefined Devices object class. This flag cannot be used with the -F Format flag.
-S State Lists all devices in a specified state as named by the State parameter. The State parameter can have one of the following values:
  • d, D, 0 or defined for the Defined state
  • a, A, 1, or available for the Available state
  • s, S, 2, or stopped for the Stopped state
This flag can be used to restrict output to devices in a specified state. This flag cannot be used with the -P flag.
-s Subclass Specifies a device subclass name. This flag can be used to restrict output to devices in a specified subclass.
-t Type Specifies a device type name. This flag can be used to restrict output to devices of a specified type.
-x Displays the exported status for devices that are exported to a Workload Partition (WPAR).

Exit Status

This command returns the following exit values:
Item Description
0 Successful completion.
>0 An error occurred.

Security

Attention RBAC users and Trusted AIX users: This command can perform privileged operations. Only privileged users can run privileged operations. For more information about authorizations and privileges, see Privileged Command Database in AIX® Version 7.1 Security. For a list of privileges and the authorizations associated with this command, see the lssecattr command or the getcmdattr subcommand.

Examples

  1. To list all of the devices in the Predefined Devices object class with column headers, type the following command:
    lsdev -P -H
    The system displays a message similar to the following output:
    class          type           subclass   description
    logical_volume vgtype         vgsubclass Volume group
    logical_volume lvtype         lvsubclass Logical volume
    lvm            lvdd           lvm        LVM Device Driver
    posix_aio      posix_aio      node       Posix Asynchronous I/O
    aio            aio            node       Asynchronous I/O (Legacy)
    pty            pty            pty        Asynchronous Pseudo-Terminal
    mouse          030102         usbif      USB mouse
    keyboard       030101         usbif      USB keyboard
    driver         tmssar         node       Target Mode SSA Router
    tmssa          tmssa          tmssar     Target Mode SSA Device
    disk           hdisk          ssar       SSA Logical Disk Drive
    pdisk          1000mbC        ssar       1GB SSA C Physical Disk Drive
    pdisk          2000mbC        ssar       2GB SSA C Physical Disk Drive
    .
    .
    .
    disk           540mb2         scsi       540 MB SCSI Disk Drive
    disk           540mb3         scsi       540 MB SCSI Disk Drive
    disk           540mb4         scsi       540 MB SCSI Disk Drive
    disk           540mb5         scsi       540 MB SCSI Disk Drive
    disk           730mb2         scsi       730 MB SCSI Disk Drive
    disk           810mb          scsi       810 MB SCSI Disk Drive
    disk           810mb2         scsi       810 MB SCSI Disk Drive
    bus            pcic           pci        PCI Bus
    bus            isac           pci        ISA Bus
    adapter        df1000f9       pci        FC Adapter
    adapter        df1000f7       pci        FC Adapter
    driver         efscsi         iocb       FC SCSI I/O Controller Protocol Device
    adapter        c1110358       pci        USB OHCI Adapter (c1110358)
    adapter        ad100501       pci        ATA/IDE Controller Device
    adapter        4f111100       pci        IBM 8-Port EIA-232/RS-422A (PCI) Adapter
    adapter        ccm            pci        Name of the Common Character Mode device driver
    driver         hdlc           331121b9   IBM HDLC Network Device Driver
    adapter        331121b9       pci        IBM 2-Port Multiprotocol Adapter (331121b9)
    adapter        2b102005       pci        GXT130P Graphics Adapter
    adapter        2b101a05       pci        GXT120P Graphics Adapter
    adapter        23100020       pci        IBM 10/100 Mbps Ethernet PCI Adapter (23100020)
    .
    .
    .
    if             tr             TR         Token Ring Network Interface
    if             vi             VI         Virtual IP Address Network Interface
    if             xt             XT         X.25 Network Interface
    tcpip          inet           TCPIP      Internet Network Extension
    swap           paging         nfs        NFS Swap DEVICE
    drawer         media1         media      SCSI Device Drawer
    drawer         scsi1          dasd       SCSI DASD Drawer
    adapter        4f111b00       pci        IBM 128-Port Async (PCI) Adapter
    concentrator   16c232         sync_pci   16-Port RAN EIA-232 for 128-Port Adapter
    concentrator   16e232         sync_pci   16-Port Enhanced RAN EIA-232 for 128-Port Adapter
    concentrator   16e422         sync_pci   16-Port Enhanced RAN RS-422 for 128-Port Adapter
    if             at             AT         ATM Network Interface
    adapter        14105300       pci        IBM PCI 25MBPS ATM Adapter (14105300)
  2. To list all of the devices in the Customized Devices object class, type the following command:
    lsdev -C
    The system displays a message similar to the following output:
    sys0       Available              System Object
    sysplanar0 Available              System Planar
    mem0       Available              Memory
    L2cache0   Available              L2 Cache
    proc0      Available 00-00        Processor
    pci0       Available              PCI Bus
    pci1       Available              PCI Bus
    isa0       Available 10-58        ISA Bus
    siota0     Available 01-Q1        Tablet Adapter
    ppa0       Available 01-R1        CHRP IEEE1284 (ECP) Parallel Port Adapter
    sa0        Available 01-S1        Standard I/O Serial Port
    sa1        Available 01-S2        Standard I/O Serial Port
    paud0      Available 01-Q2        Ultimedia Integrated Audio
    siokma0    Available 01-K1        Keyboard/Mouse Adapter
    fda0       Available 01-D1        Standard I/O Diskette Adapter
    scsi0      Available 10-60        Wide/Ultra-2 SCSI I/O Controller
    scsi1      Available 10-61        Wide/Ultra-2 SCSI I/O Controller
    sa2        Available 10-68        IBM 8-Port EIA-232/RS-422A (PCI) Adapter
    sa3        Available 10-70        IBM 8-Port EIA-232/RS-422A (PCI) Adapter
    sa4        Available 10-78        IBM 8-Port EIA-232/RS-422A (PCI) Adapter
    .
    .
    hd3        Defined                Logical volume
    hd1        Defined                Logical volume
    hd10opt    Defined                Logical volume
    inet0      Available              Internet Network Extension
    en0        Available 10-80        Standard Ethernet Network Interface
    et0        Defined   10-80        IEEE 802.3 Ethernet Network Interface
    lo0        Available              Loopback Network Interface
    pty0       Available              Asynchronous Pseudo-Terminal
    gxme0      Defined                Graphics Data Transfer Assist Subsystem
    rcm0       Available              Rendering Context Manager Subsystem
    aio0       Defined                Asynchronous I/O (Legacy)
    posix_aio0 Defined                Posix Asynchronous I/O
    tty0       Available 01-S1-00-00  Asynchronous Terminal
    tty1       Available 01-S2-00-00  Asynchronous Terminal
  3. To list the adapters that are in the Available state in the Customized Devices object class, type the following command:
    lsdev -C -c adapter -S a
    The system displays a message similar to the following output:
    sa0     Available 01-S1    Standard I/O Serial Port
    sa1     Available 01-S2    Standard I/O Serial Port
    siokma0 Available 01-K1    Keyboard/Mouse Adapter
    fda0    Available 01-D1    Standard I/O Diskette Adapter
    scsi0   Available 10-60    Wide/Fast-20 SCSI I/O Controller
    fcs0    Available 10-68    FC Adapter
    scsi1   Available 10-88    Wide/Ultra-2 SCSI I/O Controller
    fcs1    Available 20-60    FC Adapter
    sioka0  Available 01-K1-00 Keyboard Adapter
    siota0  Available 01-Q1    Tablet Adapter
    ppa0    Available 01-R1    CHRP IEEE1284 (ECP) Parallel Port Adapter
    paud0   Available 01-Q2    Ultimedia Integrated Audio
    tok0    Available 10-70    IBM PCI Tokenring Adapter (14101800)
    ent0    Available 10-80    IBM 10/100 Mbps Ethernet PCI Adapter (23100020)
    sioma0  Available 01-K1-01 Mouse Adapter
  4. To list all of the tape devices in the Predefined Devices object class, type the following command:
    lsdev -P -c tape
    The system displays a message similar to the following output:
    tape ost      fcp   Other FC SCSI Tape Drive
    tape scsd     fcp   FC SCSI Tape Drive
    tape ost      iscsi Other iSCSI Tape Drive
    tape scsd     iscsi iSCSI Tape Drive
    tape 1200mb-c scsi  1.2 GB 1/4-Inch Tape Drive
    tape 150mb    scsi  150 MB 1/4-Inch Tape Drive
    tape 3490e    scsi  3490E Autoloading Tape Drive
    tape 4mm2gb   scsi  2.0 GB 4mm Tape Drive
    tape 4mm4gb   scsi  4.0 GB 4mm Tape Drive
    tape 525mb    scsi  525 MB 1/4-Inch Tape Drive
    tape 8mm      scsi  2.3 GB 8mm Tape Drive
    tape 8mm5gb   scsi  5.0 GB 8mm Tape Drive
    tape 8mm7gb   scsi  7.0 GB 8mm Tape Drive
    tape 9trk     scsi  1/2-inch 9-Track Tape Drive
    tape ost      scsi  Other SCSI Tape Drive
    tape scsd     scsi  SCSI Tape Drive
    tape 4mm2gb2  scsi  2.0 GB 4mm Tape Drive
  5. To list the supported device classes from the Predefined Devices object class, type the following command:
    lsdev -P -r class
    The system displays a message similar to the following output:
    PCM
    adapter
    aio
    array
    bus
    cdrom
    concentrator
    container
    dial
    disk
    diskette
    drawer
    driver
    gxme
    if
    keyboard
    lft
    logical_volume
    lpfk
    lvm
    memory
    mouse
    pdisk
    planar
    port
    posix_aio
    printer
    processor
    pseudo
    pty
    rcm
    rwoptical
    swap
    sys
    tablet
    tape
    tcpip
    tmscsi
    tmssa
    tty
  6. To list the supported subclasses in the Predefined Devices object class for the disk class, type the following command:
    lsdev -P -c disk -r subclass
    The system displays a message similar to the following output:
    dar
    fcp
    fdar
    ide
    iscsi
    scraid
    scsi
    ssar
    vscsi
  7. To list the name, class, subclass, and type of every device in the Available state in the Customized Devices object class with column headers, type the following command:
    lsdev -C -H -S a -F 'name class subclass type'
    The system displays a message similar to the following output:
    name       class     subclass type
    sys0       sys       node     chrp
    sysplanar0 planar    sys      sysplanar_rspc
    mem0       memory    sys      totmem
    L2cache0   memory    sys      L2cache_rspc
    proc0      processor sys      proc_rspc
    pci0       bus       chrp     pci
    pci1       bus       chrp     pci
    isa0       bus       pci      isac
    siota0     adapter   isa_sio  isa_tablet
    ppa0       adapter   isa_sio  chrp_ecp
    sa0        adapter   isa_sio  pnp501
    sa1        adapter   isa_sio  pnp501
    paud0      adapter   isa_sio  baud4232
    siokma0    adapter   isa_sio  kma_chrp
    fda0       adapter   isa_sio  pnp700
    scsi0      adapter   pci      sym896
    scsi1      adapter   pci      sym896
    sa2        adapter   pci      4f111100
    sa3        adapter   pci      4f111100
    sa4        adapter   pci      4f111100
    ent0       adapter   pci      23100020
    mg20       adapter   pci      2b102005
    sa5        adapter   pci      4f111100
    sioka0     adapter   kma_chrp keyboard
    sioma0     adapter   kma_chrp mouse
    fd0        diskette  siofd    fd
    cd0        cdrom     scsi     scsd
    hdisk0     disk      scsi     scsd
    kbd0       keyboard  std_k    ps2
    mouse0     mouse     std_m    mse_3b
    lvdd       lvm       lvm      lvdd
    lft0       lft       node     lft
    inet0      tcpip     TCPIP    inet
    en0        if        EN       en
    lo0        if        LO       lo
    pty0       pty       pty      pty
    rcm0       rcm       node     rcm
    tty0       tty       rs232    tty
    tty1       tty       rs232    tty
  8. To list the name, class, location, and physloc of all adapter devices in the Customized Devices object class with column headers, type the following command:
    lsdev -C -c adapter -F 'name class location physloc'
    The system displays a message similar to the following output:
    ent0   adapter 02-08 UTMP0.02F.00004BA-P1-C3-T1
    scsi0  adapter 01-08 UTMP0.02F.00004BA-P1-C2-T1
    scsi1  adapter 01-09 UTMP0.02F.00004BA-P1-C2-T2
    scsi2  adapter 03-08 UTMP0.02F.00004BA-P1-C4-T1
    scsi3  adapter 03-09 UTMP0.02F.00004BA-P1-C4-T2
    vsa0   adapter       U9111.520.10004BA-V4-C0
    vscsi0 adapter       U9111.520.10004BA-V4-C2
    vscsi1 adapter       U9111.520.10004BA-V4-C3
  9. To list all of the children of the pci0 bus, type the following command:
    lsdev -p pci0
    The system displays a message similar to the following output:
    ent0  Available 10-80 IBM 10/100 Mbps Ethernet PCI Adapter (23100020)
    isa0  Available 10-58 ISA Bus
    scsi0 Available 10-60 Wide/Fast-20 SCSI I/O Controller
    scsi1 Available 10-88 Wide/Ultra-2 SCSI I/O Controller
    tok0  Available 10-70 IBM PCI Tokenring Adapter (14103e00)
  10. To list the devices whose names are contained in the file /tmp/f, type:
    cat /tmp/f | lsdev -l -
    The system displays a message similar to the following output:
    pci0 Available  PCI Bus
    scsi0 Available 10-60 Wide/Fast-20 SCSI I/O Controller
    hdisk0 Available 10-60-00-8,0 16 Bit SCSI Disk Drive
  11. To display the status of the devices that are exported to a WPAR as Exported, enter the following command:
    # lsdev -c disk -x
    The system displays a message similar to the following output:
    hdisk0 Available 01-08-00-1,0 16 Bit LVD SCSI Disk Drive
    hdisk1 Exported  01-08-00-2,0 Other SCSI Disk Drive
    where the hdisk1 device is exported to a WPAR.

Files

Item Description
/usr/sbin/lsdev Contains the lsdev command.