天天看點

HP-UX 11.31磁盤鏡像制作過程

1、檢視vg00:

   vgdisplay -v /dev/vg00 ;

VG Name                     /dev/vg00

VG Write Access             read/write    

VG Status                   available           

PE Size (Mbytes)            32             

Total PE                    4347   

Alloc PE                    1134   

Free PE                     3213  

   --- Logical volumes ---

   LV Name                     /dev/vg00/lvol1

   LV Name                     /dev/vg00/lvol2

   LV Name                     /dev/vg00/lvol3

   LV Status                   available/syncd          

   LV Name                     /dev/vg00/lvol4

   LV Name                     /dev/vg00/lvol5

   LV Name                     /dev/vg00/lvol6

   LV Name                     /dev/vg00/lvol7

   LV Name                     /dev/vg00/lvol8

    --- Physical volumes ---

   PV Name                     /dev/disk/disk3_p2

2、檢視磁盤:

# ioscan -m lun | grep disk

disk      3  64000/0xfa00/0x1   esdisk  CLAIMED     DEVICE       online  HP 146 GST3146707LC      

                      /dev/disk/disk3      /dev/disk/disk3_p2(已用)   /dev/rdisk/disk3     /dev/rdisk/disk3_p2

                      /dev/disk/disk3_p1   /dev/disk/disk3_p3   /dev/rdisk/disk3_p1  /dev/rdisk/disk3_p3

disk      5  64000/0xfa00/0x3   esdisk  CLAIMED     DEVICE       online  HP 146 GST3146707LC      

                      /dev/disk/disk5   /dev/rdisk/disk5

        即:

根盤是:/dev/rdisk/disk3

鏡像盤是:/dev/rdisk/disk5

即我安裝OS是,隻用了/dev/disk/disk3,沒有使用/dev/disk/disk5。

3、# ioscan -kfnC disk

Class     I  H/W Path       Driver S/W State   H/W Type     Description

=======================================================================

disk      0  1/0/0/3/0.6.0  sdisk   CLAIMED     DEVICE       HP 146 GST3146707LC

                           /dev/dsk/c0t6d0     /dev/dsk/c0t6d0s2   /dev/rdsk/c0t6d0    /dev/rdsk/c0t6d0s2

                           /dev/dsk/c0t6d0s1   /dev/dsk/c0t6d0s3   /dev/rdsk/c0t6d0s1  /dev/rdsk/c0t6d0s3

disk      1  1/0/0/3/1.2.0  sdisk   CLAIMED     DEVICE       _NEC    DVD_RW ND-3550A

                           /dev/dsk/c1t2d0   /dev/rdsk/c1t2d0

disk      2  1/0/1/1/0/1/1.6.0  sdisk   CLAIMED     DEVICE       HP 146 GST3146707LC

                           /dev/dsk/c3t6d0   /dev/rdsk/c3t6d0

4、# ioscan -kfNC disk

Class     I  H/W Path  Driver S/W State   H/W Type     Description

===================================================================

disk      3  64000/0xfa00/0x1  esdisk   CLAIMED     DEVICE       HP 146 GST3146707LC

disk      4  64000/0xfa00/0x2  esdisk   CLAIMED     DEVICE       _NEC    DVD_RW ND-3550A

disk      5  64000/0xfa00/0x3  esdisk   CLAIMED     DEVICE       HP 146 GST3146707LC

5、編寫磁盤的table檔案,并導入到mirror盤:

   # mkdir /tmp/mirror/  

# vi /tmp/mirror/table  輸入以下内容:

 3

EFI 500MB

HPUX 100%

HPSP 400MB

6、#idisk -wf /tmp/mirror/table /dev/rdisk/disk5

idisk version: 1.44

********************** 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               = 0x2620902f

        MyLbaLo                   = 0x1

        MyLbaHi                   = 0x0

        AlternateLbaLo            = 0x1117732f

        AlternateLbaHi            = 0x0

        FirstUsableLbaLo          = 0x40

        FirstUsableLbaHi          = 0x0

        LastUsableLbaLo           = 0x111772ff

        LastUsableLbaHi           = 0x0

        Disk GUID                 = 997d49ae-3bb3-11e2-8000-d6217b60e588

        PartitionEntryLbaLo       = 0x2

        PartitionEntryLbaHi       = 0x0

        NumberOfPartitionEntries  = 0xc

        SizeOfPartitionEntry      = 0x80

        PartitionEntryArrayCRC32  = 0x71ac1709

  Primary Partition Table (in 512 byte blocks):

    Partition 1 (EFI):

        Partition Type GUID       = c12a7328-f81f-11d2-ba4b-00a0c93ec93b

        Unique Partition GUID     = 997d4cce-3bb3-11e2-8000-d6217b60e588

        Starting Lba Lo            = 0x40

        Starting Lba Hi            = 0x0

        Ending Lba Lo              = 0xf9fff

        Ending Lba Hi              = 0x0

    Partition 2 (HP-UX):

        Partition Type GUID       = 75894c1e-3aeb-11d3-b7c1-7b03a0000000

        Unique Partition GUID     = 997d4ce2-3bb3-11e2-8000-d6217b60e588

        Starting Lba Lo            = 0xfa000

        Starting Lba Hi            = 0x0

        Ending Lba Lo              = 0x110af7ff

        Ending Lba Hi              = 0x0

    Partition 3 (HPSP):

        Partition Type GUID       = e2a1e728-32e3-11d6-a682-7b03a0000000

        Unique Partition GUID     = 997d4cf6-3bb3-11e2-8000-d6217b60e588

        Starting Lba Lo            = 0x110af800

        Starting Lba Hi            = 0x0

        Ending Lba Lo              = 0x111772ff

        Ending Lba Hi              = 0x0

EFI Alternate Header:

        Signature                 = EFI PART

        Revision                  = 0x10000

        HeaderSize                = 0x5c

        HeaderCRC32               = 0xadde15b

        MyLbaLo                   = 0x1117732f

        MyLbaHi                   = 0x0

        AlternateLbaLo            = 0x1

        AlternateLbaHi            = 0x0

        FirstUsableLbaLo          = 0x40

        FirstUsableLbaHi          = 0x0

        LastUsableLbaLo           = 0x111772ff

        LastUsableLbaHi           = 0x0

        Disk GUID                 = 997d49ae-3bb3-11e2-8000-d6217b60e588

        PartitionEntryLbaLo       = 0x1117730f

        PartitionEntryLbaHi       = 0x0

        NumberOfPartitionEntries  = 0xc

        SizeOfPartitionEntry      = 0x80

        PartitionEntryArrayCRC32  = 0x71ac1709

  Alternate Partition Table (in 512 byte blocks):

    Partition 1 (EFI):

        Partition Type GUID       = c12a7328-f81f-11d2-ba4b-00a0c93ec93b

        Unique Partition GUID     = 997d4cce-3bb3-11e2-8000-d6217b60e588

        Starting Lba Lo            = 0x40

        Starting Lba Hi            = 0x0

        Ending Lba Lo              = 0xf9fff

        Ending Lba Hi              = 0x0

    Partition 2 (HP-UX):

        Partition Type GUID       = 75894c1e-3aeb-11d3-b7c1-7b03a0000000

        Unique Partition GUID     = 997d4ce2-3bb3-11e2-8000-d6217b60e588

        Starting Lba Lo            = 0xfa000

        Starting Lba Hi            = 0x0

        Ending Lba Lo              = 0x110af7ff

        Ending Lba Hi              = 0x0

    Partition 3 (HPSP):

        Partition Type GUID       = e2a1e728-32e3-11d6-a682-7b03a0000000

        Unique Partition GUID     = 997d4cf6-3bb3-11e2-8000-d6217b60e588

        Starting Lba Lo            = 0x110af800

        Starting Lba Hi            = 0x0

        Ending Lba Lo              = 0x111772ff

        Ending Lba Hi              = 0x0

7、檢視是否導入成功:

#idisk /dev/rdisk/disk5

 idisk version: 1.44

EFI Primary Header:

        Signature                 = EFI PART

        Revision                  = 0x10000

        HeaderSize                = 0x5c

        HeaderCRC32               = 0x2620902f

        MyLbaLo                   = 0x1

        MyLbaHi                   = 0x0

        AlternateLbaLo            = 0x1117732f

        AlternateLbaHi            = 0x0

        FirstUsableLbaLo          = 0x40

        FirstUsableLbaHi          = 0x0

        LastUsableLbaLo           = 0x111772ff

        LastUsableLbaHi           = 0x0

        Disk GUID                 = 997d49ae-3bb3-11e2-8000-d6217b60e588

        PartitionEntryLbaLo       = 0x2

        PartitionEntryLbaHi       = 0x0

        NumberOfPartitionEntries  = 0xc

        SizeOfPartitionEntry      = 0x80

        PartitionEntryArrayCRC32  = 0x71ac1709

  Primary Partition Table (in 512 byte blocks):

    Partition 1 (EFI):

        Partition Type GUID       = c12a7328-f81f-11d2-ba4b-00a0c93ec93b

        Unique Partition GUID     = 997d4cce-3bb3-11e2-8000-d6217b60e588

        Starting Lba Lo            = 0x40

        Starting Lba Hi            = 0x0

        Ending Lba Lo              = 0xf9fff

        Ending Lba Hi              = 0x0

    Partition 2 (HP-UX):

        Partition Type GUID       = 75894c1e-3aeb-11d3-b7c1-7b03a0000000

        Unique Partition GUID     = 997d4ce2-3bb3-11e2-8000-d6217b60e588

        Starting Lba Lo            = 0xfa000

        Starting Lba Hi            = 0x0

        Ending Lba Lo              = 0x110af7ff

        Ending Lba Hi              = 0x0

    Partition 3 (HPSP):

        Partition Type GUID       = e2a1e728-32e3-11d6-a682-7b03a0000000

        Unique Partition GUID     = 997d4cf6-3bb3-11e2-8000-d6217b60e588

        Starting Lba Lo            = 0x110af800

        Starting Lba Hi            = 0x0

        Ending Lba Lo              = 0x111772ff

        Ending Lba Hi              = 0x0

EFI Alternate Header:

        Signature                 = EFI PART

        Revision                  = 0x10000

        HeaderSize                = 0x5c

        HeaderCRC32               = 0xadde15b

        MyLbaLo                   = 0x1117732f

        MyLbaHi                   = 0x0

        AlternateLbaLo            = 0x1

        AlternateLbaHi            = 0x0

        FirstUsableLbaLo          = 0x40

        FirstUsableLbaHi          = 0x0

        LastUsableLbaLo           = 0x111772ff

        LastUsableLbaHi           = 0x0

        Disk GUID                 = 997d49ae-3bb3-11e2-8000-d6217b60e588

        PartitionEntryLbaLo       = 0x1117730f

        PartitionEntryLbaHi       = 0x0

        NumberOfPartitionEntries  = 0xc

        SizeOfPartitionEntry      = 0x80

        PartitionEntryArrayCRC32  = 0x71ac1709

  Alternate Partition Table (in 512 byte blocks):

    Partition 1 (EFI):

        Partition Type GUID       = c12a7328-f81f-11d2-ba4b-00a0c93ec93b

        Unique Partition GUID     = 997d4cce-3bb3-11e2-8000-d6217b60e588

        Starting Lba Lo            = 0x40

        Starting Lba Hi            = 0x0

        Ending Lba Lo              = 0xf9fff

        Ending Lba Hi              = 0x0

    Partition 2 (HP-UX):

        Partition Type GUID       = 75894c1e-3aeb-11d3-b7c1-7b03a0000000

        Unique Partition GUID     = 997d4ce2-3bb3-11e2-8000-d6217b60e588

        Starting Lba Lo            = 0xfa000

        Starting Lba Hi            = 0x0

        Ending Lba Lo              = 0x110af7ff

        Ending Lba Hi              = 0x0

    Partition 3 (HPSP):

        Partition Type GUID       = e2a1e728-32e3-11d6-a682-7b03a0000000

        Unique Partition GUID     = 997d4cf6-3bb3-11e2-8000-d6217b60e588

        Starting Lba Lo            = 0x110af800

        Starting Lba Hi            = 0x0

        Ending Lba Lo              = 0x111772ff

        Ending Lba Hi              = 0x0

Legacy MBR (MBR Signatures in little endian):

   MBR Signature = 0x40497d99

8 、安裝分好區的裝置檔案;

# insf  -eCdisk

将新磁盤制作成引導磁盤,需要注意的是要使用字元裝置:

# mkboot -e -l /dev/rdisk/disk5

9、修改兩塊磁盤的引導模式:

(-lq 不進行quorum 檢查,當一個VG 隻有少于等于50%的硬碟可以正常通路時,預設情況下就不能被激活,加這個參數以後就可以強行激活,在配置了根盤鏡像的情況下經常會用到這個參數)。

# mkboot -a "boot vmunix -lq" /dev/rdisk/disk3;  根盤。

# mkboot -a "boot vmunix -lq" /dev/rdisk/disk5;  鏡像盤。

# efi_cp -d /dev/rdisk/disk3_p1 -u /efi/hpux/auto /dev/tty;    --檢視是否修改成功;

# efi_cp -d /dev/rdisk/disk5_p1 -u /efi/hpux/auto /dev/tty;    --檢視是否修改成功;

10、 将新盤(鏡像盤)的p2分區格式化成PV:

# pvcreate -fB /dev/rdisk/disk5_p2;

          Physical volume "/dev/rdisk/disk5_p2" has been successfully created.

11、 将新盤的p2分區加入到VG00中:

# vgextend vg00 /dev/disk/disk5_p2  ;

12 、鏡像VG00中的所有LV;

# for lv in /dev/vg00/lvol*

> do

> lvextend -m 1 $lv /dev/disk/disk5_p2;

> done

注意:這裡 > 是指令符合,回車後自動産生的。

13、恢複所有的BDRA資訊:

# lvlnboot -R

           Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf

14、 檢視鏡像情況:

      # lvlnboot  -v 

15、修改引導配置檔案:

# vi /stand/bootconf

l  /dev/disk/disk3_p2         字母“l”(L 的小寫形式)代表 LVM 。

2  /dev/disk/disk5_p2

16、設定系統引導的裝置及順序:

# ioscan -fnCdisk

Class     I  H/W Path       Driver S/W State   H/W Type     Description

=======================================================================

disk      0  1/0/0/3/0.6.0  sdisk   CLAIMED     DEVICE       HP 146 GST3146707LC

                           /dev/dsk/c0t6d0     /dev/dsk/c0t6d0s2   /dev/rdsk/c0t6d0    /dev/rdsk/c0t6d0s2

                           /dev/dsk/c0t6d0s1   /dev/dsk/c0t6d0s3   /dev/rdsk/c0t6d0s1  /dev/rdsk/c0t6d0s3

disk      1  1/0/0/3/1.2.0  sdisk   CLAIMED     DEVICE       _NEC    DVD_RW ND-3550A

                           /dev/dsk/c1t2d0   /dev/rdsk/c1t2d0

disk      2  1/0/1/1/0/1/1.6.0  sdisk   CLAIMED     DEVICE       HP 146 GST3146707LC

                           /dev/dsk/c3t6d0     /dev/dsk/c3t6d0s2   /dev/rdsk/c3t6d0    /dev/rdsk/c3t6d0s2

                           /dev/dsk/c3t6d0s1   /dev/dsk/c3t6d0s3   /dev/rdsk/c3t6d0s1  /dev/rdsk/c3t6d0s3

         # ioscan -m lun | grep disk

         # ioscan -m lun /dev/disk/disk3

         # ioscan -m lun /dev/disk/disk5

# setboot -p 1/0/0/3/0.6.0    ,p表示主引導裝置

# setboot -h 1/0/1/1/0/1/1.6.0     ,h表示備用引導裝置

17、重新啟動系統,驗證鏡像是否成功,檢視是否從設定的裝置磁盤引導:

        # shutdown -ry 0     重新開機時選擇所要啟動的路徑。

# grep "Boot" /var/adm/syslog/syslog.log

Jul 26 22:11:13 rac1 vmunix: Boot device's HP-UX HW path is: 1/0/0/3/0.0x6.0x0