免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2114 | 回复: 0
打印 上一主题 下一主题

创建根盘镜像流程 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-02-01 14:31 |只看该作者 |倒序浏览

   节前巡检发现两台数据库服务器没有做根盘镜像,可能是上次恢复系统以后,把以前的镜像恢复没有了,决定当天在重起机器前做两台服务器的根盘镜像
操作步骤:
日终结帐完毕以后操作执行
1、把/dev/dsk/c1t0d0作为c0t0d0的镜像

2、检查/tmp/partitionfile文件,如果没有则创建一个分区列表文件,为后面的idisk作准备
szxsrv1#[/]vi /tmp/partitionfile     

3
EFI 500MB
HPUX 100%
HPSP 400MB

3、Create the system, OS, and service partitions.
szxsrv1#[/]idisk -wf /tmp/partitionfile /dev/rdsk/c1t0d0
idisk version: 1.31
********************** WARNING ***********************
If you continue you may destroy all data on this disk.
Do you wish to continue(yes/no)? yes

EFI Primary Header:
        Signature                 = EFI PART
        Revision                  = 0x10000
        HeaderSize                = 0x5c
        HeaderCRC32               = 0xa2414a99
        MyLbaLo                   = 0x1
        AlternateLbaLo            = 0x87ac6bf
        FirstUsableLbaLo          = 0x22
        LastUsableLbaLo           = 0x87ac69c
        Disk GUID                 = be75a30e-cf4e-11dc-8001-d6217b60e588
        PartitionEntryLbaLo       = 0x2
        NumberOfPartitionEntries  = 0xc
        SizeOfPartitionEntry      = 0x80
        PartitionEntryArrayCRC32  = 0x85ea9453

  Primary Partition Table (in 512 byte blocks):
    Partition 1 (EFI):
        Partition Type GUID       = c12a7328-f81f-11d2-ba4b-00a0c93ec93b
        Unique Partition GUID     = be75a55c-cf4e-11dc-8002-d6217b60e588
        Starting Lba              = 0x22
        Ending Lba                = 0xfa021
    Partition 2 (HP-UX):
        Partition Type GUID       = 75894c1e-3aeb-11d3-b7c1-7b03a0000000
        Unique Partition GUID     = be75a57a-cf4e-11dc-8003-d6217b60e588
        Starting Lba              = 0xfa022
        Ending Lba                = 0x86e469b
    Partition 3 (HPSP):
        Partition Type GUID       = e2a1e728-32e3-11d6-a682-7b03a0000000
        Unique Partition GUID     = be75a598-cf4e-11dc-8004-d6217b60e588
        Starting Lba              = 0x86e469c
        Ending Lba                = 0x87ac69b

EFI Alternate Header:
        Signature                 = EFI PART
        Revision                  = 0x10000
        HeaderSize                = 0x5c
        HeaderCRC32               = 0x4cb8eea3
        MyLbaLo                   = 0x87ac6bf
        AlternateLbaLo            = 0x1
        FirstUsableLbaLo          = 0x22
        LastUsableLbaLo           = 0x87ac69c
        Disk GUID                 = be75a30e-cf4e-11dc-8001-d6217b60e588
        PartitionEntryLbaLo       = 0x87ac69e
        NumberOfPartitionEntries  = 0xc
        SizeOfPartitionEntry      = 0x80
        PartitionEntryArrayCRC32  = 0x85ea9453

  Alternate Partition Table (in 512 byte blocks):
    Partition 1 (EFI):
        Partition Type GUID       = c12a7328-f81f-11d2-ba4b-00a0c93ec93b
        Unique Partition GUID     = be75a55c-cf4e-11dc-8002-d6217b60e588
        Starting Lba              = 0x22
        Ending Lba                = 0xfa021
    Partition 2 (HP-UX):
        Partition Type GUID       = 75894c1e-3aeb-11d3-b7c1-7b03a0000000
        Unique Partition GUID     = be75a57a-cf4e-11dc-8003-d6217b60e588
        Starting Lba              = 0xfa022
        Ending Lba                = 0x86e469b
    Partition 3 (HPSP):
        Partition Type GUID       = e2a1e728-32e3-11d6-a682-7b03a0000000
        Unique Partition GUID     = be75a598-cf4e-11dc-8004-d6217b60e588
        Starting Lba              = 0x86e469c
        Ending Lba                = 0x87ac69b

Legacy MBR (MBR Signatures in little endian):
   MBR Signature = 0x6ea275be

Protective MBR

4、在新创建的efi分区里面写入HPUX文件夹,类似于pa机型作mkboot 写lif区
szxsrv1#[/]mkboot -e -l /dev/rdsk/c1t0d0


5、编辑一个auto文件,准备把它copy到efi分区里面去
szxsrv1#[/]echo "boot vmunix -lq" >/tmp/AUTO.lq

6、把刚刚编辑的auto.lq文件copy到c2t0d0s1(c2t0d0的efi分区),放在/EFI/HPUX/AUTO,这一步对应pa机型的mkboot –a “hpux -lq”
szxsrv1#[/]efi_cp -d /dev/rdsk/c1t0d0s1 /tmp/AUTO.lq /EFI/HPUX/AUTO
szxsrv1#[/]efi_cp -d /dev/rdsk/c0t0d0s1 -u /EFI/HPUX/AUTO /tmp/AUTO.pri
szxsrv1#[/]efi_cp -d /dev/rdsk/c1t0d0s1 -u /EFI/HPUX/AUTO /tmp/AUTO.alt

7、把两块根盘的AUTO文件都copy出来,作个检查
szxsrv1#[/]cat /tmp/AUTO.pri
boot vmunix
szxsrv1#[/]cat /tmp/AUTO.alt
boot vmunix –lq

8、/dev/dsk/c1t0d0s2是真正的要放数据的部分,把它作成pv
szxsrv1#[/]pvcreate -fB /dev/rdsk/c1t0d0s2

9、#把c1t0d0s2加入vg00
szxsrv1#[/]vgextend vg00 /dev/dsk/c1t0d0s2

10、编辑一个mirror脚本,里面内容就是lvextend -m 1 /dev/vg00/lvol1~8 /dev/dsk/c1t0d0s2
szxsrv1#[/]vi /tmp/mirror.sh

11、执行mirror脚本
szxsrv1#[/]sh /tmp/mirror.sh

12、把新硬盘加入到bootconf文件中,注意用s2的设备文件
l  /dev/dsk/c0t0d0s2
l  /dev/dsk/c1t0d0s2

13、检查
szxsrv1#[/]vgdisplay -v vg00|more
--- Volume groups ---
VG Name                     /dev/vg00
VG Write Access             read/write
VG Status                   available
Max LV                      255
Cur LV                      8
Open LV                     8
Max PV                      16
Cur PV                      2             ------为2表示当所用PV为两个
Act PV                      2
Max PE per PV               4350
VGDA                        4
PE Size (Mbytes)            16
Total PE                    8568
Alloc PE                    7296
Free PE                     1272
Total PVG                   0
Total Spare PVs             0
Total Spare PVs in use      0

   --- Logical volumes ---
   LV Name                     /dev/vg00/lvol1
   LV Status                   available/syncd    ---syncd代表同步完成,stali正在同步
   LV Size (Mbytes)            1024
   Current LE                  64
   Allocated PE                128
   Used PV                     2             ---为2代表成功

   LV Name                     /dev/vg00/lvol2
   LV Status                   available/syncd
   LV Size (Mbytes)            20480
   Current LE                  1280
   Allocated PE                2560
   Used PV                     2

   LV Name                     /dev/vg00/lvol3
   LV Status                   available/syncd
   LV Size (Mbytes)            2048
   Current LE                  128
   Allocated PE                256
   Used PV                     2

   LV Name                     /dev/vg00/lvol4
   LV Status                   available/syncd
   LV Size (Mbytes)            8192
   Current LE                  512
   Allocated PE                1024
   Used PV                     2

   LV Name                     /dev/vg00/lvol5
   LV Status                   available/syncd
   LV Size (Mbytes)            4096
   Current LE                  256
   Allocated PE                512
   Used PV                     2

   LV Name                     /dev/vg00/lvol6
   LV Status                   available/syncd
   LV Size (Mbytes)            8192
   Current LE                  512
   Allocated PE                1024
   Used PV                     2

   LV Name                     /dev/vg00/lvol7
   LV Status                   available/syncd
   LV Size (Mbytes)            10240
   Current LE                  640
   Allocated PE                1280
   Used PV                     2

   LV Name                     /dev/vg00/lvol8
   LV Status                   available/syncd
   LV Size (Mbytes)            4096
   Current LE                  256
   Allocated PE                512
   Used PV                     2


   --- Physical volumes --###两块硬盘都在vg00里面了,并且剩余和使用的pe数目完全相同
   PV Name                     /dev/dsk/c0t0d0s2
   PV Status                   available
   Total PE                    4284
   Free PE                     636
   Autoswitch                  On

   PV Name                     /dev/dsk/c1t0d0s2
   PV Status                   available
   Total PE                    4284
   Free PE                     636
   Autoswitch                  Onlvlnboot –v                           

#检查一下引导路径
szxsrv1#[/]setboot
Primary bootpath : 0/0/1/1/0.0.0
HA Alternate bootpath : 0/0/4/1/0.0.0
Alternate bootpath : 0/0/4/1/0.0.0
#查看主盘与从盘的硬件路径
ioscan –fnCdisk            
Class     I  H/W Path        Driver   S/W State   H/W Type     Description
===========================================================================
disk      0  0/0/1/1/0.0.0   sdisk    CLAIMED     DEVICE       COMPAQ  BF0728828
5
                            /dev/dsk/c0t0d0     /dev/rdsk/c0t0d0
                            /dev/dsk/c0t0d0s1   /dev/rdsk/c0t0d0s1
                            /dev/dsk/c0t0d0s2   /dev/rdsk/c0t0d0s2
                            /dev/dsk/c0t0d0s3   /dev/rdsk/c0t0d0s3
disk      2  0/0/4/1/0.0.0   sdisk    CLAIMED     DEVICE       COMPAQ  BF0728828
5
                            /dev/dsk/c1t0d0     /dev/rdsk/c1t0d0
                            /dev/dsk/c1t0d0s1   /dev/rdsk/c1t0d0s1
                            /dev/dsk/c1t0d0s2   /dev/rdsk/c1t0d0s2
                            /dev/dsk/c1t0d0s3   /dev/rdsk/c1t0d0s3



镜像创建成功!!!


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u1/59675/showart_474635.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP