歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Unix知識 >> 關於Unix >> 做一個新的Mirror boot disk 步驟(hpux)

做一個新的Mirror boot disk 步驟(hpux)

日期:2017/2/28 11:26:14   编辑:關於Unix


1、將BDRA信息寫入另一個mirror的boot disk 。保留固定的(fixed)2912KB空間給LVM header。
#pvcreate -f -B /dev/rdsk/cXtYdZ (因為要做啟動盤一定要加上 -B option)
BDRA:
Information about Boot/Swap/Root LVs ( maior /minor number, etc.)
Information about PVs in root VG
僅僅只用 -f option是不行的,因為這個選擇僅僅-force 強制寫入PVRA信息到disk。這裡的LVM header只有PVRA和VGRA,header sizes of non-bootable disk is not fixed ,但是一定小於2912KB。
2、將cXtYdZ添加到vg00中
#vgextend /dev/vg00 /dev/dsk/cXtYdZ
3、寫LIF header 和LIF files(ISL,AUTO,HPUX,LABEL)
ISL,initial system loader
#mkboot -l /dev/rdsk/cXtYdZ
#lifls -l /dev/rdsk/cXtYdZ-----(check it)
4、做mirror,將disk上的LV鏡像到當前盤,有很多LV,我們可以使用shell loop在自動完成。有興趣可以試試!
#lvextend -m 1 /dev/vg00/lvol 1 /dev/dsk/cXtYdZ
#lvextend -m 1 /dev/vg00/lvol 2 /dev/dsk/cXtYdZ
#lvextend -m 1 /dev/vg00/lvol 3 /dev/dsk/cXtYdZ
#for lvol in lvol1 lvol2 ... lvol 9 (指定你所要mirror的LV)
>do
>lvextend -m 1 /dev/vg00/$lvol /dev/rdsk/cXtYdZ
>done
5、write AUTO文件內容
#mkboot -a "hpux -lq(;0)/stand/vmunix" /dev/rdsk/cXtYdZ
這裡要注意的是,hpux 和-lq 中間有一個空格,如果沒有加空格從新盤啟動時,系統會直接進入ISL>,然後繼續敲hpux -lq 就正常起來了,進入系統再重新做一次mkboot,再測試就沒有問題了。
#lifcp /dev/rdsk/cXtYdZ:AUTO- (check it)
在這裡設置的AUTO文件,繞過了quorum否則兩塊盤按照quorum機制是不能正常啟動的。quorum的解釋我有發過,請大家參考。
6、write LABEL文件內容。
#lvlnboot -b /dev/vg00/lvol 1
#lvlnboot -s /dev/vg00/lvol 2
#lvlnboot -r /dev/vg00/lvol 3
#lvlnboot -d /dev/vg00/lvol 2
b-boot、s-swap、r-root、d-dump
#lvlnboot -v (check it )
注意:lvlnboot –Rv( 確保BDRA已經update,這個命令是確認寫入的)。直接執行這個命令就不用分個指定boot、swap、root、dump。
7、修改boot ALT路徑為mirror disk
setboot -a
# setboot -p 0/0/0/0.0.0 設定原來的硬盤路徑為主啟動(primary)
# setboot -a 0/0/0/0.1.0 使用 mirrored disk’s hw path 將磁盤設定為alt


以是做一個新的mirror,下面是更換根盤的步驟,大家也看到了,其實做一個mirror並不是很復雜但是重要的是細心,不要出錯。
1、首先掃描系統disk,找出有問題的disk,
#ioscan -fnCdisk
2、 查看系統中的VG和VG內包括的PV.現在是更換更換根盤。我們要更換根盤,所以要看vg00下的disk,確認壞盤是在vg00下的。
#strings etc/lvmtab
3、確定cXtYdZ的位置
#dd if=/dev/rdsk/cXtYdZ of=/dev/null bs=1024k cXtYdZ 的狀態燈長亮(其它的disk在正常的情況下,燈都是閃爍的)
4、確定pv上的lvol信息,開始去除mirror。
#lvdiplay –v lvol*|more
#lvreduce –m 0 /dev/vg00/lvol1 /dev/dsk/cXtYdZ

#lvreduce –m 0 /dev/vg00/lvol8 /dev/dsk/cXtYdZ
可以使用shell loop
#for lvol in lvol1 lvol2 lvol3……lvol8
>do
>lvreduce –m 0 /dev/vg00/$lvol /dev/dsk/cXtYdZ
>done
5、將disk從VG中去除
#vgreduce /dev/vg00 /dev/dsk/cXtYdZ
6、更換硬盤
7、#ioscan -fnCdisk 查看系統是否發現磁盤和狀態
8、恢復LVM header 信息到磁盤,注意,用vgcfgrestore 恢復過就無法執行pvcreate了
#vgcfgrestore –n /dev/vg00 /dev/rdsk/cXtYdZ
9、激活VG #vgchange –a y /dev/vg00
10、同步數據 #vgsync
Copyright © Linux教程網 All Rights Reserved