免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
楼主: jijianjun
打印 上一主题 下一主题

真诚请教:有关Mirror Disk的镜像操作。 [复制链接]

论坛徽章:
0
1 [报告]
发表于 2003-09-04 10:00 |显示全部楼层

真诚请教:有关Mirror Disk的镜像操作。

(好久没做过啦,理论方法,仅作参考)

->; 在线更换故障硬盘

->; ioscan -fnC disk (Scan for new disk)

->; insf -eCdisk (Install special file for new disk)

->; pvcreate -B /dev/rdsk/cXtYdZ (Create one bootable LVM disk, here /dev/dsk/cXtYdZ is the device file of the new disk)

->; vgextend vg00 /dev/dsk/cXtYdZ

->; mkboot /dev/rdsk/cXtYdZ (Make the new disk a boot disk)

->; lvextend -m 1 /dev/vg00/lvol1 /dev/dsk/cXtYdZ
     lvextend -m 1 /dev/vg00/lvol2 /dev/dsk/cXtYdZ
     lvextend -m 1 /dev/vg00/lvol3 /dev/dsk/cXtYdZ
     ........    ( Mirror the LVs on the rootdisk to the new disk)

->; lvlnboot -b /dev/vg00/lvol1  
     lvlnboot -r /dev/vg00/lvol3
     lvlnboot -s /dev/vg00/lvol2
     lvlnboot -d /dev/vg00/lvol?   (which lv is your dump lv?)
     lvlnboot -R /dev/vg00
                                      (Update the BDRA of the new disk)

->; lvlnboot -v  (Check the update result)

论坛徽章:
0
2 [报告]
发表于 2003-09-04 11:27 |显示全部楼层

真诚请教:有关Mirror Disk的镜像操作。

对,你说的没错,我仔细看了一下,觉得有区别。

你在线换盘的同时,注意此时你并没有vgreduce这块盘。也就是说虽然你的盘是坏的,但这块盘依然在VG中。

vgcfgrestore 的命令实际上是将保存在/etc/lvmconf/下vg00.conf(vg00的VG信息)恢复到磁盘上,正常情况下VG中的每一个PV上都会写有一份Copy, 当LVM配置有任何改变,如lvextend,lvreduce,系统会自动将VG信息更新,保存到/etc/lvmconf下,并更新每个PV上的Copy,所以我的步骤中的vgextend其实已经将新PV上的VG信息更新,所以不需再做vgcfgrestore。

但你此时由于不需做vgreduce,vgextend,所以新硬盘上的VG信息为空!所以vgcfgrestore是唯一有效也是非常简便的方法。vgcfgrestore之后,新换上的磁盘上的VG 信息与原来那块坏的磁盘相同,但LV上的数据还是要用lvextend或vgsync来同步。

lu407,我觉得VG都没有必要deactivate然后再activate,可以在VG Active的时候做,你认为呢?

论坛徽章:
0
3 [报告]
发表于 2003-09-04 13:51 |显示全部楼层

真诚请教:有关Mirror Disk的镜像操作。

大家如果有条件的话实践一下,我这苦于没环境做试验。

WillamCU,我记得hpux -lq 是缺省的吧,所以我没加,你能跟我解释一下 lq 选项具体代表什么含义,我不记得了。

论坛徽章:
0
4 [报告]
发表于 2003-09-04 20:54 |显示全部楼层

真诚请教:有关Mirror Disk的镜像操作。

williamCU说的在理,一个看似简单的问题让我复习和学习了好多知识,温故而知新啊,谢谢大家。

谁能有条件试验一下,在线换的步骤,然后与大家分享一下过程。

论坛徽章:
0
5 [报告]
发表于 2003-09-05 12:42 |显示全部楼层

真诚请教:有关Mirror Disk的镜像操作。

我想如果/etc/lvmtab中有该PV的记录的话,系统则会认为该PV属于某个VG,此时如果pvcreate (即使加 -f 参数也不行),报错如下:
pvcreate: The physical volume "/dev/dsk/c2t2d0" is already recorded in the "/etc/lvmtab" file.
不过hpux老大说他做过试验,我们当然以事实为准,哪位试了以后如果确实如此,我们可以再讨论。

WillamCU, 我的理解是vgcfgrestore只会将VG Configruation(VGRA)恢复到新的磁盘上,但是PV的LVM信息(PVRA)信息应该必须由pvcreate初始化来完成,但我看有的文档上说在线换也没提到pvcreate这一步,所以我也很迷惑。 只能等以后有机会试验一下了。

论坛徽章:
0
6 [报告]
发表于 2003-09-18 13:48 |显示全部楼层

真诚请教:有关Mirror Disk的镜像操作。

To jijianjun:
If the device file of the disk is not changed(actullay in your case it will not be changed because the SCSI controller and target number of the new disk is the same as the old one),
you don't need to do 'vgcfgrestore' with '-o' option.
I think you can just use
'vgcfgrestore -n /dev/vg00 /dev/rdsk/c2t2d0'   
to restore the lvm configuration stored under /etc/lvmconf to the new disk.

And it is not necessary to do 'pvcreate' at all, 'vgcfgrestore' will restore the PVRA to the new disk.

I have tried to do so and I succeeded.

You can try again if you such an opptunity.

BTW, it is unuseful to use '-f' option with 'pvcreate' to forcefully initialize one disk when it is listed in the /etc/lvmtab.
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP