IBM Support

Using and taking advantage from USB devices and AIX.

How To


Summary

As of AIX® build 1717 (year 2017 week 17), the Entitled System Support site (ESS) released "Flash" installation images. Those images are the ISOs for DVD1 and DVD2 of the classic installation media combined in to one singe ISO file.
That makes things easier for AIX® migration or fresh installations, especially for stand-alone systems where previously you needed to swap physical DVDs to get a system installed or migrated. The flash drive can also be an easy solution for those times where you need to boot your system in to Maintenance mode, but don't have the right DVDs or blank DVDs to burn AIX® ISO images.

Steps

In this document, we are exploring the following topics:
 

This document note applies to AIX® 6.1, 7.1 and 7.2.

Required skills:

  1. Basic understanding of AIX® installation and backup procedures.
  2. Basic knowledge on VIO vscsi mapping.
  3. Basic knowledge on HMC device assignment.

How to manage and configure the USB device

 

First, we need to check and make sure the USB device drivers installed:

* output is from AIX® 7200-02-01-1731

  # lslpp -L devices.usbif.08025002.rte  
Fileset Level State Type Description (Uninstaller)  
----------------------------------------------------------------------------  
devices.usbif.08025002.rte  7.2.2.0 A F USB Mass Storage Device Software    

# lslpp -L devices.common.IBM.usb.rte  
Fileset Level State Type Description (Uninstaller)  
----------------------------------------------------------------------------  
devices.common.IBM.usb.rte  7.2.2.0 A F USB System Software


Once confirmed, you can go ahead and assign your USB device to the desired LPAR. This process can be done in 2 ways:

1) Assign the physical device to the LPAR from the HMC

2) Map it trough the VIO server, assuming the USB is already assigned to the VIO.

1. Log in to your HMC. From the selected LPAR:
Configuration > Manage Profiles >


Next, go to the I/O tab, select the USB Bus, and assign it to the LPAR:




If the LPAR is active, you have to add it trough Dynamic Partitioning:
Select the LPAR  > Dynamic partitioning > Physical Adapters > Add > select the USB Bus and click OK.



Once complete, configure your USB device:
 

  # lsdev | grep usb  
#  
# cfgmgr  
#  
# lsdev | grep usb  
usb0 Available USB System Software  
usbhc0 Available 01-08 USB Host Controller (33103500)  
usbhc1 Available 01-09 USB Host Controller (33103500)  
usbhc2 Available 01-0a USB Enhanced Host Controller (3310e000)  
usbms0 Available 2.1 USB Mass Storage


** Note "mstor" devices cannot be used to boot. AIX® firmware sees physical USB device only and is unable to recognize virtual USB (mstor) devices.

** You can boot from the mstor device by setting the boot list to it, which requires an existing and running OS:

  # bootlist -m normal /dev/mstor0

SMS/Firmware still cannot to see it. At some point we might be getting a FW patch to see virtualised USB devices, but there is no ETA on that mather.

Next, find the LPAR (vhost) you need to map to using the "lsmap -all" command. This example uses vhsot5.

Find the USB drive you want to map:
 

  $ lsdev | grep usb  usb0 Available USB System Software  usbhc0 Available USB Host Controller (33103500)  usbhc1 Available USB Host Controller (33103500)  usbhc2 Available USB Enhanced Host Controller (3310e000)  usbms0 Available USB Mass Storage


Map the device to the target vhost:

  $ mkvdev -vdev usbms0 -vadapter vhost5

On your VIO server, you see in the vhost mapping and as a virtual USB disk:
 

  $ lsmap -vadapter vhost5  
SVSA Physloc 
Client Partition ID  --------------- --------------------------------------------   
vhost5 
U8202.E4C.10F474R-V1-C8 0x00000006    
VTD nim1hdisk0  
Status Available  
LUN 0x8200000000000000  
Backing device nim1root  
Physloc  
Mirrored N/A    

VTD nim1hdisk1  
Status Available  
LUN 0x8300000000000000  
Backing device nim1data  
Physloc  
Mirrored N/A    

VTD vtopt5  
Status Available  
LUN 0x8100000000000000  
Backing device  
Physloc  
Mirrored N/A    

VTD vtusbdd0  
Status Available  
LUN 0x8400000000000000  
Backing device usbms0  
Physloc U78AA.001.WZSHYWU-P1-T7-L1  
Mirrored N/A    

$ lsdev | grep usb  
usb0 Available USB System Software  
usbhc0 Available USB Host Controller (33103500)  
usbhc1 Available USB Host Controller (33103500)  
usbhc2 Available USB Enhanced Host Controller (3310e000)  
usbms0 Available USB Mass Storage  
vtusbdd0 Available Virtual Target Device - USB Disk


On your AIX® LPAR, the USB device shows as mstor0:

  # lsdev | grep mstor  
#
# cfgmgr  
#  
# lsdev | grep mstor  
mstor0 Available Virtual SCSI Removable Disk

For reference on the mstor file https://www.ibm.com/support/knowledgecenter/en/ssw_aix_72/com.ibm.aix.files/mstor.htm

 

How to put ISO images on a USB drive?
 

On AIX® or any Unix/Linux system, you can "dd" the ISO image on to a USB flash drive and use it to install AIX® .

The command syntax is:

  # dd if=<Path to ISO file> of=<usb device> bs=4k

Example:

  # dd if=/export/installs/AIX_v7.1_Base_Install_DVD_1_of_2_TL_7100-04-04_042017.iso of=/dev/usbms0 bs=4k  


Timed, that took roughly 9 minutes for a 4 GB file. Your speed can vary based on the type of USB drive and your system's performance.

If you are on Windows® and need to burn the ISO on to the USB device, you can use a third party tool like Rufus. (Keep in mind that the suggested tool is not owned or supported by IBM®. Same applies to any Windows® tools and applications used for ISO burn.)

Rufus is open source tool and you can get it at https://rufus.akeo.ie/

*** Note, some of the newer version do not have the bellow options, you can download an older version to get the ISO option. 

To Burn an AIX® ISO with it, use the following options: 

  • Choose the USB device once it's plugged in. (1)
  • Check the "Create bootable disk that uses" box and select "DD Image", then click the little disk icon and select the ISO image (2)

Rufus


How to create system backups on to a USB drive?

 

The mksysb command can natively create such structure on a USB drive without any special flags.

  # mksysb -i /dev/usbms0    
Creating information file (/image.data) for rootvg.    
Creating list of files to back up.  ..    
Populating the UDF file system...  ..  
bosboot: Boot image is 38912 512 byte blocks.    
Backing up 65605 files............................  3
1655 of 65605 files (48%)  
37153 of 65605 files (56%)  
39778 of 65605 files (60%)  
44194 of 65605 files (67%)  
53397 of 65605 files (81%)  
64113 of 65605 files (97%)  
65605 of 65605 files (100%)  
0512-038 mksysb: Backup Completed Successfully.

How to backup or restore a user created volume group on to a USB drive by using savevg?


** Note virtual USB devices ("mstor") are not visible in firmware.

By using the savevg command, you can backup any volume group on to a USB drive that uses the same process as was shown in the mksysb option previously.
 

  # savevg -i -f /dev/usbmsX <vg to be backed up>


example:

  # savevg -i -f /dev/usbms0 nimvg    
Creating information file for volume group nimvg.    
Creating list of files to back up.    
Backing up 7874 files..............................  
9 of 7874 files (0%)  
1217 of 7874 files (15%  
5143 of 7874 files (65%)  
7333 of 7874 files (93%)  
7874 of 7874 files (100%)  
0512-038 savevg: Backup Completed Successfully.

To restore, we can use the restvg command to restore the volume group: 

  # restvg -f /dev/usbms0 


Or, restore to custom disks with: 

  # restvg -f /dev/usbms0 hdisk1 hdisk2
 

How to restore or install from a USB device:
 

Boot in to SMS:

Reference: http://www-01.ibm.com/support/docview.wss?uid=isg3T1011805

1. Select 5 for Boot options:

  Version AL740_161  SMS 1.7 (c) Copyright IBM Corp. 2000,2008 All rights reserved.  
-------------------------------------------------------------------------------  
Main Menu  
1. Select Language  
2. Setup Remote IPL (Initial Program Load)  
3. Change SCSI Settings  
4. Select Console  
5. Select Boot Options <<<<<<<      
-------------------------------------------------------------------------------  
Navigation Keys:    X = eXit System Management Services 
-------------------------------------------------------------------------------  
Type menu item number and press Enter or select Navigation key: 5



2. Select 1 for Install/Boot device:
 

  Version AL740_161  SMS 1.7 (c) Copyright IBM Corp. 2000,2008 All rights reserved.  
-------------------------------------------------------------------------------  
Multiboot  
1. Select Install/Boot Device <<<<<<  
2. Configure Boot Device Order  
3. Multiboot Startup <OFF>  
4. SAN Zoning Support    
-------------------------------------------------------------------------------  
Navigation keys:  M = return to Main Menu  ESC key = return to previous screen X = eXit System Management Services  
-------------------------------------------------------------------------------  
Type menu item number and press Enter or select Navigation key: 1



3. Select 5 for Hard drive:
 

  PowerPC Firmware  Version AL740_161  SMS 1.7 (c) Copyright IBM Corp. 2000,2008 All rights reserved.  
-------------------------------------------------------------------------------  
Select Device Type  
1. Diskette  
2. Tape  
3. CD/DVD  
4. IDE  
5. Hard Drive <<<<<<<<  
6. Network  
7. List all Devices    
-------------------------------------------------------------------------------  
Navigation keys:  M = return to Main Menu  ESC key = return to previous screen X = eXit System Management Services  
-------------------------------------------------------------------------------  
Type menu item number and press Enter or select Navigation key: 5



4. Select USB type:
 

  PowerPC Firmware  Version AL740_161  SMS 1.7 (c) Copyright IBM Corp. 2000,2008 All rights reserved.  
-------------------------------------------------------------------------------  
Select Media Type  
1. SCSI  
2. SSA  
3. SAN  
4. SAS  
5. SATA  
6. USB <<<<<<<  
7. IDE  
8. ISA  
9. List All Devices    
-------------------------------------------------------------------------------  
Navigation keys:  M = return to Main Menu  ESC key = return to previous screen X = eXit System Management Services  
-------------------------------------------------------------------------------  
Type menu item number and press Enter or select Navigation key: 6



5. Now we see the USB disk listed as bootable device:
 

  PowerPC Firmware  Version AL740_161  SMS 1.7 (c) Copyright IBM Corp. 2000,2008 All rights reserved.  
-------------------------------------------------------------------------------  
Select Device  Device Current Device  Number Position Name  
1. - USB Disk  ( loc=U78AA.001.WZSHYWU-P1-T7-L1-L0-L0 )      
-------------------------------------------------------------------------------  
Navigation keys:  M = return to Main Menu  ESC key = return to previous screen X = eXit System Management Services  
-------------------------------------------------------------------------------  
Type menu item number and press Enter or select Navigation key:



6. Next, the process is the same as booting from any AIX® DVD/NIM.

  Welcome to Base Operating System  Installation and Maintenance    
Type the number of your choice and press Enter. 
Choice is indicated by >>>.     

1 Start Install Now with Default Settings    
>>> 2 Change/Show Installation Settings and Install    
3 Start Maintenance Mode for System Recovery    
4 Make Additional Disks Available    
5 Select Storage Adapter      
88 Help ?  99 Previous Menu    
>>> Choice [1]:

It is always recommended to select option 2 to verify the installation target disk and any other installation options are set correctly.

How to format a USB drive to UDF and use it for data storage?
 

We can use the "udfcreate" command to format a USB driver or CD/DVD to UDF, then mount and write data on to it.

1. First, format the device by using the "udfcreate" command:

  # udfcreate -d /dev/usbms0

2. Mount the device as udfs file system:

    # mount -V udfs -o rw /dev/usbms0 /mnt    
# df -tg /mnt  
Filesystem        GB blocks   Used    Free %     Used    Mounted on  
/dev/usbms0      28.64        0.01     28.63       1%       /mnt  



At this point, you can read/write data to the device, unmount it, move it to another partition or system, or
mount it on Windows® and download a fix pack to it to update an AIX® machine that is in a closed environment.



Reference materials:




By Nayden Stoyanov 

[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SWG10","label":"AIX"},"Component":"","Platform":[{"code":"PF002","label":"AIX"}],"Version":"All Versions","Edition":"","Line of Business":{"code":"LOB08","label":"Cognitive Systems"}}]

Document Information

Modified date:
15 April 2021

UID

ibm10715609