地址:兰州市城关区科技街88号
电话:(86)0931-8265989
传真:(86)0931-8260768
手机:13909315556
邮箱:ygb@lzyglx.com
#经常遇到主机A的卷组需要在B主机上导入需求
#主机A、主机B识别的存储设备序号可能不同(hdisk编号、vpath编号)
#后面是简化操作的方法,确保导入卷组的正确性
#主机A收集VG pvid信息
lsvg | sort | while read vg
do
pvid=`lspv | grep $vg | sed -n 1p | awk '{print $2}'`
pv=`lspv | grep $vg | sed -n 1p | awk '{print $1}'`
echo "-y $vg \`lspv | grep $pvid | awk '{print \$1}'\`"
done
输出结果如下: 综合结算
-y d8kdbinitvg01 `lspv | grep 00ce8b9c6de954b3 | awk '{print $1}'`
-y d8kjsdatavg01 `lspv | grep 00ce8b9c6de95b1f | awk '{print $1}'`
-y d8kjsdatavg02 `lspv | grep 00ce8b9c6de95fcc | awk '{print $1}'`
-y d8kjsdatavg03 `lspv | grep 00ce8b9c6de9694b | awk '{print $1}'`
-y d8kjsdatavg04 `lspv | grep 00ce8b9c6de972fc | awk '{print $1}'`
-y d8kjsdbvg01 `lspv | grep 00ce8b9c6de5411d | awk '{print $1}'`
-y d8kjsdbvg02 `lspv | grep 00ce8b9c6de54cc1 | awk '{print $1}'`
-y d8kjsdbvg03 `lspv | grep 00ce8b9c6de55653 | awk '{print $1}'`
-y d8kjsdbvg04 `lspv | grep 00ce8b9c6de56302 | awk '{print $1}'`
-y d8kjsdbvg05 `lspv | grep 00ce8b9c6de56c83 | awk '{print $1}'`
-y d8kjsdbvg06 `lspv | grep 00ce8b9c6de6db8c | awk '{print $1}'`
-y d8kjsdbvg07 `lspv | grep 00ce8b9c6de5760f | awk '{print $1}'`
-y dbinitvg01 `lspv | grep 0052dc3fe606a9ed | awk '{print $1}'`
-y jsdatavg01 `lspv | grep 0052dc3fdc756c09 | awk '{print $1}'`
-y jsdatavg02 `lspv | grep 0052dc3fe6038a0c | awk '{print $1}'`
-y jsdatavg03 `lspv | grep 0052dc3fe6047b38 | awk '{print $1}'`
-y jsdbvg01 `lspv | grep 0052dc3fe5d48112 | awk '{print $1}'`
-y jsdbvg02 `lspv | grep 0052dc3fe5ec37aa | awk '{print $1}'`
-y jsdbvg03 `lspv | grep 0052dc3fe5ecc7e3 | awk '{print $1}'`
-y jsdbvg04 `lspv | grep 0052dc3fe5ee8d1d | awk '{print $1}'`
-y jsdbvg05 `lspv | grep 0052dc3fdc756760 | awk '{print $1}'`
-y jsdbvg06 `lspv | grep 0052dc3fdc7569c9 | awk '{print $1}'`
-y jsdbvg07 `lspv | grep 0052dc3fdc756d28 | awk '{print $1}'`
-y jsdbvg08 `lspv | grep 0052dc3fdc756f68 | awk '{print $1}'`
-y rootvg `lspv | grep 00ce8b9c900ea29f | awk '{print $1}'`
# 根据具体情况删除不需要在主机B上导入的卷组,比如rootvg等
# UltraEdit编写、调整完成最终导入卷组命令 如下
lvlstmajor #主机B空闲的major number
75.... #显示75以后都可用
# 最终导入命令如下
importvg -V75 -y d8kdbinitvg01 `lspv | grep 00ce8b9c6de954b3 | awk '{print $1}'`
importvg -V76 -y d8kjsdatavg01 `lspv | grep 00ce8b9c6de95b1f | awk '{print $1}'`
importvg -V77 -y d8kjsdatavg02 `lspv | grep 00ce8b9c6de95fcc | awk '{print $1}'`
importvg -V78 -y d8kjsdatavg03 `lspv | grep 00ce8b9c6de9694b | awk '{print $1}'`
importvg -V79 -y d8kjsdatavg04 `lspv | grep 00ce8b9c6de972fc | awk '{print $1}'`
importvg -V80 -y d8kjsdbvg01 `lspv | grep 00ce8b9c6de5411d | awk '{print $1}'`
importvg -V81 -y d8kjsdbvg02 `lspv | grep 00ce8b9c6de54cc1 | awk '{print $1}'`
importvg -V82 -y d8kjsdbvg03 `lspv | grep 00ce8b9c6de55653 | awk '{print $1}'`
importvg -V83 -y d8kjsdbvg04 `lspv | grep 00ce8b9c6de56302 | awk '{print $1}'`
importvg -V84 -y d8kjsdbvg05 `lspv | grep 00ce8b9c6de56c83 | awk '{print $1}'`
importvg -V85 -y d8kjsdbvg06 `lspv | grep 00ce8b9c6de6db8c | awk '{print $1}'`
importvg -V86 -y d8kjsdbvg07 `lspv | grep 00ce8b9c6de5760f | awk '{print $1}'`