USB Mass Storage Client Device Driver

Purpose

Supports the Universal Serial Bus (USB) protocol for mass storage and bulk type hard disk, Removable Disk Drive (RDX), flash drives, CD-ROM, DVD-RAM, Blu-ray read-only, and read/write optical memory devices.

Syntax

#include <sys/devinfo.h>
#include <sys/scsi.h>
#include <sys/scdisk.h>
#include <sys/ide.h>
#include <sys/usb.h>
#include <sys/usbdi.h>
#include <sys/mstor.h>

Description

Typical USB hard disk, RDX, flash drives, CD-ROM, DVD-RAM, Blu-ray read-only, and read/write optical drive operations are implemented by using the open, close, read, write, and ioctl subroutines.

Device-dependent subroutines

The USB mass storage device driver supports only the open, close, ioctl, and config subroutines.

open and close subroutines

The openx subroutine is primarily used by the diagnostic commands and utilities. Appropriate authority is required to run the subroutine. If you run the open subroutine without the required authority, the subroutine returns a value of -1 and sets the errno global variable to a value of EPERM.

The ext parameter that is specified in the openx subroutine selects the operation to be used for the target device. The /usr/include/sys/usb.h file defines the possible values for the ext parameter.

The ext parameter can contain any logical combination of the following flag values:

Item Description
SC_DIAGNOSTIC Places the selected device in the Diagnostic mode. This mode is singularly entrant, which means that only one process at a time can open the device at a time. When a device is in the Diagnostic mode, the USB devices are initialized during the open or close operations, and error logging is disabled. In the Diagnostic mode, only the close and ioctl subroutine operations are accepted. All other device-supported subroutines return a value of -1 and set the errno global variable to a value of EACCES.

A device can be opened in the Diagnostic mode only if the target device is not currently opened. If you open a device in the Diagnostic mode when the target device is already open, the subroutine returns a value of -1 and sets the errno global variable to a value of EACCES.

SC_SINGLE Places the selected device in the Exclusive Access mode. Only one process can open a device in the Exclusive Access mode at a time.

A device can be opened in the Exclusive Access mode only if the device is not currently open. If you open a device in the Exclusive Access mode and the device is already open, the subroutine returns a value of -1 and sets the errno global variable to a value of EBUSY. If the SC_DIAGNOSTIC flag is specified along with the SC_SINGLE flag, the device is placed in Diagnostic mode.

readx and writex subroutines

The readx and writex subroutines are not supported on USB devices. Even if they are called, the ext parameter is not processed.

ioctl subroutine

The ioctl subroutine operations that are used for the usbcd device driver are specific to the following categories of USB devices:
  • Common ioctl operations for all USB devices
  • USB hard disk, flash drive, and RDX devices
  • USB CD-ROM and read/write optical devices

Common ioctl operations supported for all USB devices

The following ioctl operations are available for hard disk, flash drive, RDX, CD-ROM, and read/write optical devices:

Operation Description
DKIORDSE Issues a read command to the device and obtains the target-device sense data when an error occurs. If the DKIORDSE operation returns a value of -1 and if the status_validity field is set to the SC_SCSI_ERROR value, valid sense data is returned. Otherwise, target sense data is omitted.

The DKIORDSE operation is provided for diagnostic use. It allows the limited use of the target device while operating in an active system environment. The arg parameter of the DKIORDSE operation contains the address of a sc_rdwrt structure. This structure is defined in the /usr/include/sys/scsi.h file.

The devinfo structure defines the maximum transfer size for a read operation. If you transfer more than the maximum limit, the subroutine returns a value of -1 and sets the errno global variable to a value of EINVAL.

Note: The CDIORDSE operation can be substituted for the DKIORDSE operation when the read command is issued to obtain sense data from a CD-ROM device. The DKIORDSE operation is the recommended operation.
DKIOCMD When the device is successfully opened in the Normal or Diagnostic mode, the DKIOCMD operation can issue any Small Computer System Interface (SCSI) command to the specified device. The device driver does not log any error recovery or failures of this operation.

The SCSI status byte and the adapter status bytes are returned through the arg parameter that contains the address of a sc_iocmd structure, which is defined in the /usr/include/sys/scsi.h file. If the DKIOCMD operation fails, the subroutine returns a value of -1 and sets the errno global variable to a nonzero value. In this case, the caller must evaluate the returned status bytes to determine the cause of operation failure and the recovery actions.

The devinfo structure defines the maximum transfer size for the command. If you transfer more than the maximum value, the subroutine returns a value of -1 and sets the errno global variable to a value of EINVAL.

DKIOCMD (continued) The following example code issues the DKIOCMD ioctl operation to the usbms0 device to get the SCSI standard inquiry data:
    char sense_data[255];
    char *data_buffer=NULL;
    struct sc_iocmd sciocmd;
....

    fd = open("/dev/usbms0", O_RDWR);
    if (fd == -1){
        printf("\niocmd: Open FAIL\n");
        exit(-1);
    }

    memset(&sciocmd, '\0', sizeof(struct scsi_iocmd));
    sciocmd.version = SCSI_VERSION_1;
    sciocmd.timeout_value = 30;
    sciocmd.command_length = 6;
    sciocmd.flags = B_READ;
    sciocmd.autosense_length = 255;
    sciocmd.autosense_buffer_ptr = &sense_data[0];

    sciocmd.data_length = 0xFF;
    sciocmd.buffer = inq_data;
    sciocmd.scsi_cdb[0] = SCSI_INQUIRY;
    sciocmd.scsi_cdb[1] = 0x00; /* Standard Inquiry*/
    sciocmd.scsi_cdb[2] = 0x00;
    sciocmd.scsi_cdb[3] = 0x00;
    sciocmd.scsi_cdb[4] = 0xFF;
    sciocmd.scsi_cdb[5] = 0x00;

    if ((rc=ioctl(fd, DKIOCMD, &sciocmd)) != 0){
        printf("iocmd: Ioctl FAIL errno %d\n",errno);
        printf("status_validity: %x, scsi_status: %x, adapter_status:%x\n",
               sciocmd.status_validity, sciocmd.scsi_bus_status,
               sciocmd.adapter_status);
        hexdump(sense_data, (long)20);
        close(fd);
        exit(-1);
    } else {
        printf("cdiocmd : Ioctl PASS\n");
        if (cmd = SCSI_INQUIRY)
            hexdump(inq_data,0x20);
    }

    close(fd);
DKIOLCMD When the device is successfully opened in the Normal or Diagnostic mode, the DKIOLCMD operation can issue any SCSI command to the specified device. The device driver does not log any error recovery failures of this operation.

This ioctl operation is similar to the DKIOCMD16 operation that is used to issue 16-byte SCSI commands to the USB mass storage device.

The SCSI status byte and the adapter status bytes are returned through the arg parameter that contains the address of a sc_iocmd16cdb structure. This structure is defined in the /usr/include/sys/scsi.h file. If the DKIOLCMD operation fails, the subroutine returns a value of -1 and sets the errno global variable to a nonzero value. In this case, the caller must evaluate the returned status bytes to determine the cause of operation failure and the recovery actions.

On completion of the DKIOLCMD ioctl request, the residual field indicates the leftover data that the device did not fully satisfy for this request. On a successful completion, the residual field indicates that the device does not have all of the data that is requested or the device has less amount of data than requested. On a request failure, you must check the status_validity field to determine whether a valid SCSI bus problem exists. In this case, the residual field indicates the number of bytes that the device failed to complete for this request.

The devinfo structure defines the maximum transfer size for the command. If you transfer more than the maximum value, the subroutine returns a value of -1 and sets the errno global variable to a value of EINVAL.

DKIOLCMD (continued) The following example code issues the DKIOLCMD ioctl operation to the usbms0 device to get the SCSI standard inquiry data:
    char sense_data[255];
    char *data_buffer=NULL;
    struct sc_iocmd16cdb sciocmd;
....

    fd = open("/dev/usbms0", O_RDWR);
    if (fd == -1){
        printf("\niocmd: Open FAIL\n");
        exit(-1);
    }

    memset(&sciocmd, '\0', sizeof(struct scsi_iocmd));
    sciocmd.version = SCSI_VERSION_1;
    sciocmd.timeout_value = 30;
    sciocmd.command_length = 6;
    sciocmd.flags = B_READ;
    sciocmd.autosense_length = 255;
    sciocmd.autosense_buffer_ptr = &sense_data[0];

    sciocmd.data_length = 0xFF;
    sciocmd.buffer = inq_data;
    sciocmd.scsi_cdb[0] = SCSI_INQUIRY;
    sciocmd.scsi_cdb[1] = 0x00; /* Standard Inquiry*/
    sciocmd.scsi_cdb[2] = 0x00;
    sciocmd.scsi_cdb[3] = 0x00;
    sciocmd.scsi_cdb[4] = 0xFF;
    sciocmd.scsi_cdb[5] = 0x00;

    if ((rc=ioctl(fd, DKIOCMD, &sciocmd)) != 0){
        printf("iocmd: Ioctl FAIL errno %d\n",errno);
        printf("status_validity: %x, scsi_status: %x, adapter_status:%x\n",
               sciocmd.status_validity, sciocmd.scsi_bus_status,
               sciocmd.adapter_status);
        hexdump(sense_data, (long)20);
        close(fd);
        exit(-1);
    } else {
        printf("cdiocmd : Ioctl PASS\n");
        if (cmd = SCSI_INQUIRY)
            hexdump(inq_data,0x20);
    }

    close(fd);
DK_PASSTHRU When the device is successfully opened, the DK_PASSTHRU operation can issue any SCSI command to the specified device. The device driver performs limited error recovery if this operation fails. The DK_PASSTHRU operation differs from the DKIOCMD operation such that it does not require an openx command with the ext argument of the SC_DIAGNOSTIC field. Because of this, the DK_PASSTHRU operation can be issued to devices that are in use by other operations.

The SCSI status byte and the adapter status bytes are returned through the arg parameter that contains the address of a sc_passthru structure. This structure is defined in the /usr/include/sys/scsi.h file. If the DK_PASSTHRU operation fails, the subroutine returns a value of -1 and sets the errno global variable to a nonzero value. In this case, the caller must evaluate the returned status bytes to determine the cause of operation failure and the recovery actions.

If a DK_PASSTHRU operation fails because a field in the sc_passthru structure has an invalid value, the subroutine returns a value of -1 and set the errno global variable to EINVAL. The einval_arg field is set to the field number (starting with 1 for the version field) of the field that had an invalid value. A value of 0 for the einval_arg field indicates that no additional information about the failure is available.

The version field of the sc_passthru structure can be set to the value of SCSI_VERSION_2 and you can specify the following fields:
  • The variable_cdb_ptr field is a pointer to a buffer that contains the cdb variable.
  • The variable_cdb_length field determines the length of the cdb variable to which the variable_cdb_ptr field points.

On completion of the DK_PASSTHRU request, the residual field indicates the leftover data that the device did not fully satisfy for this request. On a successful completion, the residual field indicates that the device does not have all of the data that is requested or the device has less amount of data than requested. On a request failure, you must check the status_validity field to determine if a valid SCSI bus problem exists. In this case, the residual field indicates the number of bytes that the device failed to complete for this request.

The devinfo structure defines the maximum transfer size for the command. If an attempt is made to transfer more than the maximum transfer size, the subroutine returns a value of -1, sets the errno global variable to a value of EINVAL, and sets the einval_arg field to a value of SC_PASSTHRU_INV_D_LEN. These values are defined in the /usr/include/sys/scsi.h file.

Note: If you call the DK_PASSTHRU operation as a non-root user, the operation fails with the EACCES error value instead of the EPERM value.
DK_PASSTHRU (continued) The following example code issues the DK_PASSTHRU ioctl operation to the usbms0 device to get the SCSI standard inquiry data:
    char sense_data[255];
    char *data_buffer=NULL;
    struct sc_passthru sciocmd;
....

    fd = open("/dev/usbms0", O_RDWR);
    if (fd == -1){
        printf("\npassthru: Open FAIL\n");
        exit(-1);
    }

    memset(&sciocmd, '\0', sizeof(struct sc_passthru));
    sciocmd.version = SCSI_VERSION_1;
    sciocmd.timeout_value = 30;
    sciocmd.command_length = 6;
    sciocmd.autosense_length = 255;
    sciocmd.autosense_buffer_ptr = &sense_data[0];

    sciocmd.data_length = 0xFF;
    sciocmd.buffer = inq_data;

    sciocmd.flags = B_READ;

    sciocmd.scsi_cdb[0] = SCSI_INQUIRY;
    sciocmd.scsi_cdb[1] = 0x00; /* Standard Inquiry*/
    sciocmd.scsi_cdb[2] = 0x00;
    sciocmd.scsi_cdb[3] = 0x00;
    sciocmd.scsi_cdb[4] = 0xFF;
    sciocmd.scsi_cdb[5] = 0x00;

    if ((rc=ioctl(fd, DK_PASSTHRU, &sciocmd)) != 0){
        if (sciocmd.adap_set_flags & SC_AUTOSENSE_DATA_VALID) {
            /* look at sense data */
        } /* end SC_AUTOSENSE_DATA_VALID */

        printf("passthru: Ioctl FAIL errno %d\n",errno);
        printf("status_validity: %x, scsi_status: %x, adapter_status:%x\n",
               sciocmd.status_validity, sciocmd.scsi_bus_status,
               sciocmd.adapter_status);
        printf("Residual: %x\n", sciocmd.residual);
        exit(-1);
    } else {
        printf("passthru: Ioctl PASS\n");
        printf("status_validity: %x, scsi_status: %x, adapter_status:%x\n",
               sciocmd.status_validity, sciocmd.scsi_bus_status,
               sciocmd.adapter_status);
        printf("Residual: %x\n", sciocmd.residual);
        /* inq_data buffer has valid Standard Inquiry data */
    }

ioctl operations for USB hard disk, flash drive, and RDX devices

The following ioctl operations are available for USB hard disk, flash drive, and RDX devices only:

Operation Description
IOCINFO Returns the devinfo structure that is defined in the /usr/include/sys/devinfo.h file. The IOCINFO operation is the only operation that is defined for all device drivers that use the ioctl subroutine. The following values are returned:
devinfo.devtype = DD_SCDISK;
devinfo.flags =(uchar)DF_RAND;
devinfo.devsubtype = 0x00;
devinfo.un.scdk.max_request = Maximum_transfer_supported_by_usbcd_driver;
devinfo.un.scdk.numblks = Largest_LBA_supported_by_device+1;
devinfo.un.scdk.blksize = Block_size_set_for_the_USB_Disk/Flash/RDX_Device;
DKPMR Issues an SCSI prevent media removal (PMR) command when the device is successfully opened. This command prevents media from being ejected until the device is closed, powered off and restarted, or until a DKAMR operation is issued. The arg parameter for the DKAMR operation is null. If the DKAMR operation is successful, the subroutine returns a value of 0. If the device is an SCSI hard disk, the DKAMR operation fails, the subroutine returns a value of -1, and sets the errno global variable to a value of EINVAL. If the DKAMR operation fails for any other reason, the subroutine returns a value of -1 and sets the errno global variable to a value of EIO.
Note: This function is provided to support the USB RDX devices that support ejecting the media cartridges.
DKAMR Issues an allow media removal (AMR) command when the device is successfully opened. The media can then be ejected by using either the driver's eject button or the DKEJECT operation. The arg parameter for this ioctl operation is null. If the DKAMR operation is successful, the subroutine returns a value of 0. If the device is an SCSI hard disk, the DKAMR operation fails. In addition, the subroutine returns a value of -1 and sets the errno global variable to a value of EINVAL. For any other cause of failure of this operation, the subroutine returns a value of -1, and sets the errno global variable to a value of EIO.
Note: This function is provided to support the USB RDX devices that support ejecting the media cartridges.

ioctl operations for CD-ROM and read/write optical devices

The following ioctl operations are available for CD-ROM and read/write optical devices:

Operation Description
IOCINFO Returns the devinfo structure that is defined in the /usr/include/sys/devinfo.h file. The IOCINFO operation is the only operation that is defined for all device drivers that use the ioctl subroutine. The following values are returned:
devinfo.devtype = DD_CDROM;
devinfo.flags = (uchar)DF_RAND;
devinfo.devsubtype = 0x00;
devinfo.un.idecd.numblks = 
  Largest logical block addressing (LBA) supported by device + 1;
devinfo.un.idecd.blksize = Block size set for the USB Disk, flash, or RDX device;
IDEPASSTHRU Issues an AT Attachment Packet Interface (ATAPI) command to the specified device when the device is successfully opened. The IDEPASSTHRU operation does not require an openx command with the ext argument of the SC_DIAGNOSTIC value. Therefore, an IDEPASSTHRU operation can be issued to devices that are in use by other operations.

The AT Attachment (ATA) status bytes and the ATA error bytes are returned through the arg parameter. This parameter contains the address of an ide_ata_passthru structure that is defined in the /usr/include/sys/ide.h file. If the IDEPASSTHRU operation fails, the subroutine returns a value of -1 and sets the errno global variable to a nonzero value. In this case, the caller evaluates the returned status bytes to determine the cause of operation failure and the recovery actions.

If the IDEPASSTHRU operation fails, the device driver performs limited error recovery. If this operation fails because a field in the ide_ata_passthru structure has an invalid value, the subroutine returns a value of -1 and sets the errno global variable to EINVAL.

On successful completion of the IDEPASSTHRU request, the residual field indicates that the device does not have all of the data that is requested, or the device has less than the amount of data that is requested. If the IDEPASSTHRU request fails, the residual field indicates the number bytes that the device failed to complete for this request.

IDEPASSTHRU (continued)

The following example code issues an SCSI inquiry command that uses the IDEPASSTHRU operation:

    struct ide_atapi_passthru atapicmd;
    char inq_buffer[255];
    uchar sense_data[255];
 
    /* set up the arg parameter block */
    memset(&atapicmd, '\0', sizeof(struct ide_atapi_passthru));
    memset(sense_data, '\0', 255);

    atapicmd.ide_device = 0;
    atapicmd.flags = IDE_PASSTHRU_READ;
    atapicmd.timeout_value    = 30;
    atapicmd.rsv0             = IDE_PASSTHRU_VERSION_01;
    atapicmd.rsv1             = 0;
    atapicmd.atapi_cmd.length = 12;
    atapicmd.atapi_cmd.resvd  = 0;
    atapicmd.atapi_cmd.resvd1 = 0;
    atapicmd.atapi_cmd.resvd2 = 0;

    atapicmd.data_ptr = inq_buffer;
    atapicmd.buffsize = 0xFF;

    atapicmd.atapi_cmd.packet.opcode  = SCSI_INQUIRY;
    atapicmd.atapi_cmd.packet.byte[0] = (0x00 | vpd)  ;  /*Standard Inquiry */
    atapicmd.atapi_cmd.packet.byte[1] = page_code;  /*Page Code–Valid if vpd=1 */
    atapicmd.atapi_cmd.packet.byte[2] = 0x00;
    atapicmd.atapi_cmd.packet.byte[3] = 0xFF;
    atapicmd.atapi_cmd.packet.byte[4] = 0x00;

    atapicmd.sense_data        = sense_data;
    atapicmd.sense_data_length = 255;

    fd = openx(“/dev/cd0”, O_RDWR, NULL, SC_DIAGNOSTIC);
    if (fd == -1) {
         printf("IDEPASSTHRU: Openx failed with errno %x \n", errno);
         exit(-1);
    }

   if ((rc = ioctl(fd, IDEPASSTHRU, &atapicmd) != 0)) {
         printf("IDEPASSTHRU: IOCTL Failed");
         printf("errno %d\n",errno);
         printf("ata_status: %x, ata_error:%x\n",
                atapicmd.ata_status, atapicmd.ata_error);
         close(fd);
         exit(-1);
     } else {
         printf("IDEPASSTHRU : Ioctl PASS\n");
         printf("ata_status: %x, ata_error: %x\n",
                atapicmd.ata_status, atapicmd.ata_error);
     }
     close(fd);
DKPMR Issues a Small Computer System Interface (SCSI) prevent media removal command when the device is successfully opened. This command prevents media from ejecting until the device is closed, powered off and then powered on, or until a DKAMR operation is issued. The arg parameter for the DKPMR operation is null. If the DKPMR operation is successful, the subroutine returns a value of 0. If the device is an SCSI hard disk, the DKPMR operation fails, the subroutine returns a value of -1, and sets the errno global variable to a value of EINVAL. If the DKPMR operation fails because of any other reason, the subroutine returns a value of -1 and sets the errno global variable to a value of EIO.
DKAMR Issues an allow media removal command when the device is successfully opened. The media can be ejected by using either the drives eject button or the DKEJECT operation. The arg parameter for this operation is null. If the DKAMR operation is successful, the subroutine returns a value of 0. If the device is an SCSI hard disk, the DKAMR operation fails, and the subroutine returns a value of -1 and sets the errno global variable to a value of EINVAL. For any other cause of operation failure, the subroutine returns a value of -1 and sets the errno global variable to a value of EIO.
DKEJECT Issues an eject media command to the drive when the device is successfully opened. The arg parameter for this operation is null. If the DKEJECT operation is successful, the subroutine returns a value of 0. If the device is an SCSI hard disk, the DKEJECT operation fails, the subroutine returns a value of -1, and sets the errno global variable to a value of EINVAL. For any other cause of operation failure, the subroutine returns a value of -1 and sets the errno variable to a value of EIO.
DKAUDIO Issues a play audio command to the specified device and controls the volume on the device's output ports. Play audio commands can play, pause, resume, stop, determine the number of tracks, and determine the status of a current audio operation. The DKAUDIO operation plays audio only through the CD-ROM drive's output ports. The arg parameter of this operation is the address of a cd_audio_cmds structure that is defined in the /usr/include/sys/scdisk.h file. Exclusive access mode is required.

If the DKAUDIO operation is attempted when the device's audio-supported attribute is set to No, the subroutine returns a value of -1 and sets the errno global variable to a value of EINVAL. If the DKAUDIO operation fails, the subroutine returns a value of -1 and sets the errno global variable to a nonzero value. In this case, the caller must evaluate the returned status bytes to determine the cause of operation failure and recovery actions.

DK_CD_MODE Issues one of the following commands:
CD_GET_MODE
Returns the current CD-ROM data mode in the cd_mode_form field of the mode_form_op structure when the device is successfully opened.
CD_CHG_MODE
Changes the CD-ROM data mode to the mode that is specified in the cd_mode_form field of the mode_form_op structure when the device is successfully opened in the exclusive access mode.

If a CD-ROM is not configured for different data modes by using the mode-select density codes, and if you change the CD-ROM data mode by setting the action field of the change_mode_form structure to the CD_CHG_MODE command, the subroutine returns a value of -1 and sets the errno global variable to a value of EINVAL. Attempts to change the CD-ROM mode to any of the DVD modes also results in a return value of -1 and the errno global variable is set to EINVAL. If the DK_CD_MODE operation for the CD_CHG_MODE command is attempted when the device is not in exclusive access mode, the subroutine returns a value of -1 and sets the errno global variable to a value of EACCES. For any other cause of operation failure, the subroutine returns a value of -1 and sets the errno global variable to a value of EIO.

Device hardware requirements

USB hard disk, flash drive, RDX, CD-ROM, and read/write optical drives have the following hardware requirements:

  • These drives must support a block size of 512 bytes per block.
  • If mode sense is supported, the write-protection (WP) bit must also be supported for sequential access memory (SAM) hard disks and read/write optical drives.
  • USB hard disks, flash drives, RDX, and read/write optical drives must report the hardware retry count in bytes of the request sense data for recovered errors. If the USB hard disk or read/write optical drive does not support this feature, the system error log might indicate premature drive failure.
  • USB CD-ROM and read/write optical drives must support the 10-byte SCSI read command.
  • USB hard disks, flash drives, RDX, and read/write optical drives must support the SCSI write and verify command and the 6-byte SCSI write command.
  • The read/write optical drive must set the format options valid (FOV) bit to 0 for the defect list header of the SCSI format unit command to use the format command operation. If the drive does not support this feature, you can write an application for the drive so that it formats the media by using the DKFORMAT operation.
  • If a USB CD-ROM drive uses CD_ROM Data Mode 1 format, it must support a block size of 512 bytes per block.
  • If a USB CD-ROM drive uses CD_ROM data Mode 2 Form 1 format, it must support a block size of 2048 bytes per block.
  • If a USB CD-ROM drive uses CD_ROM data Mode 2 Form 2 format, it must support a block size of 2336 bytes per block.
  • If a USB CD-ROM drive uses CD_DA mode, it must support a block size of 2352 bytes per block.
  • To control the volume by using the DKAUDIO (play audio) operation, the device must support the SCSI-2 mode data page 0xE.
  • To use the DKAUDIO (play audio) operation, the device must support the following SCSI-2 optional commands:
    • read sub-channel
    • pause resume
    • play audio mail summary file (.msf)
    • play audio track index
    • read table of contents (TOC)
Note: Only the International Organization for Standardization (ISO) file system (read-only ISO 9660), Universal Disk Format (UDF) file system Version 2.01, or earlier, are supported on USB devices for the AIX® operating system. However, you can create a system backup or data archival on the drives by using the mksysb, tar, cpio, backup, or restore commands. You can also use the dd command to add the ISO images to the drives.
To use the USB flash drive, RDX, CD-ROM, DVD-RAM, and Blu-ray read-only devices, install the following device package:
devices.usbif.08025002
The AIX operating system does not support plug-and-play feature for USB devices. To make a flash drive, RDX, CD-ROM, Blu-ray, or DVD-RAM drive available to the AIX users, a root user must connect the drive to a system USB port and run the following command:
# cfgmgr -l usb0
Note: Use caution when you remove the flash drives from ports. If the drives are not properly closed or unmounted before you remove the drives, the data on the drives can be corrupted.
After you remove the drives, the drives remain in the available state in the Object Data Manager (ODM) until the root user runs the following command:
# rmdev -l usbmsn
or
#rmdev –l cdn
When a drive is in the available state, you can reconnect the drive to the system, and the drive can be remounted or reopened. If a drive is disconnected from a system USB port while it is still open for a user, that drive is not reusable until you close and reopen it.

AIX Version 6.1 with the 6100-06 Technology Level recognizes and configures USB attached Blu-ray drives as read-only. The AIX operating system does not support the write operation to CD, DVD, or Blu-ray media that are present in the USB Blu-ray drive. Although the write operation is not prevented (if the drive is write-capable), no support is provided for any issues that are encountered during the write operation.

The capability of the AIX operating system to operate on USB original equipment manufacturer (OEM) flash drive, Blu-ray, and optical devices is validated against a sample of industry standard OEM USB devices that are compliant with the USB standards. You might encounter issues with certain USB devices that are not compliant and the AIX operating system does not provide any support for those issues.