diag Command


Performs hardware problem determination.


diag [ [ -a ] | [ -s [ -c ] ] [ -E days] [ -e] | [ -d Device [ -c ] [ -v ] [ -e ] [ -A ] ] | [ -B [ -c ] ] | [ -T taskname] | [ -S testsuite] | [ -c -d Device -L pending | complete ]


The diag command is the starting point to run a wide choice of tasks and service aids. Most of the tasks and service aids are platform-specific. The following tasks and service aids are available:

  • Run diagnostics
  • Display or change diagnostic run time options
  • Display Service Hints
  • Display previous diagnostic results
  • Display hardware error report
  • Display software product data
  • Display configuration and resource list
  • Display hardware vital product data
  • Display resource attributes
  • Change hardware vital product data
  • Format media
  • Certify media
  • Display test patterns
  • Local area network analyzer
  • Add resource to resource list
  • Delete resource from resource list
  • SCSI bus analyzer
  • Download microcode
  • Display or change bootlist
  • Periodic diagnostics
  • Backup and restore media
  • Disk maintenance
  • Configure dials and LPFkeys
  • Add or delete drawer Config
  • Create customized configuration diskette
  • Update disk based diagnostics
  • Configure ISA adapter
  • Operating system shell prompt (online service mode only)
  • Display or change multiprocessor configuration
    • Enable and disable individual processors
  • Display or change BUMP configuration
    • Update the flash EPROM with a new binary image
    • Display or change diagnostic modes
    • Display or change remote phone numbers and modem configurations
  • Display or change electronic mode switch
  • Process supplemental media (stand-alone mode only)
  • Generic microcode download
  • Run error log analysis
  • Service aids for use with Ethernet
  • 7135 RAIDiant array service aids
  • SCSI device identification and removal
  • SCSD tape drive service aid
  • Escon bit error rate service aid
  • PCI RAID physical disk identify
  • Configure ring indicate Power On Policy (CHRP)
  • Configure surveillance policy (CHRP)
  • Configure reboot policy (CHRP)
  • Configure remote maintenance policy (CHRP)
  • Save or restore hardware management policies (CHRP)
  • Display firmware device node information (CHRP)
  • Spare sector availability
  • Update system or service processor flash (CHRP)
  • Display system environmental sensors (CHRP)
  • Display checkstop analysis results
  • Analyze adapter internal log
  • Log repair action
  • Flash SK-NET FDDI firmware
  • Display microcode level
  • Run the Non-Volatile Memory Express (NVMe) sanitize command on the NVMe-compliant devices that support the sanitize operation. The NVMe sanitize operation changes the Non-Volatile Memory (NVM) subsystem such that you cannot recover the previous user data from any cache or non-volatile media.

You can use the System Management Interface Tool (SMIT) smit diag fast path to run this command.


Note: Most users do not need to use any flags since the diag command is a menu driven program.
Item Description
-A Specifies advanced mode. You must also specify a device by using the -d flag.
-a Processes any changes in the hardware configuration by asking if missing resources are removed, turned off, and so on. Missing resources (indicated by an 'M') and missing resource paths (indicated by a 'P') are integrated into the diagnostic resource selection list.
-B Instructs diagnostic tests to run the base system test. Error log analysis is also done on areas in the base system that supports error log analysis.
-c Indicates that the machine is not attended. No questions are asked. Results are written to standard output. You must also use an optional flag that specifies a device to be tested (d, B, or s).
-d Device Specifies the device to run the diagnostic tests on.
-E Days Specifies the number of days to be used for searching the error log during run error log analysis. This flag works with any other flag.
-e Performs error log analysis if supported on the selected device. No tests are performed. This flag must be used with the -d flag, otherwise the resource selection menu appears. If used with the -v flag, the -v flag takes precedence and the -e flag is ignored.
-S testsuite Indicates a particular test suite of devices to test:
  1. Base system
  2. I/O devices
  3. Async devices
  4. Graphic devices
  5. SCSI devices
  6. Storage devices
  7. Common devices
  8. Multimedia devices
-L pending | complete Logs repair action for a resource that is specified with the -d and -c options. Use the pending parameter if the part is replaced, but it is not yet known whether this part remains in the system. Use the complete parameter if the part is replaced and it is known that this part remains in the system.
-s Runs the diagnostic tests on all resources.
-T taskname Specifies the specific Fastpath task to be run. The following list displays the current fastpath tasks :
Format media task
Certify media task
Download microcode task
Display microcode level task
Spare sector availability task
Hot plug task
Sanitize NVMe-compliant devices that support the sanitize operation. When you specify the nvme_sanitize task, you must also specify the force option by using the -f flag. The -f flag is only required when the -c flag is specified with the diag command, otherwise the diag command fails with an error.
Note: Tasks are platform and device dependent. Some tasks might not be available on the system.
-v Runs the diagnostic tests in the system verification mode, no error log analysis performed. The default is Problem Determination mode that tests the device and runs error log analysis. If used with the -e flag, the -v flag takes precedence and the -e flag is ignored. Must be used with the -d flag to specify a device to run the diagnostic tests on.


Access Control: Only the root user can run this command.

Privilege Control: System group.


  1. To run the diagnostic tests on the scdisk0 device, without questions, enter:

    diag -d scdisk0 -c
  2. To run the NVMe sanitize operation on the NVMe device (nvmeX), enter:

    diag -c -d nvmeX -T "nvme_sanitize -f"


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