免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 4407 | 回复: 1
打印 上一主题 下一主题

如何在AIX上配置PVID????? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2010-08-03 09:55 |只看该作者 |倒序浏览
我在AIX6.1中想要设置一下PVID,\r\n-bash-3.00# chdev -l hd1 -a pv=yes\r\nchdev: 0514-525 Cannot perform the requested function because the\r\n        specified device does not have a change method.\r\n已经存在的PVID\r\n-bash-3.00# lspv\r\nhdisk0          0002ff6f75a00713                    rootvg          active\r\n/dev下的内容\r\n-bash-3.00# ls\r\n.SRC-unix    hd10opt      nuls         ptypb        rmt0         ttyp6\r\nIPL_rootvg   hd11admin    nvram        ptypc        rootvg       ttyp7\r\nSRC          hd2          pci0         ptypd        sad          ttyp8\r\n__vg10       hd3          pci1         ptype        scsi0        ttyp9\r\naudit        hd4          pci2         ptypf        scsi1        ttypa\r\ncd0          hd5          pci3         random       ses0         ttypb\r\ncdlv         hd6          pmem         rcd0         sisscsia0    ttypc\r\nclone        hd8          ptc          rcdlv        slog         ttypd\r\nconsole      hd9var       pts          rhd1         spx          ttype\r\ndlc8023      hdisk0       ptyp0        rhd10opt     sysdump      ttypf\r\ndlcether     ide0         ptyp1        rhd11admin   sysdumpctl   urandom\r\ndlcfddi      ipl_blv      ptyp2        rhd2         sysdumpfile  vio0\r\ndlcqllc      ipldevice    ptyp3        rhd3         sysdumpnull  vty0\r\ndlcsdlc      iscsi0       ptyp4        rhd4         tty          xti\r\ndlctoken     kmem         ptyp5        rhd5         ttyp0        zero\r\ndtremote     lg_dumplv    ptyp6        rhd6         ttyp1\r\necho         log          ptyp7        rhd8         ttyp2\r\nerror        mem          ptyp8        rhd9var      ttyp3\r\nerrorctl     nsmb0        ptyp9        rhdisk0      ttyp4\r\nhd1          null         ptypa        rlg_dumplv   ttyp5\r\n\r\n是不是设置PVID时,只能是 chdev -l hdiskN -a pv=yes(N可以是0,1,2,....)呢?\r\n-bash-3.00# chdev -l hd1 -a pv=yes\r\nchdev: 0514-525 Cannot perform the requested function because the\r\n        specified device does not have a change method.\r\n我该怎么改一下,才能将hd1设置具有PVID?谢谢!

论坛徽章:
0
2 [报告]
发表于 2010-08-03 11:06 |只看该作者
只有相关的资料 没有实践:\r\n\r\nPvid是aix系统中的ODM LVM用于识别PV的序列号,操作系统通过pvid来识别pv,就好像我们每个人的ID card。\r\n\r\n当pv被添加到系统中之后,可以通过两种方式生成pvid\r\n\r\n1,cfgmgr -v\r\n2,lspv 如果没有PVID的话,执行chdev -l hdiskn -a pv=yes\r\n也就是说当系统可以识别硬盘 并将硬盘认可为pv(即lvm的组件)的时候。系统就分配了pvid给硬盘,系统的odm库中保存有pvid。\r\nPvid的生成原则是 主板序列号+形成pv时候的时间戳,pvid除了写入odm库,在硬盘头信息里(0扇区的头几个字节)以及VGDA 也将写入pvid\r\n\r\n\r\nTo make a disk into a physical volume, the PVID is placed onto the disk. ThePVID is an combination of the machine\'s serial number (from the systems EPROMs) and the date the PVID was generated. This combination ensures the extremely low chance of PVIDs being duplicated. When the system is booted, the disk configurator looks at the PVID residing on the disk and compares it with an entry in the ODM. If an entry is found, then the disk is given the hdiskx number in the ODM that is associated with the PVID. If there is no matching entry, then the next name in the pool of \'free\' hdisk names is allocated to the physical volume.\r\n\r\n可以通过 lquerypv -H hdisk0查看pv上的pvid\r\n\r\n\r\nibm150:[/]#lquerypv -H /dev/hdisk0\r\n000af70de396426b0000000000000000\r\nibm150:[/]#lspv\r\nhdisk0 000af70de396426b datavg\r\nhdisk1 000af70d5c816fc2 rootvg\r\nhdisk2 000af70d4d50358c rootvg\r\n\r\n可以看到三个pv的pvid前几位数字是相同的(即主板序列号),后几位数字是不同的。\r\n\r\n可以通过以下方法修改pvid\r\nchdev -l hdisk1 -a pv=clear 清除pv 磁盘头的pvid\r\nchdev -l hdisk1 -a pv=yes 重新定义pvid\r\n\r\n如果pv已经加入卷组,首先还得先varyoffvg ,exportvg\r\n执行以上步骤,pv的pvid将会改变。这里修改的只是磁盘头的pvid,并没有修改vgda中的pvid\r\n\r\n\r\n当pv已经是一个卷组的成员时,切记不要随便修改pvid\r\n\r\n因为当pv加入一个卷组的时候,pvid将被写入vgda,如果你擅自修改卷组的pvid,然后新生成的pvid将不能和卷组vgda中的pvid相匹配,这样就无法importvg,就无法varyonvg,很有可能就会丢失数据!\r\n\r\n当importvg的时候,odm将读取pv上的vgda,如果vgda上pvid与自身磁盘上的pvid不符合的话,将出现错误!\r\n\r\n\r\n注意:当pv加入卷组以后,pvid在硬盘上存在于至少两个地方,一个是在硬盘头,一个是在vgda中。这两个地方的pvid一般是相同的,但是由于pvid的修改,可能造成不一致,这样就有可能丢失数据。\r\n\r\n你可以通过\r\n#lqueryvg -Atp hdisk0 查看pv vgda中的pvid\r\n\r\n\r\nibm150:[/]#lqueryvg -Atp hdisk0\r\nMax LVs: 256\r\nPP Size: 25\r\nFree PPs: 85\r\nLV count: 3\r\nPV count: 1\r\nTotal VGDAs: 2\r\nConc Allowed 0\r\nMAX PPs per 1016\r\nMAX PVs: 32\r\nConc Autovar 0\r\nVaried on Co 0\r\nLogical: 000af70d00004c0000000106e3964781.1 loglv00 1\r\n000af70d00004c0000000106e3964781.2 lv00 1\r\n000af70d00004c0000000106e3964781.3 lv02 1\r\nPhysical: 000af70de396426b 2 0\r\nTotal PPs: 542\r\nLTG size: 128\r\nHOT SPARE: 0\r\nAUTO SYNC: 0\r\nVG PERMISSIO 0\r\n\r\n当然万一修改了,还是有办法恢复数据的!\r\n1, 修复卷组(推荐)\r\n1.首先将原卷组的定义从系统的ODM库中删除:\r\n# exportvg vgname\r\n\r\n2.检查硬盘上VGDA 区的信息,从中得到有关逻辑卷的名称及定义:\r\n如:\r\n\r\n\r\n#lqueryvg -Atp hdisk2\r\nMax LVs: ------256\r\nPP Size: ------26\r\nFree PPs: -----538\r\nLV count: -----2\r\nPV count: -----1\r\nTotal VGDAs: --2\r\nConc Allowed --0\r\nMAX PPs per ---1016\r\nMAX PVs: ------32\r\nConc Autovar --0\r\nVaried on Co --0\r\nLogical: ------0003f62a00004c00000000f52f1737c5.1 --datalv1 1\r\n---------------0003f62a00004c00000000f52f1737c5.2 --datalv2 1\r\nPhysical: -----0003f62a2f135f0e --------------2 ----0\r\nTotal PPs: ----542\r\nLTG size: -----128\r\nHOT SPARE: ----0\r\nAUTO SYNC: ----0\r\nVG PERMISSIO --0\r\n\r\n3.创建逻辑卷名对应表文件。 第一字段为VGDA区中的逻辑卷的名,第二字段为在新卷组中新的逻辑卷名,可相同也可不同;为了修复原有卷组的内容,通常逻辑卷名保持不变。\r\n\r\n如:\r\n\r\n#vi /tmp/lvname\r\ndatalv1:datalv1\r\ndatalv2:datalv2\r\n\r\n4. 在硬盘上重新创建卷组,保留原有卷组的数据结构。\r\n\r\n#recreatevg -y vgname -l lv_file hdisk_name...\r\n如:\r\n#recreatevg -y testvg -l /tmp/lvname hdisk2\r\n\r\n5. 如果卷组上有文件系统,还需修改 /etc/filesystems ,使对应的文件系统的加载点与原来的一致。首先修改/etc/filesystems文件,不行的话就执行下面的步骤\r\n或者:\r\n\r\n如果在重新import后,发现mountpoint不同,可以通过smitty chlv修改lv属性,即修改Logical volume LABEL,使之与mount point相同。\r\n\r\n为什么要修改/etc/filesystem呢?\r\n\r\nrecreatevg 后,系统自动创建了目录/fs,所有的文件系统加载到了/fs下,原来的mountpoint是以/为基准的
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP