Itanium定位盘位:sasmgr set_attr -D /dev/sasd0 -q lun=/dev/rdsk/c*t*d* -q locate_led=on
1、传统方法换根盘(拆mirror,建mirror)
PA 换根盘操作
ioscan -kfnCdisk
vgdisplay -v vg00 | more
lvdisplay -v /dev/vg00/lvol2
lvdisplay -v -k /dev/vg00/lvol2 | more
/*-k 参数显示pv 的k 值,如果遇到ghost 盘,需要-k来拆除,在lvreduce时候也加上-k 跟上key 值
lvreduce -m 0 -A n /dev/vg00/lvol1 /dev/dsk/c1t15d0 lvreduce -m 0 -A n /dev/vg00/lvol2 /dev/dsk/c1t15d0 lvreduce -m 0 -A n /dev/vg00/lvol3 /dev/dsk/c1t15d0 lvreduce -m 0 -A n /dev/vg00/lvol4 /dev/dsk/c1t15d0 lvreduce -m 0 -A n /dev/vg00/lvol5 /dev/dsk/c1t15d0 lvreduce -m 0 -A n /dev/vg00/lvol6 /dev/dsk/c1t15d0 lvreduce -m 0 -A n /dev/vg00/lvol7 /dev/dsk/c1t15d0 lvreduce -m 0 -A n /dev/vg00/lvol8 /dev/dsk/c1t15d0 lvreduce -m 0 -A n /dev/vg00/lvol9 /dev/dsk/c1t15d0 vgreduce -f vg00 /dev/dsk/c1t15d0
pvchange -a N /dev/dsk/c1t15d0
==============
replace disk
==============
insf -e -H 0/0/2/0.2.0
pvcreate -B /dev/rdsk/c1t15d0 /*如果格式化不成功,或者该硬盘以前用于其他vg,就需要加-f 参数,强制格式化
vgextend /dev/vg00 /dev/dsk/c1t15d0
mkboot /dev/rdsk/c1t15d0
mkboot -a "hpux -lq(;0)/stand/vmunix" /dev/rdsk/c1t15d0 mkboot -a "hpux" /dev/rdsk/c1t15d0
pvdisplay -v /dev/dsk/c3t15d0 | grep 'current.*0000 $' /*检测vg中lv 的顺序,要使两个pv 中lv 的顺序是一致lvextend -m 1 /dev/vg00/lvol1 /dev/dsk/c1t15d0
lvextend -m 1 /dev/vg00/lvol2 /dev/dsk/c1t15d0
lvextend -m 1 /dev/vg00/lvol3 /dev/dsk/c1t15d0
lvextend -m 1 /dev/vg00/lvol4 /dev/dsk/c1t15d0
lvextend -m 1 /dev/vg00/lvol5 /dev/dsk/c1t15d0
lvextend -m 1 /dev/vg00/lvol6 /dev/dsk/c1t15d0
lvextend -m 1 /dev/vg00/lvol7 /dev/dsk/c1t15d0
lvextend -m 1 /dev/vg00/lvol8 /dev/dsk/c1t15d0
for lvol in lvol1 lvol2 lvol3 lvol4 lvol5 lvol6 lvol7 lvol8 /*还有其他命名格式的lv 名称,也可以写在后面
> do
> lvextend -s –m 1 /dev/vg00/$lvol /dev/dsk/c1t15d0
> done lvsync -T /dev/vg00/lvol* /*如果有其他命名的lv,要单独同步,lvol*只能同步lvol 开头的lv,lvextend 加-s 不会再扩展不同步lv,最后由lvsync 统一同步
lvlnboot -b /dev/vg00/lvol1
lvlnboot -r /dev/vg00/lvol3
lvlnboot -s /dev/vg00/lvol2
lvlnboot -d /dev/vg00/lvol2
lvlnboot -R -v /dev/vg00 /*老版本的系统没有安装patch,可能没有-R的参数,需要单独更新vg 信息使用-b -r- s- d setboot -a 0/0/2/0.2.0 /*设置备用启动路径-p 是设置主的启动路径
setboot -v
# vi /stand/bootconf
l /dev/dsk/c1t15d0 /*l代表lvm的意思l是字母L的大写
IA 换根盘操作
ioscan -fnCdisk
vgdisplay -v vg00 | more
lvdisplay -v /dev/vg00/lvol1
. . .
lvdisplay -v /dev/vg00/lvol9
lvdisplay -v -k /dev/vg00/lvol2 | more
lvreduce -m 0 -A n /dev/vg00/lvol1 /dev/disk/disk5_p2 lvreduce -m 0 -A n /dev/vg00/lvol2 /dev/disk/disk5_p2 lvreduce -m 0 -A n /dev/vg00/lvol3 /dev/disk/disk5_p2 lvreduce -m 0 -A n /dev/vg00/lvol4 /dev/disk/disk5_p2 lvreduce -m 0 -A n /dev/vg00/lvol5 /dev/disk/disk5_p2 lvreduce -m 0 -A n /dev/vg00/lvol6 /dev/disk/disk5_p2 lvreduce -m 0 -A n /dev/vg00/lvol7 /dev/disk/disk5_p2 lvreduce -m 0 -A n /dev/vg00/lvol8 /dev/disk/disk5_p2 vgreduce -f vg00 /dev/disk/disk5_p2
=========================
replace disk
=========================
IA 机器上创建根盘镜像
vi /tmp/idf
3
EFI 500MB
HPUX 100%
HPSP 400MB
idisk -f /tmp/idf -w /dev/rdisk/disk5
/*创建分区文件,以及对pv 进行分区,可以用两条命令替代 。print '3\nEFI 500MB\nHPUX 100%\nHPSP 400MB' > /tmp/idf echo yes | idisk -wf /tmp/idf /dev/rdisk/disk5
idisk /dev/rdisk/disk5
insf -e -H 64000/0xfa00/0x3
pvcreate -B /dev/rdisk/disk5_p2
/*如果磁盘以前用在其他vg 当中,需要加f 的参数,强制格式化
vgextend vg00 /dev/disk/disk5_p2
mkboot -e -l /dev/rdisk/disk5
mkboot -a "boot vmunix" /dev/rdisk/disk5
pvdisplay -v /dev/disk/disk5_p2 | grep 'current.*0000 $' lvextend -s -m 1 /dev/vg00/lvol1 /dev/disk/disk5_p2 lvextend -s -m 1 /dev/vg00/lvol2 /dev/disk/disk5_p2 lvextend -s -m 1 /dev/vg00/lvol3 /dev/disk/disk5_p2 lvextend -s -m 1 /dev/vg00/lvol4 /dev/disk/disk5_p2 lvextend -s -m 1 /dev/vg00/lvol5 /dev/disk/disk5_p2 lvextend -s -m 1 /dev/vg00/lvol6 /dev/disk/disk5_p2 lvextend -s -m 1 /dev/vg00/lvol7 /dev/disk/disk5_p2 lvextend -s -m 1 /dev/vg00/lvol8 /dev/disk/disk5_p2
for lvol in lvol1 lvol2 lvol3 lvol4 lvol5 lvol6 lvol7 lvol8 > do
> lvextend -s –m 1 /dev/vg00/$lvol /dev/disk/disk5_p2 > done
lvsync -T /dev/vg00/lvol*
lvlnboot -R -v /dev/vg00
setboot -a /dev/disk/disk5_p2
vi /stand/boot.conf
l /dev/disk/disk5_p2
2 、使用LVM OLR 更换根盘
HP-UX 使用LVM OLR 更换根盘
说说另外一种更换root disk(mirror)的方法
HP-UX 11.11 以及11.23 只有在安装以下补丁后,才支持LVM OLR For 11.11: Patches PHKL_31216 and PHCO_30698
For 11.23: Patches PHKL_32095 and PHCO_31709
HP-UX 11.31 不需要任何补丁,就能支持OLR
或者也可以通过man,查看pvchange 有没有-a 的参数,如果没有只能使用拆mirror,创建mirror 的方法更换root disk
更换步骤:
PA 更换根盘(OLR)
pvchange -a N /dev/dsk/cxtxdx
=========================
replace disk
=========================
insf -eH path
vgcfgrestore -n vg00 /dev/rdsk/cxtxdx
pvchange -a y /dev/dsk/cxtxdx
vgsync
mkboot /dev/rdsk/cxtxdx
mkboot -a "hpux" /dev/rdsk/cxtxdx
lvlnboot -R -v/dev/vg00
setboot -a path
# vi /stand/bootconf
l /dev/dsk/cxtxdx -------------------------------------------------
IA 更换根盘(OLR)
pvchange -a N /dev/disk/disk5
=========================
replace disk
=========================
insf -eH path
vi /tmp/idf
3
EFI 500MB
HPUX 100%
HPSP 400MB
idisk -f /tmp/idf -w /dev/rdisk/disk5
print '3\nEFI 500MB\nHPUX 100%\nHPSP 400MB' > /tmp/idf echo yes | idisk -wf /tmp/idf /dev/rdisk/disk5 vgcfgrestore -n vg00 /dev/rdisk/disk5_p2
pvchange -a y /dev/disk/disk5_p2
vgsync
mkboot -e -l /dev/rdisk/disk5
mkboot -a "boot vmunix" /dev/rdisk/disk5
lvlnboot -R -v /dev/vg00
setboot -a path
# vi /stand/bootconf
l /dev/disk/disk5_p2