詳解使用磁碟克隆和U盤安裝IBM AIX作業系統

尛樣兒發表於2013-11-28

    通常我們都是通過CDROM的方式來安裝IBM AIX作業系統,但如果伺服器沒有光碟機,或者需要安裝多臺伺服器的時候為了提高工作效率,可以考慮使用這裡的方法。這篇文章將詳細討論使用磁碟克隆和U盤安裝的方式安裝AIX作業系統,這兩種方法都需要有已經成功安裝的AIX作業系統的支援。


一.磁碟克隆安裝作業系統。

1.作業系統環境。
# oslevel -s
6100-04-10-1119

# bootlist -m normal -o
cd0
hdisk0 pathid=0
ent0 speed=auto duplex=auto bserver=000.000.000.000 client=000.000.000.000 gateway=000.000.000.000

# lspv
hdisk0          00cc1ad4ef095bf0                    rootvg          active      
hdisk1          00cc1ad46aff307f                    None                        

2.使用alt_disk_install工具克隆磁碟。

# alt_disk_install -OCB hdisk1
+-----------------------------------------------------------------------------+
ATTENTION: calling new module /usr/sbin/alt_disk_copy. Please see the alt_disk_copy man page
and documentation for more details.
Executing command: {/usr/sbin/alt_disk_copy -O -B -d "hdisk1"}
+-----------------------------------------------------------------------------+
Calling mkszfile to create new /image.data file.
Checking disk sizes.
Creating cloned rootvg volume group and associated logical volumes.
Creating logical volume alt_hd5
Creating logical volume alt_hd6
Creating logical volume alt_hd8
Creating logical volume alt_hd4
Creating logical volume alt_hd2
Creating logical volume alt_hd9var
Creating logical volume alt_hd3
Creating logical volume alt_hd1
Creating logical volume alt_hd10opt
Creating logical volume alt_hd11admin
Creating logical volume alt_livedump
Creating /alt_inst/ file system.
/alt_inst filesystem not converted.
        Small inode extents are already enabled.
Creating /alt_inst/admin file system.
/alt_inst/admin filesystem not converted.
        Small inode extents are already enabled.
Creating /alt_inst/home file system.
/alt_inst/home filesystem not converted.
        Small inode extents are already enabled.
Creating /alt_inst/opt file system.
/alt_inst/opt filesystem not converted.
        Small inode extents are already enabled.
Creating /alt_inst/tmp file system.
/alt_inst/tmp filesystem not converted.
        Small inode extents are already enabled.
Creating /alt_inst/usr file system.
/alt_inst/usr filesystem not converted.
        Small inode extents are already enabled.
Creating /alt_inst/var file system.
/alt_inst/var filesystem not converted.
        Small inode extents are already enabled.
Creating /alt_inst/var/adm/ras/livedump file system.
/alt_inst/var/adm/ras/livedump filesystem not converted.
        Small inode extents are already enabled.
Generating a list of files
for backup and restore into the alternate file system...
Backing-up the rootvg files and restoring them to the 
alternate file system...
Modifying ODM on cloned disk.
Building boot image on cloned disk.
Resetting all device attributes.
NOTE: The first boot from altinst_rootvg will prompt to define the new
system console.
Resetting all device attributes.
NOTE: The first boot from altinst_rootvg will prompt to define the new
system console.
forced unmount of /alt_inst/var/adm/ras/livedump
forced unmount of /alt_inst/var/adm/ras/livedump
forced unmount of /alt_inst/var
forced unmount of /alt_inst/var
forced unmount of /alt_inst/usr
forced unmount of /alt_inst/usr
forced unmount of /alt_inst/tmp
forced unmount of /alt_inst/tmp
forced unmount of /alt_inst/opt
forced unmount of /alt_inst/opt
forced unmount of /alt_inst/home
forced unmount of /alt_inst/home
forced unmount of /alt_inst/admin
forced unmount of /alt_inst/admin
forced unmount of /alt_inst
forced unmount of /alt_inst
Changing logical volume names in volume group descriptor area.
Fixing LV control blocks...
Fixing file system superblocks...

執行這個命令需要bos.alt_disk_install.rte軟體包。
alt_disk_install -OCB hdisk1 
    這個命令克隆的盤,可以拿到不同硬體配置的伺服器上使用,使用它進行引導時,會刪除ODM庫裡的所有資訊,根據硬體重新配置所有裝置資訊,相當於使用克隆盤重新安裝新的系統。

alt_disk_install -CB hdisk1 
    如果是相同硬體配置的機器,則可以執行這個命令克隆磁碟,保持所有裝置資訊。

3.檢視克隆情況。
# lspv
hdisk0          00cc1ad4ef095bf0                    rootvg          active      
hdisk1          00cc1ad46aff307f                    altinst_rootvg              

hdisk1對應的卷組名為altinst_rootvg。

# bootlist -o -m normal
cd0
hdisk0 pathid=0
ent0 speed=auto duplex=auto bserver=000.000.000.000 client=000.000.000.000 gateway=000.000.000.000

檢視引導列表,未發生變化。

4.重啟作業系統。
# lspv
hdisk0          00cc1ad4ef095bf0                    rootvg          active      
hdisk1          00cc1ad46aff307f                    altinst_rootvg              
# bootlist -o -m normal
cd0
hdisk0 pathid=0
ent0 speed=auto duplex=auto bserver=000.000.000.000 client=000.000.000.000 gateway=000.000.000.000
卷組名和引導順序未發生變化。

5.拔掉克隆磁碟。
關閉作業系統,拔掉hdisk1,重啟源伺服器,檢視伺服器情況:
# lspv
hdisk0          00cc1ad4ef095bf0                    rootvg          active      
# lsdev -Cc disk
hdisk0 Available 01-08-00 SAS Disk Drive
hdisk1 Defined   01-08-00 SAS Disk Drive

刪除被拔掉的磁碟:
# rmdev -dl hdisk1
hdisk1 deleted
# lsdev -Cc disk
hdisk0 Available 01-08-00 SAS Disk Drive

6.將克隆磁碟移植到新伺服器。
    將hdisk1插入新伺服器,新插入的盤不會自動引導系統的啟動,需要在分割槽啟動時進入SMS選單,手動指定磁碟啟動。

1).進入SMS選單,選擇5:


2).選擇1:


3).選擇7:


4).選擇3引導系統:


5).選擇2:


6).選擇1:


7).選擇2:


7.檢查系統:
# lspv
hdisk0          00cc1ad46aff307f                    rootvg          active      
# lsdev -Cc disk
hdisk0 Available 00-08-00 SAS Disk Drive
# bootlist -o -m normal
cd0
-
ent0 speed=auto duplex=auto bserver=000.000.000.000 client=000.000.000.000 gateway=000.000.000.000

修改引導順序:
# bosboot -a -d /dev/hdisk0
bosboot: Boot image is 53276 512 byte blocks.
# bootlist -o -m normal hdisk0
hdisk0 blv=hd5 pathid=0
# bootlist -o -m normal
hdisk0 blv=hd5 pathid=0

自此,分割槽重啟即可自動啟動。


二.使用U盤安裝作業系統。

使用U盤安裝AIX的方法描述:

USB flash disk(U-disk)
  IZ15299 6100-02
  IZ20527 5300-09
  add boot support for USB flash memory device.
  These APAR announced Nov 2008,3 years ago.
  3 type of U-disk are formally supported:
  -Lenovo USB2.0 Essential Memory Key, part number 41U4944
  -Kingston 4GB DataTraveler, USB2.0
  -SanDisk 4GB Cruzer Micro Flash Drive, USB2.0
  Procedure to create bootable U-Disk
 1)plug U-disk in USB port
 2)make sure below filesets installed.
   devices.common.IBM.usb.rte
   devices.usbif.08025002.rte
 3)Configure U-disk
  #cfgmgr -vl usb0
    
  usbms0 Available 2.3 USB Mass Storage
  #lscfg -vl usbms0
  usbms0 U78C0.001.DBJA161-D1-T1-L1 USB Mass Storage


Manufacturer................San
       Machine Type and Model......Cru
       ROM Level.(alterable).......8.01
 4)Copy ISO from DVD
  #dd if=/dev/cd0 of=/images/AIX61.iso bs=4096k
  make sure iso file is in a large file capable file system and has enough space
  #dd if=/images/AIX61.iso of=/dev/usbms0 bs=4096k
  Do not use U-disk with write protection switch.AIX will complain the U-disk
  is write protected no matter it is write protected or not.(Bug)
Procedure to install from U-disk
1)insert U-disk created in Power computer node USB port
2)activate LPAR to SMS
3)Multiboot -> Select Install/Boot Device -> Select harddisk/USB 

下面是實際的操作步驟:
# lslpp -l devices.common.IBM.usb.rte
  Fileset                      Level  State      Description         
  ----------------------------------------------------------------------------
Path: /usr/lib/objrepos
  devices.common.IBM.usb.rte
                             6.1.7.0  COMMITTED  USB System Software


Path: /etc/objrepos
  devices.common.IBM.usb.rte
                             6.1.4.1  COMMITTED  USB System Software 
# lslpp -l devices.usbif.08025002.rte
  Fileset                      Level  State      Description         
  ----------------------------------------------------------------------------
Path: /usr/lib/objrepos
  devices.usbif.08025002.rte
                            6.1.7.19  COMMITTED  USB Mass Storage Device
                                                 Software


Path: /etc/objrepos
  devices.usbif.08025002.rte
                            6.1.7.19  COMMITTED  USB Mass Storage Device
                                                 Software
# cfgmgr -vl usb0
----------------
attempting to configure device 'usb0'
Time: 0 LEDS: 0x2563
invoking /etc/methods/cfgusb -l usb0 
Number of running methods: 1
----------------
Completed method for: usb0, Elapsed time = 16
return code = 0
****************** stdout ***********
usbms0 


****************** no stderr ***********
----------------
Time: 16        LEDS: 0x539
Number of running methods: 0
----------------
attempting to configure device 'usbms0'
Time: 16        LEDS: 0x25a1
invoking /usr/lib/methods/cfgcdrom_usb -l usbms0 
Number of running methods: 1
----------------
Completed method for: usbms0, Elapsed time = 0
return code = 0
****************** no stdout ***********
****************** no stderr ***********
----------------
Time: 16        LEDS: 0x539
Number of running methods: 0
----------------
calling savebase
return code = 0
****************** no stdout ***********
****************** no stderr ***********
Configuration time: 16 seconds

# 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.3         USB Mass Storage

# lscfg -vl usbms0
  usbms0           U789C.001.DQDW860-D1-T1-L1  USB Mass Storage


        Manufacturer................SMART   
        Machine Type and Model......SMART USB 8GB   
        ROM Level.(alterable).......880C
        Serial Number...............880C

# dd if=/dev/cd0 of=/opt/AIX61.iso bs=4096k
946+1 records in.
946+1 records out.

# dd if=/opt/AIX61.iso of=/dev/usbms0 bs=4096k
946+1 records in.
946+1 records out.

在現有AIX作業系統上完成以上步驟之後,將USB盤插入到新伺服器或分割槽,啟動分割槽或伺服器,進入SMS選單:
參考上面的內容選擇USB引導啟動,選擇5:


成功通過USB引導:


之後的步驟跟CDROM安裝是相同的。


--end--

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/23135684/viewspace-1061552/,如需轉載,請註明出處,否則將追究法律責任。

相關文章