HPUX中vg00根盤映象配置方法(一)

liuhaimiao發表於2014-09-16

適用範圍:

     主機本地至少有兩個磁碟,其中作業系統安裝在一塊硬碟上,另一塊硬碟目前未使用,並且沒有使用的硬碟的容量必須等於或者大於已經安裝了作業系統的那塊磁碟。為了提高主機的安全性,避免因本地磁碟上只使用一塊磁碟裝作業系統存在的單點故障導致機器當機的危險,可以使用根盤映象配置的方法消除主機的磁碟單點故障

主要操作步驟:

1,           檢視主機的本地磁碟 

#ioscan knfCdisk

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

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

disk      1  0/0/2/0.6.0   sdisk  CLAIMED     DEVICE       COMPAQ  BF03687B54

                                                      /dev/dsk/c1t6d0   /dev/rdsk/c1t6d0

disk      0  0/0/2/1.6.0   sdisk  CLAIMED     DEVICE       COMPAQ  BF03687B54

                                     /dev/dsk/c2t6d0   /dev/rdsk/c2t6d0

 

2,           檢視本地磁碟使用情況 

#pvdisplay /dev/dsk/c1t6d0

           --- Physical volumes ---

PV Name                     /dev/dsk/c1t6d0

VG Name                     /dev/vg00

PV Status                   available               

Allocatable                 yes         

VGDA                        2  

CurLV                      10    

PE Size (Mbytes)            16             

Total PE                    2170   

Free PE                     147    

Allocated PE                2023       

Stale PE                    0       

IO Timeout (Seconds)        default            

Autoswitch                  On       

  

#pvdisplay /dev/dsk/c2t6d0

                pvdisplay: Couldn't find the volume group to which physical volume "/dev/dsk/c2t6d0" belongs.

pvdisplay: Cannot display physical volume "/dev/dsk/c2t6d0".


           從上述資訊中可以知道:第一塊磁碟(/dev/dsk/c1t6d0)已經被vg00使用,而第二磁碟(/dev/dsk/c2t6d0)未被使用

3,           檢視vg00中包含的lv

#vgdisplay v vg00

      --- Volume groups ---

VG Name                     /dev/vg00

VG Write Access             read/write    

VG Status                   available                

MaxLV                      255   

CurLV                      10    

OpenLV                     10    

Max PV                      16    

Cur PV                      1     

Act PV                      1     

Max PE per PV               4384        

VGDA                        2  

PE Size (Mbytes)            16             

Total PE                    2170   

Alloc PE                    2023   

Free PE                     147    

Total PVG                   0       

Total Spare PVs             0             

Total Spare PVs in use      0                    


                    --- Logical volumes ---

   LV Name                     /dev/vg00/lvol1

               LV Status                   available/syncd          

                LVSize (Mbytes)            512            

                 Current LE                  32       

                   Allocated PE                32         

                   Used PV                     1      

 

   LV Name                     /dev/vg00/lvol2

   LV Status                   available/syncd          

  LVSize (Mbytes)            2048           

   Current LE                  128      

   Allocated PE                128        

   Used PV                     1      

 

              LV Name                     /dev/vg00/lvol3

  LV Status                   available/syncd          

  LVSize (Mbytes)            1024           

   Current LE                  64       

                  Allocated PE                64         

               Used PV                     1      

 

   LV Name                     /dev/vg00/lvol4

   LV Status                   available/syncd          

               LVSize (Mbytes)            512            

              Current LE                  32       

               Allocated PE                32         

              Used PV                     1      

 

   LV Name                     /dev/vg00/lvol5

   LV Status                   available/syncd          

  LVSize (Mbytes)            1024            

   Current LE                  64       

   Allocated PE                64         

   Used PV                     1      

 

   LV Name                     /dev/vg00/lvol6

   LV Status                   available/syncd          

  LVSize (Mbytes)            4096           

   Current LE                  256      

   Allocated PE                256        

   Used PV                     1      

 

   LV Name                     /dev/vg00/lvol7

   LV Status                   available/syncd           

  LVSize (Mbytes)            2048           

   Current LE                  128      

   Allocated PE                128        

   Used PV                     1      

 

   LV Name                     /dev/vg00/lvol8

   LV Status                   available/syncd          

  LVSize (Mbytes)            4096           

   Current LE                  256      

   Allocated PE                256        

   Used PV                     1      

 

   LV Name                     /dev/vg00/oracle

   LV Status                   available/syncd          

  LVSize (Mbytes)            8000           

   Current LE                  500      

   Allocated PE                500        

   Used PV                     1      

 

   LV Name                     /dev/vg00/sybase

   LV Status                   available/syncd          

  LVSize (Mbytes)            9008           

   Current LE                  563      

   Allocated PE                563        

   Used PV                     1      

 

 

   --- Physical volumes ---

   PV Name                     /dev/dsk/c1t6d0

   PV Status                   available               

   Total PE                    2170   

   Free PE                     147    

   Autoswitch                  On   

             從上面的輸出中得知:vg00包含以下lv,分別是lvol1lvol2lvol3lvol4lvol5lvol6lvol7lvol8oraclesybase。因此在映象時,這些lv都需要映象。

4,           格式化第二塊磁碟 

#pvcreate -B /dev/rdsk/c2t6d0

引數-B的作用是將該磁碟格式化為可啟動磁碟

注意:此處必須使用塊裝置 

5,           將第二塊磁碟加入vg00

#vgextend vg00 /dev/dsk/c2t6d0

6,           給新磁碟寫入LIF headerLIF檔案(ISL,AUTO,HPUX,LABEL

    #mkboot l /dev/rdsk/c2t6d0 

     7,    檢視給新磁碟寫入的LIF headerLIF檔案,確保寫入正確

#lifls l /dev/rdsk/c2t6d0

volume c2t6d0 data size 7984 directory size 8 07/08/08 12:44:39

filename   type   start   size     implement  created

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

ISL        -12800 584     306      0          02/05/10 16:25:44

AUTO       -12289 896     1        0          02/05/10 16:25:44

HPUX       -12928 904     848      0          02/05/10 16:25:44

PAD        -12290 1752    1580     0          02/05/10 16:25:45

LABEL      BIN    3336    8        0          07/08/10 17:19:04

          

     8,    vg00中的所有lv複製到一份到第二塊磁碟上

          #for lvol in lvol1 lvol2 lvol3 lvol4 lvol5 lvol6 lvol7 lvol8 oracle sybase

>do

>lvextend m 1 /dev/vg00/$lvol /dev/dsk/c2t6d0

>done

此過程需要一段時間完成,需要耐心等待完成後再操作下一步

 9,    給兩個磁碟的AUTO檔案寫入新的內容

          #mkboot a hpux lq /dev/rdsk/c1t6d0

          #mkboot a hpux lq /dev/rdsk/c2t6d0

          hpux lq意為:autoboot without qurom enforced

     10,  檢視給兩個磁碟的AUTO檔案寫入新的內容是否正確

          #lifcp /dev/rdsk/c1t6d0:AUTO

          hpux -lq

          #lifcp /dev/rdsk/c2t6d0:AUTO

          hpux lq

     

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/223653/viewspace-1270505/,如需轉載,請註明出處,否則將追究法律責任。

相關文章