分类:
2008-05-11 22:12:31
hostname; date; for vg in `lsvg`
do
lsvg -l $vg |awk '{if($4 !=2*$3 || $5 !=2 || $6 !~ /syncd/) print $0}'
echo ----
lsvg $vg |grep QUORUM
echo ----
for lv in `lsvg -l $vg |tail +3 |awk '{print $1}'`
do
echo LV NAME: $lv
lslv -m $lv |awk '{if($3 ~ /hdisk/) print $3,$5,$7}' |sort |uniq
echo
done
echo -----------------------------
echo
done
下面以脚本在一台机器上执行的结果(下面结果实际是脚本未完善前的输出)为例,进行简单说明:
rootvg: 所有stale的、LPs与PPs不是2倍的关系的,PVs不是2的LV,都会在这里出现。
LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
hd5 boot 6 18 3 closed/syncd N/A
dumplv01 jfs 45 45 1 open/syncd N/A
----
LV NAME: hd5 这个说明有3份mirror,可以不管
hdisk3 hdisk2 hdisk0
LV NAME: hd6 这个说明没有mirror,且lv跨了pv,不安全
hdisk0
hdisk2
LV NAME: hd8
hdisk0 hdisk3
LV NAME: hd10opt 同上
hdisk2
hdisk3
LV NAME: hd4
hdisk3 hdisk2
LV NAME: hd2
hdisk3 hdisk2
LV NAME: hd3
hdisk3 hdisk2
LV NAME: hd1 这个说明lv先跨了pv,后来才做的mirror,也可以不管
hdisk2 hdisk3
hdisk3 hdisk2
LV NAME: logslv
hdisk2 hdisk3
LV NAME: dumplv01 没有mirror的情况
hdisk2
LV NAME: hd9var 正常情况——2份mirror
hdisk3 hdisk2
-----------------------------
datavg:
LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
lv01 jfs 512 512 1 open/syncd /data
----
LV NAME: lv01
hdisk4
LV NAME: loglv01
hdisk5 hdisk4
LV NAME: lv04
hdisk5 hdisk1
LV NAME: lv00
hdisk4
hdisk5
-----------------------------
vg00:
LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
loglv02 jfslog 1 1 1 open/syncd N/A
lv02 jfs 489 489 1 open/syncd /db
lv06 jfs 520 520 1 open/syncd /db2bkup
----
LV NAME: loglv02
hdisk6
LV NAME: lv02
hdisk6
LV NAME: lv06
hdisk6
-----------------------------
vg01:
LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
loglv03 jfslog 1 1 1 open/syncd N/A
lv03 jfs 489 489 1 open/syncd /app
lv05 jfs 489 489 1 open/syncd /db2log
----
LV NAME: loglv03
hdisk7
LV NAME: lv03
hdisk7
LV NAME: lv05
hdisk7