USB Flash メモリでmksysb/restoreを試しました。

USB Flashメモリに直接mksysbを取得し、リストアするのを試してみました。

# 使用した環境
IBM Power S914
AIX 7.3 TL2 SP2
取得デバイス：KIOXIA TransMemory U366 USB フラッシュメモリ 128GB

USBメモリをS914サーバーのフロントのUSBポートに挿して、cfgmgrするとUSB Mass Storageとして見えました。
```
# lsdev -C| grep usb
usb0       Available             USB System Software
usbhc0     Available 01-00       Integrated USB 3.0 xHCI Adapter (4c1041821410b204)
usbms0     Available 0.5         USB Mass Storage
```

# mksysbの取得
#smitty mksysb
実行されるコマンドを確認しようと思ったけど長かったので諦めました。
SMIT画面のデフォルトで変更したのは以下の２点のみです。  
ー　Backup DEVICE or FILE                              [/dev/usbms0]   
ー　EXPAND /tmp if needed?                              yes             

```
             Back Up This System to Tape/File or UDFS capable media

Type or select values in entry fields.
Press Enter AFTER making all desired changes.

[TOP]                                                   [Entry Fields]
    WARNING:  Execution of the mksysb command will
              result in the loss of all material
              previously stored on the selected
              output medium. This command backs
              up only rootvg volume group.

* Backup DEVICE or FILE                              [/dev/usbms0]           +/
  Create MAP files?                                   no                     +
  Create backup using snapshots?                      no                     +
  EXCLUDE files?                                      no                     +
  Exclude WPAR file systems?                          no                     +
  Location of File System Exclusion List             []                       /
  List files as they are backed up?                   no                     +
  Verify readability if tape device?                  no                     +
  Generate new /image.data file?                      yes                    +
  EXPAND /tmp if needed?                              yes                    +
  Disable software packing of backup?                 no                     +
  Backup extended attributes?                         yes                    +
  Number of BLOCKS to write in a single output       []                       #
     (Leave blank to use a system default)
  Location of existing mksysb image                  []                       /
  File system to use for temporary work space        []                       /
     (If blank, /tmp will be used.)
  Back up encrypted files?                            yes                    +
  Back up DMAPI filesystem files?                     yes                    +
  Build new alt_disk_install boot_image?              no                     +
[BOTTOM]

F1=Help             F2=Refresh          F3=Cancel           F4=List
Esc+5=Reset         F6=Command          F7=Edit             F8=Image
F9=Shell            F10=Exit            Enter=Do
```

バックアップ終了
```
                                 COMMAND STATUS

Command: OK            stdout: yes           stderr: no

Before command completion, additional instructions may appear below.

[TOP]

Creating information file (/image.data) for rootvg.

Creating list of files to back up


Populating the UDF file system...
...
bosboot: Boot image is 34817 512 byte blocks.


Backing up 50409 files........

50409 of 50409 files backed up (100%)
0512-038 mksysb: Backup Completed Successfully.

[BOTTOM]

F1=Help             F2=Refresh          F3=Cancel           F6=Command
F8=Image            F9=Shell            F10=Exit            /=Find
n=Find Next
```

# USB Flashメモリからリストアを実施
SMSで起動します。
以下の画面で5を選択
```
 PowerPC Firmware
 Version FW950.80 (VL950_131)
 SMS (c) Copyright IBM Corp. 2000,2023 All rights reserved.
-------------------------------------------------------------------------------
 Main Menu
 1.   Select Language
 2.   Setup Remote IPL (Initial Program Load)
 3.   I/O Device Information
 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
```
以下の画面で1を選択
```
 PowerPC Firmware
 Version FW950.80 (VL950_131)
 SMS (c) Copyright IBM Corp. 2000,2023 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を選択
```
 PowerPC Firmware
 Version FW950.80 (VL950_131)
 SMS (c) Copyright IBM Corp. 2000,2023 All rights reserved.
-------------------------------------------------------------------------------
 Select Device Type
 1.   Tape
 2.   CD/DVD
 3.   Hard Drive
 4.   Network
 5.   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:3
```
以下の画面で5を選択
```
 PowerPC Firmware
 Version FW950.80 (VL950_131)
 SMS (c) Copyright IBM Corp. 2000,2023 All rights reserved.
-------------------------------------------------------------------------------
 Select Media Type
 1.   SCSI
 2.   SAN
 3.   SAS
 4.   SATA
 5.   USB
 6.   NVMe
 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
```
以下の画面で1を選択
```
 PowerPC Firmware
 Version FW950.80 (VL950_131)
 SMS (c) Copyright IBM Corp. 2000,2023 All rights reserved.
-------------------------------------------------------------------------------
 Select Device
 Device  Current  Device
 Number  Position  Name
 1.        -      USB Disk
        ( loc=U78D2.001.WZS012T-P1-T3-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:1
```
以下の画面で2を選択
```
 Version FW950.80 (VL950_131)
 SMS (c) Copyright IBM Corp. 2000,2023 All rights reserved.
-------------------------------------------------------------------------------
 Select Task

USB Disk
    ( loc=U78D2.001.WZS012T-P1-T3-L1-L0-L0 )

 1.   Information
 2.   Normal Mode Boot
 3.   Service Mode Boot








 -------------------------------------------------------------------------------
 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:2
```
以下の画面で1を選択
```
 PowerPC Firmware
 Version FW950.80 (VL950_131)
 SMS (c) Copyright IBM Corp. 2000,2023 All rights reserved.
-------------------------------------------------------------------------------
 Are you sure you want to exit System Management Services?
 1.   Yes
 2.   No












 -------------------------------------------------------------------------------
 Navigation Keys:

                                             X = eXit System Management Services
 -------------------------------------------------------------------------------
 Type menu item number and press Enter or select Navigation key:1
```
USB Flashメモリ上のブートイメージから起動しているっぽい
```
IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM
IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM
IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM
IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM
IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM
IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM
IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM
IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM
-
Elapsed time since release of system processors: 142344 mins 44 secs







-------------------------------------------------------------------------------
                                Welcome to AIX.
                   boot image timestamp: 03:43:42 02/25/2025
                 The current time and date: 03:53:34 02/25/2025
        processor count: 1;  memory size: 8192MB;  kernel size: 58075317
boot device: /pci@800000020000017/usb@0/hub@1/usb-scsi@5/disk@0,0:\ppc\chrp\bootfile.exe
-------------------------------------------------------------------------------
```
以下の画面で1を選択
```
boot device: /pci@800000020000017/usb@0/hub@1/usb-scsi@5/disk@0,0:\ppc\chrp\bootfile.exe
-------------------------------------------------------------------------------


 ******* Please define the System Console. *******

Type a 1 and press Enter to use this terminal as the
  system console.
Pour definir ce terminal comme console systeme, appuyez
  sur 1 puis sur Entree.
Taste 1 und anschliessend die Eingabetaste druecken, um
  diese Datenstation als Systemkonsole zu verwenden.
Premere il tasto 1 ed Invio per usare questo terminal
  come console.
Escriba 1 y pulse Intro para utilizar esta terminal como
  consola del sistema.
Escriviu 1 1 i premeu Intro per utilitzar aquest
  terminal com a consola del sistema.
Digite um 1 e pressione Enter para utilizar este terminal
  como console do sistema.




```
以下の画面で1を選択
```


>>>  1 Type 1 and press Enter to have English during install.


















    88  Help ?


>>> Choice [1]:
```
以下の画面で2を選択し、一応設定を確認してみる。
```

                           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 Adapters






    88  Help ?
    99  Previous Menu

>>> Choice [1]: 2
```
```

                           System Backup Installation and Settings

Either type 0 and press Enter to install with the current settings, or type the
number of the setting you want to change and press Enter.

      Setting:                                 Current Choice(s):

    1 Disk(s) where you want to install ...... hdisk0
         Use Maps............................. No
    2 Shrink File Systems..................... No
    3 Import User Volume Groups............... Yes
    4 Recover Devices......................... Yes

>>> 0 Install with the settings listed above.





                       +-----------------------------------------------------
    88  Help ?         |  WARNING: Base Operating System Installation will
    99  Previous Menu  |        destroy or impair recovery of ALL data on the
                       |            destination disk hdisk0.
>>> Choice [0]:
```
今回はこの設定で問題ないので、このままEnter
リストアが始まりました。
```

                        Installing Base Operating System




        Please wait...













        Approximate     Elapsed time
     % tasks complete   (in minutes)


          3               0      Making logical volumes.
```
リストアが完了して再起動されました。
```




















AIX Version 7
Copyright IBM Corporation, 1982, 2023.
Console login: 
```
```
# oslevel -s
7300-02-02-2420
# df -m
Filesystem    MB blocks      Free %Used    Iused %Iused Mounted on
/dev/hd4         128.00     74.06   43%     2882    14% /
/dev/hd2        2432.00    215.61   92%    45621    46% /usr
/dev/hd9var      192.00    156.38   19%      637     2% /var
/dev/hd3         128.00    126.12    2%       54     1% /tmp
/dev/hd1          64.00     63.63    1%        7     1% /home
/dev/hd11admin    128.00    127.63    1%        7     1% /admin
/proc                 -         -    -        -      - /proc
/dev/hd10opt      64.00     46.29   28%      163     2% /opt
/dev/livedump    256.00    255.64    1%        4     1% /var/adm/ras/livedump
/dev/fslv00    20480.00  12742.11   38%        5     1% /bkup
/ahafs                -         -    -       36     1% /aha
#
```
以上でリストア完了です。

# あとがき
やはりUSB Flashメモリを使用すると速いな〜と思いました。