分类: 其他UNIX
2016-08-10 14:55:00
一、安腾根盘镜像:
#vgdisplay -v vg00 #确定已经当前使用的硬盘 /dev/disk/disk6_p2
#ioscan –fnCdisk #确定要用做镜盘的设备名
Class I H/W Path Driver S/W State H/W Type Description
===================================================================
disk 4 64000/0xfa00/0x1 esdisk CLAIMED DEVICE HP DG0146BALVN
/dev/disk/disk4 /dev/disk/disk4_p3 /dev/rdisk/disk4_p2
/dev/disk/disk4_p1 /dev/rdisk/disk4 /dev/rdisk/disk4_p3
/dev/disk/disk4_p2 /dev/rdisk/disk4_p1
#vi /tmp/partitionfile #创建一个分区列表文件,为后面的idisk作准备
3 ---指定要创建的分区数
EFI 500MB ---指定500MB的EFI分区
HPUX 100% ---指定由创建EFI 分区后磁盘上的所有剩余空间所组成的HPUX 分区
HPSP 400MB ---指定400MB的HPSP分区
#idisk -wf /tmp/partitionfile /dev/rdisk/disk4 #创建以上说明文件中指定的分区system, OS, and service分区
可用idisk -p /dev/rdisk/disk4来显示分区信息
idisk version: 1.31
********************** WARNING ***********************
If you continue you may destroy all data on this disk.
Do you wish to continue(yes/no)? yes
#insf –eCdisk #为新划分出来efi分区和service分区创建设备文件
insf: Installing special files for sdisk instance 0 address 0/0/2/0.0.0.0
insf: Installing special files for sdisk instance 1 address 0/1/1/0.0.0
insf: Installing special files for sdisk instance 2 address 0/1/1/0.1.0
insf: Installing special files for sdisk instance 3 address 0/4/1/0.1.0.0.0.0.1
#mkboot -e -l /dev/disk/disk4 #在新创建的efi分区里面写入HPUX文件夹,类似于pa机型作mkboot 写lif区
#mkboot -a "boot vmunix -lq" /dev/disk/disk4
--------------------------------------------------------------------------------------------------------------------------
#echo "boot vmunix -lq" > /tmp/AUTO.lq #编辑一个auto文件,准备把它copy到efi分区里面去
#efi_cp -d /dev/rdisk/disk4_p1 /tmp/AUTO.lq /EFI/HPUX/AUTO
#把刚刚编辑的auto.lq文件copy到disk4_p1(disk4的efi分区),放在/EFI/HPUX/AUTO,这一步对应pa机型的mkboot –a “hpux -lq”
#efi_cp -d /dev/rdisk/disk4_p1 -u /EFI/HPUX/AUTO /tmp/AUTO.pri
#efi_cp -d /dev/rdisk/disk4_p1 -u /EFI/HPUX/AUTO /tmp/AUTO.alt
#cat /tmp/AUTO.pri
boot vmunix
#cat /tmp/AUTO.alt #把两块根盘的AUTO文件都copy出来,作个检查
boot vmunix -lq
----------------------------------------------------------------------------------------------------------------------------------黄色部份是创建auto文件,可直接用make -a "boot vmunix -lq" /dev/disk/disk4来创建auto文件
#pvcreate -fB /dev/rdisk/disk4_p2 #/dev/disk/disk4_p2是真正的要放数据的部分,把它作成pv
Physical volume "/dev/rdsk/c2t0d0s2" has been successfully created.
#vgextend vg00 /dev/disk/disk4_p2 #把disk4_p2加入vg00
Volume group "vg00" has been successfully extended.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf
#for I in 1 2 3 4 5 6 7 8 #做一个循环语句,做镜像
>do
>lvextend –m 1 /dev/vg00/lvol$I /dev/disk/disk4_p2
>done
---要缩短同步镜像副本所需的时间可加在lvextend时加-s,再用lvsync同步
#vi /stand/bootconf #把新硬盘加入到bootconf文件中,注意用p2的设备文件
l /dev/disk/disk6_p2
l /dev/disk/disk4_p2
#vgdisplay -v vg00|more
--- Physical volumes ---
PV Name /dev/disk/disk6_p2
PV Status available
Total PE 4328
Free PE 1457
Autoswitch On
Proactive Polling On
PV Name /dev/disk/disk4_p2
PV Status available
Total PE 4328 #两块硬盘都在vg00里面了,并且剩余和使用的pe数目完全相同
Free PE 1457
Autoswitch On
Proactive Polling On
#lvlnboot –Rv #等同于pa的lvlnboot -v
#ioscan -fnCdisk #查看主盘与从盘的硬件路径
#ioscan -m dsf
#setboot -p 0/1/1/0.1.0 #设置主引导路径
#setboot -h 0/1/1/0.0.0 #设置HA(副)引导路径
#setboot -b on #打开autoboot的选项
#setboot #检查一下引导路径
#lvlnboot -Rv 检查启动路径
HP-UX HA Alternate Boot: 0/1/1/0.0.0 #efi菜单里面多出这样一行,选择从它启动
#grep "Boot device" /var/adm/syslog/syslog.log
Mar 25 16:31:21 tkbjsr01 vmunix: Boot device's HP-UX HW path is: 0/1/1/0.0.0
#查看一下当前是是否从HA路径即我们的镜像盘引导的,到此证明我们的镜像盘配置成功
lvdisplay、vgdisplay、setboot -v检查镜像是否成功
命令解释:
mkboot
mkboot -e 使用基于Itanium 的系统的EFI 布局。通过该选项,mkboot 会将EFI 实用程序从/usr/lib/efi 复制到磁盘上的EFI分区;
mkboot –l 将一些引导用的二进制文件写入LIF预留区。如果使用该选项,则mkboot会将device 视为卷布局磁盘,而无论其当前是否设置为卷布局磁盘。该选项不能与-H和-W选项一起使用。对于任何卷管理器,包括VERITAS Volume Manager (VxVM) 以及LVM,请使用-l 选项。
mkboot –a 在可启动设备LIF 区上有一个名为AUTO的自动引导文件,在从这个设备引导时,会自动执行这个文件中的内容。用这条命令可以去更改AUTO文件的内容。mkboot 会将-a后面的字符串存放到该文件中。
lvlnbooy 准备LVM 逻辑卷,使其成为根卷、引导卷、主交换卷或转储卷
-R 将丢失的任何链接都恢复到引导数据保留区域中指定的所有逻辑卷中,并更新该
卷组中每个可引导物理卷的引导数据保留区域
-v 输出详细消息。如果没有其他参数,则输出有关根卷、引导卷、交换卷
辑卷的信息。如果配置了根-引导组合卷,则不会显示引导卷的信息。
#pvcreate –B /dev/rdsk/c2t2d0
#mkboot –l /dev/rdsk/c2t2d0
#mkboot –a “hpux –lq (;0)/stand/vmunix” /dev/rdsk/c2t2d0
#vgextend /dev/vg00 /dev/dsk/c2t2d0
#for I in 1 2 3 4 5 6 7 8
>do
>lvextend –m 1 /dev/vg00/lvol$I /dev/dsk/c2t2d0
>done
#setboot -h 0/1/0/0/0
#lvlnboot –v
三、去根盘镜像步骤:先去lvreduce去LV镜像,再vgreduce去PV
rx6660#[/]lvreduce -m 0 -A n /dev/vg00/lvol1
Logical volume "/dev/vg00/lvol1" has been successfully reduced.
rx6660#[/]for I in 1 2 3 4 5 6 7 8
> do
> lvreduce -m 0 -A n /dev/vg00/lvol$I
> done
Logical volume "/dev/vg00/lvol1" has been successfully reduced.
Logical volume "/dev/vg00/lvol2" has been successfully reduced.
Logical volume "/dev/vg00/lvol3" has been successfully reduced.
Logical volume "/dev/vg00/lvol4" has been successfully reduced.
Logical volume "/dev/vg00/lvol5" has been successfully reduced.
Logical volume "/dev/vg00/lvol6" has been successfully reduced.
Logical volume "/dev/vg00/lvol7" has been successfully reduced.
Logical volume "/dev/vg00/lvol8" has been successfully reduced.
rx6660#[/]vgreduce /dev/vg00 /dev/disk/disk3
Volume group "/dev/vg00" has been successfully reduced.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf
强制拆镜像:lvreduce -m 0 -k /dev/vg00/vol1