就一般生产系统而已,操作系统层面都要进行备份,而最常见的操作系统备份方式之一就是做镜像(mirror),而实践过程中,往往是把rootvg这个卷组做镜像操作。查看rootvg是否已经进行镜像方法:

1) lsvg –o

2)lsvg –l rootvg

# 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     16      32      2    open/syncd    N/A
hd8                      jfs2log    1       2       2    open/syncd    N/A
hd4                      jfs2       12      24      2    open/syncd    /
hd2                     jfs2       10      20      2    open/syncd    /usr
hd9var                jfs2       6       12      2    open/syncd    /var
hd3                     jfs2       6       12      2    open/syncd    /tmp
hd1                     jfs2       400     800     2    open/syncd    /home
hd10opt            jfs2       1       2       2    open/syncd    /opt
hd11admin       jfs2       1       2       2    open/syncd    /admin
fwdump             jfs2       2       4       2    open/syncd    /var/adm/ras/platform
lg_dumplv         sysdump    3       3       1    open/syncd    N/A
livedump           jfs2       1       2       2    open/syncd    /var/adm/ras/livedump

如上图所示,LPs与PPs的比例是1:2证明rootvg已经做了镜像,即做了一份rootvg的副本,便于操作系统层面出现问题时,及时还原。如果LPs与PPs的比例是1:1这表名是没有做rootvg镜像的。而且PVs都是2,证明是两块物理磁盘做的镜像操作。

1 查看rootvg大小

# lsvg rootvg
VOLUME GROUP:       rootvg                   VG IDENTIFIER:  00f9150300004c0000000145634ba48d
VG STATE:           active                              PP SIZE:        1024 megabyte(s)
VG PERMISSION:      read/write               TOTAL PPs:      1116 (1142784 megabytes)
MAX LVs:            256                                   FREE PPs:       199 (203776 megabytes)
LVs:                13                                           USED PPs:       917 (939008 megabytes)
OPEN LVs:           12                                     QUORUM:         1 (Disabled)
TOTAL PVs:          2                                      VG DESCRIPTORS: 3
STALE PVs:          0                                       STALE PPs:      0
ACTIVE PVs:         2                                      AUTO ON:        yes
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

rootvg大小为1142784MB,但实际可用空间只是这个数据的一般,即:571392MB,因为你做了一份镜像操作。

2 查看rootvg有哪几个磁盘组成

# lspv
hdisk0          00f91503634b9132                    rootvg          active     
hdisk1          00f91503639b9dbf                    rootvg          active     
hdisk2          00f91503747466fd                    datavg          active     
hdisk3          00f915037474679d                    datavg          active     
hdisk4          00f91503ac90ba5d                    datavg          active     
hdisk5          00f91503bbd0aea1                    datavg          active     
hdisk6          none                                None

可见,rootvg是由hisk0和hdisk1两个磁盘组成。

3 给rootvg做镜像

  使用命令为mirrorvg。mirrorvg命令将给已存在某个卷组上的逻辑卷最镜像操作。与此相同功能的命令为mklvcopy。

语法:

Purpose

Mirrors all the logical volumes that exist on a given volume group.

Syntax

mirrorvg [ -S | -s ] [ -Q ] [ -c copies] [ -m ] [ -p copyn=mirrorpool ] volumegroup [ physicalvolume ... ]

-c copies
            Specifies the minimum number of copies that each logical volume must have after the mirrorvg command has finished
            executing. It may be possible, through the independent use of mklvcopy, that some logical volumes may have more than
            the minimum number specified after the mirrorvg command has executed. Minimum value is 2 and 3 is the maximum value. A
            value of 1 is ignored.

-m exact map
            Allows mirroring of logical volumes in the exact physical partition order that the original copy is ordered. This
            option requires you to specify a PhysicalVolume(s) where the exact map copy should be placed. If the space is
            insufficient for an exact mapping, then the command will fail. You should add new drives or pick a different set of
            drives that will satisfy an exact logical volume mapping of the entire volume group. The designated disks must be
            equal to or exceed the size of the drives which are to be exactly mirrored, regardless of if the entire disk is used.
            Also, if any logical volume to be mirrored is already mirrored, this command will fail.

-S Background Sync
           Returns the mirrorvg command immediately and starts a background syncvg of the volume group. With this option, it is
           not obvious when the mirrors have completely finished their synchronization. However, as portions of the mirrors
           become synchronized, they are immediately used by the operating system in mirror usage.

-s Disable Sync
           Returns the mirrorvg command immediately without performing any type of mirror synchronization. If this option is
           used, the mirror may exist for a logical volume but is not used by the operating system until it has been synchronized
           with the syncvg command.

假如我们将rootvg的镜像到hdisk1磁盘上,命令如下:

          mirrorvg –S -c 2 rootvg hsisk0 hdisk1

操作完成后,还要执行以下两个命令:

(1) bosboot  The bosboot command is required to customize the bootrec of the newly mirrored drive.

The bosboot command creates a boot file (boot image) from a RAM (Random Access Memory) disk file system and a kernel. This boot image is transferred to a particular media that the ROS boot code recognizes. When the machine is powered on or rebooted, the ROS boot code loads the boot image from the media into memory. ROS then transfers control to the loaded images kernel.

(2) bootlist  The bootlist command needs to be performed to instruct the system which disk and order you prefer the mirrored boot process to start.

操作如下:

(1)执行bosboot命令

bosboot -ad /dev/hdisk0
            bosboot -ad /dev/hdisk1

(2) 执行bootlist命令: 设置系统的引导顺序

bootlist -m normal hdisk0 hdisk1 cd0

(3) 查看引导熟悉结果

bootlist -o -m normal

4 替换在镜像卷组里的坏盘

当我们发现,在镜像卷组中的一块盘有问题时,需要使用一块新磁盘来顶替这块有问题的磁盘。操作方法如下:

(1) 取消hdisk7盘上的镜像

unmirrorvg workvg hdisk7

(2) 从卷组中删除hdisk7磁盘
            reducevg workvg hdisk7

(3) 系统层面删除hdisk7
            rmdev -l hdisk7 –d

(4) 识别新盘

cfgmgr –v

(5) 重命名磁盘

需要将新识别的磁盘为hdisk7,关于hdiskX的名字是存在操作系统底层的ODM数据库里的,ODM数据库包含了所有PV、VG和LV的配置信息,这些信息与VGDA中的信息互为镜象,ODM数据也和LV控制块中的信息相互镜象。因此需要将原先的hdisk盘从系统层面删除,然后再去重新扫盘,让系统识别出新扫描到的磁盘名称与之前的名称是一致的。

查看物理磁盘命令:lspv

给磁盘一个ID编号:chdev –l hdisk7 –a pv=yes

(6) 将磁盘添加到卷组中

extendvg workvg hdisk7

(7) 查看workvg镜像情况
          mirrorvg workvg

5 取消卷组镜像

    命令:unmirrorvg

Purpose

Removes the mirrors that exist on volume groups or specified disks. This command only applies to AIX 4.2.1 or later.

Syntax

unmirrorvg [ -c Copies ] VolumeGroup [ PhysicalVolume .. . ]

例如:取消workvg卷组镜像,留有一份副本

命令:unmirrorvg -c 1 workvg

6 备注

  When unmirrorvg workvg hdisk7 is run, hdisk7 will be the remaining drive in the volume group. This drive is not actually removed from the volume group. You must run the migratepv command to move the data from the disk that is to be removed from the system to disk hdisk7.

migratepv命令:

Purpose

Moves allocated physical partitions from one physical volume to one or more other physical volumes.

Syntax

migratepv [ -i ] [ -l LogicalVolume ] SourcePhysicalVolume DestinationPhysicalVolume...

Description

The migratepv command moves allocated physical partitions and the data they contain from the SourcePhysicalVolume to one or more other physical volumes. To limit the transfer to specific physical volumes, use the names of one or more physical volumes in the DestinationPhysicalVolume parameter; otherwise, all the physical volumes in the volume group are available for the transfer. All physical volumes must be within the same volume group. The specified source physical volume cannot be included in the list of DestinationPhysicalVolume parameters.

aix rootvg镜像的更多相关文章

  1. (转)AIX rootvg 镜像创建与磁盘更换

    # prtconf | grep disk # chdev -l hdisk1 -a pv=yes # extendvg rootvg hdisk1 # chvg -Qn rootvg # lsvg ...

  2. (转)AIX下镜像制作与取消,更换硬盘问题

    AIX下镜像制作与取消,更换硬盘问题 ROOTVG做镜像问题: 下面命令全部在AIX5.4上运行通过 # lspv hdisk0      000a1ddc7f36a2f0      rootvg   ...

  3. rootvg 镜像

    具体操作步骤如下 : a)        查看一下当前可用的硬盘: # lspv hdisk0          0002d74f0e69d97a                    rootvg ...

  4. (转)rootvg镜像

    步骤1:查看当前还未加入到其它vg的可用PV  # lspv  hdisk0          00027c6a0507fe17                    rootvg          ...

  5. AIX 解除镜像再重建同步

    扩展fs发现pv状态变成removed,用chpv -v -a hdisk即可,至于什么原因造成removed? 一.解除vg mirrorunmirrorvg vgname hdiskx hdisk ...

  6. (转)IBM AIX系统为rootvg实现镜像

    IBM AIX系统为rootvg实现镜像 AIX系统安装的时候,没有选择安装镜像,因此在系统安装完成后,出于安全方面的考虑,决定为rootvg创建镜像. 工具/原料 AIX rootvg lspv c ...

  7. (转)测试rootvg卷组的镜像的官方做法

    测试rootvg卷组的镜像的官方做法 这篇文档介绍了测试rootvg卷组镜像的方法,此文档仅使用于带有热插拔硬盘的pSeries服务器.由于rootvg卷组包含有AIX操作系统,在做卷组镜像配置上比非 ...

  8. AIX 系统参数配置

    AIX 系统参数配置 原创 Linux操作系统 作者:fanhongjie 时间:2008-05-08 22:46:37 540 0 AIX内核属于动态内核,核心参数基本上可以自动调整,因此当系统安装 ...

  9. IBM小机拆镜像换盘

    1.硬盘告警信息     2.故障排查 查看错误日志 #  errpt   -aj   C62E1EB7     查看hdisk0的信息,发现hdisk0属于rootvg # lspv   查看hdi ...

随机推荐

  1. 打印页面时a标签不显示URL的方法

    以前写博客啊,总想写一篇大作,然后希望能挂到博客园首页,隔一会儿看看阅读量有多少.其实哪有那么多大作,大部分时间都是解决了一个小问题,然后需要记录一下.比如下面这篇. 今天遇到一个需求是,打印网页时, ...

  2. Android之密码的显示与隐藏

    很多应用都是显示与隐藏密码的功能. 之前的项目都没这个功能要求,也没有专门研究这个.最近项目有加这个功能,我这里也刚好整理一下. 我的思路是设置EditText的InputType.代码如下: if ...

  3. Spring Boot + Spring Cloud 实现权限管理系统 后端篇(六):集成 Swagger API

    spring-boot作为当前最为流行的Java web开发脚手架,越来越多的开发者选择用其来构建企业级的RESTFul API接口.这些接口不但会服务于传统的web端(b/s),也会服务于移动端.在 ...

  4. WPF设置控件获取键盘焦点时的样式FocusVisualStyle

    控件获取焦点除了用鼠标外,可以通过键盘来获取,比如Tab键或者方向键等,需要设置控件获取键盘焦点时的样式,可以通过设置FrameworkElemnt.FocusVisualStyle属性, 因为几乎所 ...

  5. WPF 中动态改变控件模板

    在某些项目中,可能需要动态的改变控件的模板,例如软件中可以选择不同的主题,在不同的主题下软件界面.控件的样式都会有所不同,这时即可通过改变控件模板的方式实现期望的功能. 基本方法是当用户点击切换主题按 ...

  6. 第四章 使用Servlet处理HTTP请求

      回顾上一章的知识: 请求网络资源HTTP会发出多个请求并得到响应 设置响应状态行关键是设置状态码 在向客户端输出内容之前要设置状态码和响应头 设置响应头让Servlet发挥最大功能 消息体可以用文 ...

  7. 亲身实践 yui-compressor压缩js和css

    最近很懒散,个人感情.家庭原因,没有动力去学东西,老是发誓要搞好前端工程化,老中断,唉!没有魄力! 最近老觉得这前端工程化有什么好的,东西那么多,还得学!直到前几天产品提了个优化,说搜索结果页跳商品详 ...

  8. Net Core 中间件实现修改Action的接收参数及返回值

    新一个WebApi项目(Net Core 2.1) 新建InputOutputAlterMiddleware类,修改命名空间为Microsoft.AspNetCore.Builder(不修改也没关系, ...

  9. 访问 .obj文件,由于扩展配置问题而无法提供您请求的页面。如果该页面是脚本,请添加处理程序。如果应下载文件,请添加 MIME 映射

    一.错误描述 HTTP 错误 404.3 - Not Found 由于扩展配置问题而无法提供您请求的页面.如果该页面是脚本,请添加处理程序.如果应下载文件,请添加 MIME 映射. 最可能的原因: 可 ...

  10. Linux进程间的通信方式和原理

    进程的概念 进程是操作系统的概念,每当我们执行一个程序时,对于操作系统来讲就创建了一个进程,在这个过程中,伴随着资源的分配和释放.可以认为进程是一个程序的一次执行过程. 进程通信的概念 进程用户空间是 ...