aix 克隆rootvg(rootvg 存在镜像关系)

ARCHIVE FOR THE ‘CLONING ROOTVG TO A SINGLE DISK WHEN THE DISK IS MIRRORED’ CATEGORY!!!

系统版本

# uname -a
AIX test 1 6 00C2D8D44C00
# oslevel -s
6100-09-00-0000

系统环境

# lscfg -l hdisk0
  hdisk0           U78A0.001.DNWH9HP-P2-D3  SAS Disk Drive (300000 MB)
# lscfg -l hdisk1
  hdisk1           U78A0.001.DNWH9HP-P2-D4  SAS Disk Drive (300000 MB)
# lscfg -l hdisk2
  hdisk2           U78A0.001.DNWH9HP-P2-D5  SAS Disk Drive (300000 MB)
# lscfg -l hdisk3
  hdisk3           U78A0.001.DNWH9HP-P2-D6  SAS Disk Drive (300000 MB)                      
# lspv
hdisk0          00c2d8d49b5110cb                    rootvg          active      
hdisk1          00c2d8d400129a3f                    rootvg          active      
hdisk2          00c2d8d49b50c66c                    None                        
hdisk3          00c2d8d49b51115f                    None                        
hdisk4          00c824c04ee09efc                    None                        
hdisk5          00c2d8d49b51548e                    None                        
# lsvg -l rootvg
rootvg:
LV NAME             TYPE       LPs     PPs     PVs  LV STATE      MOUNT POINT
hd5                 boot       1       2       2    closed/syncd  N/A
hd6                 paging     1       2       2    open/syncd    N/A
hd8                 jfs2log    1       2       2    open/syncd    N/A
hd4                 jfs2       2       4       2    open/syncd    /
hd2                 jfs2       5       10      2    open/syncd    /usr
hd9var              jfs2       1       2       2    open/syncd    /var
hd3                 jfs2       1       2       2    open/syncd    /tmp
hd1                 jfs2       1       2       2    open/syncd    /home
hd10opt             jfs2       1       2       2    open/syncd    /opt
hd11admin           jfs2       1       2       2    open/syncd    /admin
lg_dumplv           sysdump    8       8       1    open/syncd    N/A
livedump            jfs2       1       2       2    open/syncd    /var/adm/ras/livedump

1,克隆rootvg到hdisk2

rootvg 已经存在hdisk0,hdisk1 两块磁盘,为镜像关系

lsvg -p rootvg
rootvg:
PV_NAME           PV STATE          TOTAL PPs   FREE PPs    FREE DISTRIBUTION
hdisk0            active            558         534         111..102..98..111..112
hdisk1            active            558         542         111..110..98..111..112

# lsvg -l rootvg       
rootvg:
LV NAME             TYPE       LPs     PPs     PVs  LV STATE      MOUNT POINT
hd5                 boot       1       2       2    closed/syncd  N/A
hd6                 paging     1       2       2    open/syncd    N/A
hd8                 jfs2log    1       2       2    open/syncd    N/A
hd4                 jfs2       2       4       2    open/syncd    /
hd2                 jfs2       5       10      2    open/syncd    /usr
hd9var              jfs2       1       2       2    open/syncd    /var
hd3                 jfs2       1       2       2    open/syncd    /tmp
hd1                 jfs2       1       2       2    open/syncd    /home
hd10opt             jfs2       1       2       2    open/syncd    /opt
hd11admin           jfs2       1       2       2    open/syncd    /admin
lg_dumplv           sysdump    8       8       1    open/syncd    N/A
livedump            jfs2       1       2       2    open/syncd    /var/adm/ras/livedump

2,生成image.data,并修改相关参数

生产image.data,默认位置在/目录下。

# mkszfile -X

使用vi 修改如下2个参数

COPIES= 2修改为COPIES= 1
hdisk1修改为hdisk0((IF ROOTVG HAS hdisk0 and hdisk1 ))

:1,$s/COPIES= 2/COPIES= 1/
:1,$s/hdisk1/hdisk0/

3,克隆rootvg 到hdisk3

# alt_disk_copy -B -O -g -i /image.data -P all -d hdisk2  
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_lg_dumplv
Creating logical volume alt_livedump
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/usr file system.
Creating /alt_inst/var file system.
Creating /alt_inst/var/adm/ras/livedump 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/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...
# bootlist -m normal  -o
hdisk0 blv=hd5 pathid=0
# lspv
hdisk0          00c2d8d49b5110cb                    rootvg          active      
hdisk1          00c2d8d400129a3f                    rootvg          active      
hdisk2          00c2d8d49b50c66c                    altinst_rootvg              
hdisk3          00c2d8d49b51115f                    None                        
hdisk4          00c824c04ee09efc                    None                        
hdisk5          00c2d8d49b51548e                   None    

销毁

alt_disk_copy -Od hdisk3

报错

# alt_disk_copy -Od hdisk3
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
0516-404 allocp: This system cannot fulfill the allocation request.
        There are not enough free partitions or not enough physical volumes 
        to keep strictness and satisfy allocation requests.  The command
        should be retried with different allocation characteristics.
0516-822 mklv: Unable to create logical volume.
0505-115 alt_disk_install: mklv failed to create logical volume hd5.
Cleaning up.

使用2块大小相同的磁盘做克隆

# lspv
hdisk0          00c2d8d49b5110cb                    rootvg          active      
hdisk1          00c2d8d400129a3f                    rootvg          active      
hdisk2          00c2d8d49b50c66c                    None                        
hdisk3          00c2d8d4002f433c                    None                        
hdisk4          00c824c04ee09efc                    None                        
hdisk5          00c2d8d49b51548e                    None                        
# alt_disk_copy -Od "hdisk2 hdisk3"      
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_lg_dumplv
Creating logical volume alt_livedump
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/usr file system.
Creating /alt_inst/var file system.
Creating /alt_inst/var/adm/ras/livedump 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/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...
Bootlist is set to the boot disk: hdisk2
hdisk3 blv=hd5
# lspv
hdisk0          00c2d8d49b5110cb                    rootvg          active      
hdisk1          00c2d8d400129a3f                    rootvg          active      
hdisk2          00c2d8d49b50c66c                    altinst_rootvg              
hdisk3          00c2d8d4002f433c                    altinst_rootvg              
hdisk4          00c824c04ee09efc                    None                        
hdisk5          00c2d8d49b51548e                    None                        
# bootlist -m normal -o
hdisk2 blv=hd5 pathid=0
hdisk3 blv=hd5 pathid=0
# 

hdisk2,hdisk3也是镜像关系

# lsvg -l rootvg
rootvg:
LV NAME             TYPE       LPs     PPs     PVs  LV STATE      MOUNT POINT
hd5                 boot       1       2       2    closed/syncd  N/A
hd6                 paging     1       2       2    open/syncd    N/A
hd8                 jfs2log    1       2       2    open/syncd    N/A
hd4                 jfs2       2       4       2    open/syncd    /
hd2                 jfs2       5       10      2    open/syncd    /usr
hd9var              jfs2       1       2       2    open/syncd    /var
hd3                 jfs2       1       2       2    open/syncd    /tmp
hd1                 jfs2       1       2       2    open/syncd    /home
hd10opt             jfs2       1       2       2    open/syncd    /opt
hd11admin           jfs2       1       2       2    open/syncd    /admin
lg_dumplv           sysdump    8       8       1    open/syncd    N/A
livedump            jfs2       1       2       2    open/syncd    /var/adm/ras/livedump
# lsvg -p rootvg
rootvg:
PV_NAME           PV STATE          TOTAL PPs   FREE PPs    FREE DISTRIBUTION
hdisk2            active            558         534         111..102..98..111..112
hdisk3            active            558         542         111..110..98..111..112

# lspv -l hdisk2
hdisk2:
LV NAME               LPs     PPs     DISTRIBUTION          MOUNT POINT
livedump              1       1       00..01..00..00..00    /var/adm/ras/livedump
lg_dumplv             8       8       00..08..00..00..00    N/A
hd11admin             1       1       00..00..01..00..00    /admin
hd10opt               1       1       00..00..01..00..00    /opt
hd1                   1       1       00..00..01..00..00    /home
hd3                   1       1       00..00..01..00..00    /tmp
hd9var                1       1       00..00..01..00..00    /var
hd2                   5       5       00..00..05..00..00    /usr
hd4                   2       2       00..00..02..00..00    /
hd8                   1       1       00..00..01..00..00    N/A
hd6                   1       1       00..01..00..00..00    N/A
hd5                   1       1       01..00..00..00..00    N/A
# lspv -l hdisk3
hdisk3:
LV NAME               LPs     PPs     DISTRIBUTION          MOUNT POINT
livedump              1       1       00..01..00..00..00    /var/adm/ras/livedump
hd11admin             1       1       00..00..01..00..00    /admin
hd10opt               1       1       00..00..01..00..00    /opt
hd1                   1       1       00..00..01..00..00    /home
hd3                   1       1       00..00..01..00..00    /tmp
hd9var                1       1       00..00..01..00..00    /var
hd2                   5       5       00..00..05..00..00    /usr
hd4                   2       2       00..00..02..00..00    /
hd8                   1       1       00..00..01..00..00    N/A
hd6                   1       1       00..01..00..00..00    N/A
hd5                   1       1       01..00..00..00..00    N/A
# lspv
hdisk0          00c2d8d49b5110cb                    None                        
hdisk1          00c2d8d400129a3f                    None                        
hdisk2          00c2d8d49b50c66c                    rootvg          active      
hdisk3          00c2d8d4002f433c                    rootvg          active      
hdisk4          00c824c04ee09efc                    None                        
hdisk5          00c2d8d49b51548e                    None                        
# lsvg rootvg
VOLUME GROUP:       rootvg                   VG IDENTIFIER:  00c2d8d400004c00000000000039e250
VG STATE:           active                   PP SIZE:        512 megabyte(s)
VG PERMISSION:      read/write               TOTAL PPs:      1116 (571392 megabytes)
MAX LVs:            256                      FREE PPs:       1076 (550912 megabytes)
LVs:                12                       USED PPs:       40 (20480 megabytes)
OPEN LVs:           11                       QUORUM:         1 (Disabled)
TOTAL PVs:          2                        VG DESCRIPTORS: 3
STALE PVs:          0                        STALE PPs:      0
ACTIVE PVs:         2                        AUTO ON:        no
MAX PPs per VG:     32512                                     
MAX PPs per PV:     1016                     MAX PVs:        32
LTG size (Dynamic): 1024 kilobyte(s)         AUTO SYNC:      no
HOT SPARE:          no                       BB POLICY:      relocatable 
PV RESTRICTION:     none                     INFINITE RETRY: no
DISK BLOCK SIZE:    512                                       
# 
  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值