实验的目的:

1、是把hdisk0 所在的rootvg 克隆到hdisk1,克隆完成后从hdisk1启动,观察系统的正确性,在通过设置从hdisk0启动,观察系统的正确性;

2、修改hdisk0 中的某个文件后,将启动设置为hdisk1启动,观察盘内有无修改的文件,说明克隆和镜像的不同



root@testdb:/# lspv
hdisk0          0007388ca583b447                    rootvg          active      
hdisk1          0007388ca7a889a1                    None                        
hdisk2          000b0856ec68f5de                    testvg          active      
hdisk3          000b0856eede6bdd                    testvg          active      
root@testdb:/# smit

Move cursor to desired item and press Enter.

[TOP]
  Software Installation and Maintenance
  Software License Management
  Manage Editions
  Devices
  System Storage Management (Physical & Logical Storage)
  Security & Users
  Communications Applications and Services
  Workload Partition Administration
  Print Spooling
  Advanced Accounting
  Problem Determination
  Manage the AIX Cryptographic Framework
  Performance & Resource Scheduling
  System Environments
  Processes & Subsystems
  Applications



                                               Software Installation and Maintenance

Move cursor to desired item and press Enter.

  Install and Update Software
  List Software and Related Information
  Software Maintenance and Utilities
  Software Service Management
  Relocatable Software Installation and Maintenance
  Network Installation Management
  EZ NIM (Easy NIM Tool)
  System Workload Partition Software Maintenance
  System Backup Manager
  Alternate Disk Installation
  EFIX Management
  Thin Server Maintenance
 


                                                   Alternate Disk Installation

Move cursor to desired item and press Enter.

  Install mksysb on an Alternate Disk
  Clone the rootvg to an Alternate Disk
  NIM Alternate Disk Migration
 
                                                 Clone the rootvg to an Alternate Disk

Type or select values in entry fields.
Press Enter AFTER making all desired changes.
 
[TOP]                                                   [Entry Fields]
* Target Disk(s) to install                       [hdisk1]

//克隆盘要是一个free的盘;                                                                    +
  Phase to execute                                    all                                                                        +
  p_w_picpath.data file                                    []                                                                           /
  Exclude list                                       []                                                                           /
 
  Bundle to install                                  []                                                                          +
    -OR-
  Fileset(s) to install                              []
 
  Fix bundle to install                              []
    -OR-
  Fixes to install                                   []
 
  Directory or Device with p_w_picpaths                    []
  (required if filesets, bundles or fixes used)
 
  installp Flags
  COMMIT software updates?                            yes                                                                        +
  SAVE replaced files?                                no                                                                         +
  AUTOMATICALLY install requisite software?           yes                                                                        +
  EXTEND file systems if space needed?                yes                                                                        +
  OVERWRITE same or newer versions?                   no                                                                         +
  VERIFY install and check file sizes?                no                                                                         +
  ACCEPT new license agreements?                      yes


 on next reboot?                                  yes

 


Command: OK            stdout: yes           stderr: no

Before command completion, additional instructions may appear below.

[TOP]
Calling mkszfile to create new /p_w_picpath.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      


克隆完毕..........


root@testdb:/# lspv
hdisk0          0007388ca583b447                    rootvg          active      
hdisk1          0007388ca7a889a1                    altinst_rootvg              
hdisk2          000b0856ec68f5de                    testvg          active      
hdisk3          000b0856eede6bdd                    testvg          active

hdisk1 的标志altinst_rootvg

root@testdb:/# bootlist -m normal -o    //完成后,启动盘变为克隆盘
hdisk1 blv=hd5 


重启系统后如下


root@testdb:/# lspv
hdisk0          0007388ca583b447                    old_rootvg                  
hdisk1          0007388ca7a889a1                    rootvg          active      
hdisk2          000b0856ec68f5de                    testvg          active      
hdisk3          000b0856eede6bdd                    testvg          active 


hdisk0 变为了old_rootvg ,重新启动后由hdisk1引导磁盘。     


root@testdb:/# lsvg -l rootvg     //文件系统和挂载点均没有变化。
rootvg:
LV NAME             TYPE       LPs     PPs     PVs  LV STATE      MOUNT POINT
hd5                 boot       1       1       1    closed/syncd  N/A
hd6                 paging     6       6       1    open/syncd    N/A
hd8                 jfs2log    1       1       1    open/syncd    N/A
hd4                 jfs2       82      82      1    open/syncd    /
hd2                 jfs2       9       9       1    open/syncd    /usr
hd9var              jfs2       50      50      1    open/syncd    /var
hd3                 jfs2       5       5       1    open/syncd    /tmp
hd1                 jfs2       37      37      1    open/syncd    /home
hd10opt             jfs2       3       3       1    open/syncd    /opt
hd11admin           jfs2       1       1       1    open/syncd    /admin
lg_dumplv           sysdump    4       4       1    open/syncd    N/A
livedump            jfs2       1       1       1    open/syncd    /var/adm/ras/livedump


在克隆盘上创建新的文件


root@testdb:/# mkdir testkelong
root@testdb:/# cd testkelong
root@testdb:/testkelong# touch testfile
root@testdb:/testkelong# ls -l
total 0
-rw-r--r--    1 root     system            0 Sep 01 21:38 testfile


把启动顺序改为hdisk0



root@testdb:/testkelong# bootlist -m normal hdisk0
root@testdb:/testkelong#
root@testdb:/testkelong# bootlist -m normal -o
hdisk0 blv=hd5


重启系统后 看到系统盘上没有刚刚新建的文件夹 ;

root@testdb:/# ls -al |grep testkelong

克隆rootvg的可以作为日常升级前或作为备份的一种手段;