# oslevel

7.1.0.0

# bootlist -m normal -o

cd0

hdisk0 blv=hd5 pathid=0

hdisk1 blv=hd5 pathid=0

ent0

# bootlist -m normal cd0 hdisk0 ent0

# bootlist -m normal -o

cd0

hdisk0 blv=hd5 pathid=0

ent0

# chpv -c hdisk1

# lspv

hdisk0          00c843b42d414eb9                    rootvg          active      

hdisk1          00c843b4bb3cf61e                    rootvg          active      

# reducevg rootvg hdisk1

0516-016 ldeletepv: Cannot delete physical volume with allocated

        partitions. Use either migratepv to move the partitions or

        reducevg with the -d option to delete the partitions.

0516-884 reducevg: Unable to remove physical volume hdisk1.

# rmdev -dl hdisk1

Method error (/usr/lib/methods/ucfgdevice):

        0514-062 Cannot perform the requested function because the

                 specified device is busy.

# lspv

hdisk0          00c843b42d414eb9                    rootvg          active      

hdisk1          00c843b4bb3cf61e                    rootvg          active 

--------------------------------------分割线---------------------------------------------------------

注:如果有hdisk1有lv参考下边,lv迁移操作,没有lv,直接跳过

# lspv -l hdisk1

hdisk1:

LV NAME               LPs     PPs     DISTRIBUTION          MOUNT POINT

mqmloglv              4       4       00..00..00..00..04    /var/mqm/log

mqmlv                 4       4       00..00..00..00..04    /var/mqm

# migratepv -l mqmloglv hdisk1 hdisk0                         //迁移mqmloglv从hdisk1到hdisk0

# migratepv -l mqmlv hdisk1 hdisk0                              //迁移mqmlv从hdisk1到hdisk0

# lspv -l hdisk1

# reducevg rootvg hdisk1

----------------------------------------分割线-------------------------------------------------------

# lspv

hdisk0          00c843b42d414eb9                    rootvg          active      

hdisk1          00c843b4bb3cf61e                    None   

# bootinfo -B hdisk1

1

# 如果此命令返回值 1,则选择的磁盘可以由 AIX 引导。任何其它值表示 hdisk1 不是rootvg 制作镜像的候选。


# lslpp -L bos.alt_disk_install.rte      //检查是否有安装了alt_disk_install

error: incorrect format: unknown tag

error: incorrect format: unknown tag

error: incorrect format: unknown tag

error: incorrect format: unknown tag

error: incorrect format: unknown tag

error: incorrect format: unknown tag

error: incorrect format: unknown tag

error: incorrect format: unknown tag

error: incorrect format: unknown tag

error: incorrect format: unknown tag

error: incorrect format: unknown tag

error: incorrect format: unknown tag

error: incorrect format: unknown tag

error: incorrect format: unknown tag

error: incorrect format: unknown tag

error: incorrect format: unknown tag

error: incorrect format: unknown tag

error: incorrect format: unknown tag

error: incorrect format: unknown tag

error: incorrect format: unknown tag

error: incorrect format: unknown tag

error: incorrect format: unknown tag

  Fileset                      Level  State  Type  Description (Uninstaller)

  ---------------------------------分割线-------------------------------------------

lslpp: Fileset bos.alt_disk—nstall.rte not installed.



State codes: 

 A -- Applied. 

 B -- Broken. 

 C -- Committed. 

 E -- EFIX Locked. 

 O -- Obsolete.  (partially migrated to newer version) 

 ? -- Inconsistent State...Run lppchk -v. 


Type codes: 

 F -- Installp Fileset 

 P -- Product 

 C -- Component 

 T -- Feature 

 R -- RPM Package 

 E -- Interim Fix 

------------------------------------分割线-----------------------------------------------

如果返回结果:

lslpp: 0504-132  Fileset bos.alt_disk_install.rte not installed

则表明alt_disk_install未安装

将 AIX 第二张安装盘放入光驱, 安装 alt_disk_install 文件集.

# geninstall -d/dev/cd0 bos.alt_disk_install.rte

这里对于安装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_fwdump.
Creating logical volume alt_lg_dumplv.
Creating logical volume alt_livedump.
Creating logical volume alt_lv_u01.
Creating logical volume alt_mqmlv.
Creating logical volume alt_mqmloglv.
Creating /alt_inst/ file system.
Creating /alt_inst/admin file system.
Creating /alt_inst/home file system.
Creating /alt_inst/opt file system.
Creating /alt_inst/tmp file system.
Creating /alt_inst/u01 file system.
Creating /alt_inst/usr file system.
Creating /alt_inst/var file system.
Creating /alt_inst/var/adm/ras/livedump file system.
Creating /alt_inst/var/adm/ras/platform file system.
Creating /alt_inst/var/mqm file system.
Creating /alt_inst/var/mqm/log file system.
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/mqm/log
forced unmount of /alt_inst/var/mqm/log
forced unmount of /alt_inst/var/mqm
forced unmount of /alt_inst/var/mqm
forced unmount of /alt_inst/var/adm/ras/platform
forced unmount of /alt_inst/var/adm/ras/platform
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/u01
forced unmount of /alt_inst/u01
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...
#
# lspv
hdisk0          00c843b42d414eb9                    rootvg          active     
hdisk1          00c843b4bb3cf61e                    altinst_rootvg            

# bootlist -m normal -o
cd0
hdisk0 blv=hd5 pathid=0
# lspv -l hdisk1
0516-010 : Volume group must be varied on; use varyonvg command.

将克隆磁盘移植到新服务器。
    将hdisk1插入新服务器,新插入的盘不会自动引导系统的启动,需要在分区启动时进入SMS菜单,手动指定磁盘启动。

重启后:

# lspv
hdisk0          00c843b42d414eb9                    None           
hdisk1          00c843b4bb3cf61e                      
rootvg          active    

# df -g                                                                             
Filesystem    GB blocks      Free %Used    Iused %Iused Mounted on                  
/dev/hd4          20.00     10.48   48%    78570     4% /                           
/dev/hd2           6.00      0.26   96%    60669    48% /usr                        
/dev/hd9var        5.00      1.79   65%     8402     2% /var                        
/dev/hd3           5.00      2.96   41%     3948     1% /tmp                        
/dev/fwdump        1.25      1.25    1%       12     1% /var/adm/ras/platform       
/dev/hd1          20.00     18.46    8%      137     1% /home                       
/dev/hd11admin      0.25      0.25    1%        5     1% /admin                     
/proc                 -         -    -         -     -  /proc                       
/dev/hd10opt       5.00      4.69    7%     9799     1% /opt                        
/dev/livedump      0.25      0.25    1%        4     1% /var/adm/ras/livedump       
/dev/lv_u01       50.00     41.63   17%     1877     1% /u01                        
/dev/mqmlv         1.00      1.00    1%      245     1% /var/mqm                    
/dev/mqmloglv      1.00      1.00    1%        9     1% /var/mqm/log 

# lspv -l hdisk1                                                                    
hdisk1:                                                                             
LV NAME               LPs     PPs     DISTRIBUTION          MOUNT POINT             
mqmloglv              4       4       00..00..00..00..04    /var/mqm/log            
fwdump                5       5       00..05..00..00..00    /var/adm/ras/platform   
hd6                   77      77      00..77..00..00..00    N/A                     
hd8                   1       1       00..00..01..00..00    N/A                     
hd11admin             1       1       00..01..00..00..00    /admin                  
hd5                   1       1       01..00..00..00..00    N/A                     
mqmlv                 4       4       00..00..00..00..04    /var/mqm                
hd9var                20      20      00..20..00..00..00    /var                    
hd3                   20      20      00..00..04..16..00    /tmp                    
lv_u01                200     200     21..05..00..73..101   /u01                    
hd4                   80      80      00..00..80..00..00    /                       
livedump              1       1       00..01..00..00..00    /var/adm/ras/livedump   
hd2                   24      24      00..00..24..00..00    /usr                    
lg_dumplv             8       8       08..00..00..00..00    N/A                     
hd1                   80      80      80..00..00..00..00    /home                   
hd10opt               20      20      00..00..00..20..00    /opt

 

 此克隆磁盘并移植完成。