HP官方文件:
HP ITRC 文件編號:KBRC00014036※ 存取文件需要 ITRC 帳號
※ 以下程序僅為紀錄用,實際相關作業,請依照各自系統狀態、環境調整,如不確定作業程序,建議請原廠工程師支援。
### 透過以下指令,編輯一個檔案
vi /tmp/partitionfile
### HPUX 11.23 的 partitionfile 檔案內容如下:
3
EFI 500MB
HPUX 100%
HPSP 400MB
### 此時置入新硬碟,透過指令ioscan,重新掃描匯流排,這個動作需要點時間
ioscan -f
### 確認一下啟動磁碟的組成
vgcfgrestore -l -n vg00
## 或直接檢視vg00設定檔
strings /etc/lvmtab
### 確認 vg00 磁碟狀態
vgdisplay -v vg00
### 本例故障的磁碟為 c3t0d0,但請依照實際狀況變更
### 以下的c3t0d0,皆須替換為實際的「故障磁碟代號」
### 重新建立HPUX的 base partition,這個動作會摧毀目的磁碟內的資料,請小心!
idisk -wf /tmp/partitionfile /dev/rdsk/c3t0d0
### 再重新掃描一下,讓系統抓到新的 partition
ioscan -f
### 建立相關的device file
cd /dev
umaks 022
insf -eCdisk
### 安裝啟動程式至硬碟
mkboot -e -l /dev/dsk/c3t0d0
### 還原磁碟 vg 設定,那個cxdxtxs2的s2就照打
vgcfgrestore -n vg00 /dev/rdsk/c3t0d0s2
### 如果上面vgcfgrestore指令失敗,請執行以下指令後,再執行一次vgcfgrestore
pvchange -a n /dev/dsk/c3t0d0s2
### 確認上面vgcfgrestore完成後,執行pvchange
pvchange -a y /dev/dsk/c3t0d0s2
### 同步資料,146G會需要約40~60min
vgsync vg00
### 確認一下 root、boot、swap、dump的 lvol
lvlnboot -v
### 準備 Root、Boot、Swap、Dump的volume,請依照上一程序的結果執行
### 以下的灰字為註解,請忽略
lvlnboot -r /dev/vg00/lvol3 ### (Root)
lvlnboot -b /dev/vg00/lvol1 ### (boot)
lvlnboot -s /dev/vg00/lvol2 ### (swap)
lvlnboot -d /dev/vg00/lvol2 ### (dump)
### 執行指令,確認是否恢復,如果正常,應該不會有任何訊息
lvdisplay -v /dev/vg00/lvol* |grep stale
### 確認啟動磁碟(一般為VG00)之 cxdxtx 編號,可透過ioscan尋找hardware path
### 亦可透過 strings /etc/lvmtab 再確認一次磁碟編號
### 本例hw
path為
### 磁碟0:/dev/dsk/c2t1d0 HW Path:0/1/1/0.1.0
### 磁碟1:/dev/dsk/c3t0d0 HW Path:0/1/1/1.0.0
ioscan -funC disk
### 設定boot EFI 啟動參數
setboot -p
0/1/1/0.1.0
setboot -h 0/1/1/1.0.0
作業完成
Posted by 椰子殼