lsdev command
Purpose
Displays Virtual I/O Server devices and their characteristics.
Syntax
To list devices:
lsdev [ -type DeviceType... ] [ -virtual ] [ -field FieldName... ] [ -fmt Delimiter ] [-state State ]
To display information about a specific device:
lsdev { -dev DeviceName | -plc PhysicalLocationCode } [ -child ] [ -field FieldName... ] [ -fmt Delimiter ]
lsdev { -dev DeviceName | -plc PhysicalLocationCode } [ -attr [ Attribute ] | -range Attribute | -slot | -vpd | -parent]
lsdev -vpd
lsdev -slots
Description
The lsdev command displays information about devices in the Virtual I/O Server. If no flags are specified, a list of all devices, both physical and virtual, in the Virtual I/O Server is displayed. To list devices, both physical and virtual, of a specific type use the -type DeviceType flag. Use the -virtual flag to list only virtual devices. Combining both the -type and -virtual flags will list the virtual devices of the specified type.
To display information about a specific device, use the -dev DeviceName or -plc PhysicalLocationCode. Use either the -child, -parent, -attr, -range, -slot, or -vpd flag to specify what type of information is displayed. If none of these flags are used, the name, status, and description of the device will be displayed.
Using the -vpd flag, without specifying a device, displays platform-specific information for all devices.
If the -fmt Delimiter flag is specified the lsdev command returns all output in a delimiter separated format. The -state State flag limits the output to devices in the indicated state. The -slots flag produces a list of I/O slot information for built-in adapters that are not hot-pluggable but can have dynamic LPAR operations performed on them.
The lsdev output will be truncated to 80 characters per line, unless the -fmt flag is used. If the -fmt flag is used, the output lines will not be truncated and line wrap may occur, based on what the terminal window line length is set to.
Flags
Flag name | Description |
---|---|
-attr [Attribute ] | Displays information about attributes of a given
device. If an attribute is specified, its current value is displayed.
If no attribute is specified, the following information is displayed
about all attributes for the give device:
|
-child | Displays the name, status, physical location code, and description for each child of the specified device (-dev DeviceName or -plc PhysicalLocationCode). |
-dev DeviceName | Specifies the device logical name for the device for which information is listed. This flag cannot be used with the -plc flag. |
-field FieldName | Specifies the list of fields to be displayed.
The following fields are supported:
Note: The -field flag cannot be combined with
the -parent, -attr, -range, -slot, or -vpd flags.
|
-fmt Delimiter | Specifies a delimiter character to separate output fields. |
-parent | Displays the name, status, physical location code, and description of the parent device of the given device (-dev DeviceName or -plc PhysicalLocationCode). |
-plc PhysicalLocationCode | Specifies the device physical location code for the device for which information is listed. This flag cannot be used with the -dev flag. |
-range Attribute | Displays the allowed values for the specified attribute. |
-slot | Displays the slot, description, and device name of the specified device (-dev DeviceName or -plc PhysicalLocationCode). The device must be in a PCI hot swappable slot. |
-slots | Displays a list of I/O slot information for built-in adapters that are not hot-pluggable but can have dynamic LPAR operations performed on them. |
-State State | Limits the output to devices in the specified
state. The following states are supported:
|
-type DeviceType | Specifies the device type. This flag can be
used to restrict output to devices in the specified types. Both physical
and virtual devices are listed. Supported types are as follows:
|
-virtual | Restricts output to virtual devices only. |
-vpd | Displays platform-specific information for all devices or for a single device when -dev DeviceName or -plc PhysicalLocationCode are specified. |
Exit Status
Value | Description |
---|---|
Return code | Description |
12 | Specified logical volume belongs to the operating system. |
13 | Specified physical or logical volume is not valid physical or logical volume |
Examples
- To list all virtual adapters and display the name and status fields,
type:
lsdev -type adapter -virtual -field name status
The system displays the following message:
name status vhost0 Available vhost1 Available vhost2 Available ent6 Available ent7 Available ent8 Available ent9 Available
- To list all devices of type disk and display the name and
physical location fields, type:
lsdev -type disk -field name physloc
The system displays the following message:
name physloc hdisk0 U9111.520.10004BA-T15-L5-L0 hdisk1 U9111.520.10004BA-T15-L8-L0 hdisk2 U9111.520.10004BA-T16-L5-L0 hdisk3 U9111.520.10004BA-T16-L8-L0 hdisk4 UTMP0.02E.00004BA-P1-C4-T1-L8-L0 hdisk5 UTMP0.02E.00004BA-P1-C4-T2-L8-L0 hdisk6 UTMP0.02F.00004BA-P1-C8-T2-L8-L0 hdisk7 UTMP0.02F.00004BA-P1-C4-T2-L8-L0 hdisk8 UTMP0.02F.00004BA-P1-C4-T2-L11-L0 vtscsi0 U9111.520.10004BA-V1-C2-L1 vtscsi1 U9111.520.10004BA-V1-C3-L1 vtscsi2 U9111.520.10004BA-V1-C3-L2 vtscsi3 U9111.520.10004BA-V1-C4-L1 vtscsi4 U9111.520.10004BA-V1-C4-L2 vtscsi5 U9111.520.10004BA-V1-C5-L1
- To display the parent of a devices, type:
lsdev -dev hdisk0 -parent
The system displays the following message:
parent scsi0
- To display all I/O slots that are not hot-pluggable but can have
DLPAR operations performed on them, type:
lsdev -slots
The system displays the following message:
U787A.001.DNZ00Y1-P1-C1 Logical I/O Slot pci4 sisscsia0 U787A.001.DNZ00Y1-P1-T5 Logical I/O Slot pci3 ent0 ent1 U787A.001.DNZ00Y1-P1-T7 Logical I/O Slot pci2 usbhc0 usbhc1 U9111.520.10DFD8C-V2-C0 Virtual I/O Slot vsa0 U9111.520.10DFD8C-V2-C2 Virtual I/O Slot vhost0 U9111.520.10DFD8C-V2-C4 Virtual I/O Slot Unknown
- To list all devices that are of the universal
serial bus (USB) disk type, type the following command:
lsdev -type usb_disk
The system displays the following message:
name status description usbms0 Available USB Mass Storage usbms1 Available USB Mass Storage vtusbdd0 Available Virtual Target Device - USB Disk
- To list all virtual devices that are of the universal
serial bus (USB) disk type, type the following command:
lsdev -type usb_disk -virtual
The system displays the following message:
name status description vtusbdd0 Available Virtual Target Device - USB Disk