aix 删除pvidPVID能不能用作ASM磁盘

IBM AIX常用磁盘管理命令
&IBM AIX常用磁盘管理命令
AIX 常用磁盘管理大全,里面有很多常用命令及磁盘问题解决方案
在机器上先exportvg vg0,把ODM数据库中的信息删除,然后再importvg vg0 hdisk1,重新把正确的数据写到ODM库中
AIX 常用磁盘管理命令
一、向系统中添加一块硬盘
方法1,该方法适用于在配置之前,重新启动了系统的情况,系统重新启动时,自动调用cfgmgr,并自动配置新添加的磁盘。
用lspv 查看系统中已配置的磁盘
& & # lspv&
& & & hdisk0 & & & &d7036 & &rootvg
& & & hdisk1 & & & &none & & & & & & & &none
显示结果中,hdisk1是一个新硬盘,没有分配pvid,可以用下面的命令为hdisk配置成一个物理卷:&
& & # chdev &l hdisk1 &a pv=yes &&
该命令就给磁盘hidsk1分配一个唯一的pvid,并将pvid写在该磁盘的引导记录中。如果该磁盘已经有了pvid,则此磁盘就配置成了物理卷。
方法2,该方法适用于配置前不能重新启动系统的情况
1, 先用lspv查看目前存在的物理卷情况
& & & & # lspv
2, 然后调用cfgmgr检查系统中新的设备,并配置新的设备
&# cfgmgr &v
3, 再调用lspv查看,看看是否出现了没有分配pvid的磁盘
4, 如果出现了没有分配pvid的磁盘,用chdev进行配置
&# chdev &l hdisk2 &a pv=yes
方法3,该方法适用于配置之前不能重新启动系统,并且用cfgmgr检测不到的磁盘,此方法需要用户知道硬盘的具体信息。知道硬盘的类型(Type),硬盘的连接的子类型(Subclass),硬盘连接的父设备名(Parent Name )和硬盘的逻辑位置(Location Code)
& & & &一搬使用mkdev配置该磁盘,格式如下:
& & & & & # mkdev &c disk &s Subclass &t Type &p ParentName &w Location Code &a pv=yes
& & & 例:增加一个679M的硬盘,连接到scsi3父设备上,他的scsi id是6,逻辑单元号是0,
& & & & # mkdev &c disk &s scsi &t 670mb &p scsi3 &w 6,0 &a pv=yes
& & & 或者调用smit mkdev来配置
&二、 修改磁盘属性的命令 chpv
&chpv [-h Hotspare ] [-a Allocation ] [-v Avaliability] [-c ] Pvname
-a 参数是设置物理卷的分配权限,allocation 是y时,允许分配新的PP,为n时,不允许分配PP
& &如: # chpv -a n hdisk1
& & -v 参数是设置物理卷是否可用,Avaliability 为r时,就是设置物理卷不可用,为a时就是设置物理卷为可用
& & & & 如: # chpv &v r hdisk1 (设置物理卷不可用)
& & & & & & # chpv &v a hdisk1 (设置物理卷可用)
& & -c 参数是清除物理卷的引导记录(boot record)&
& & & & 如: # chpv &c hdisk1
& & -h 参数设置物理卷的热备特性
三、&显示物理卷的信息
1、 &显示系统中所有已配置或已定义的物理卷
& & # lsdev & Cc disk
2、 &显示物理卷的属性
# lspv hdisk0
3、 &显示物理卷上分配的逻辑卷
# lspv &l hdisk0
&4、显示物理卷上物理分区的分布情况
& & & & # lspv &p hdisk0
5、&显示物理分区与逻辑分区的对应情况
# lspv &M hdisk0
该命令输出有两列 格式如下:
Pvname : pp-pp & & lvname :lp:copy
&四、删除物理卷&
由于物理卷是一个设备,所以要删除物理卷首先要将该物理卷由可用状态变成已定义状态,命令如下:
& & # rmdev &l hdisk5
由于上面的命令只是将设备hdisk5 由可用状态变成了已定义状态,因此,该设备的定义信息依然保存在ODM数据库中,所以要彻底清除hdisk5用下面的命令
& & # remdev &l hdisk5 &d
五、 卷组&
1,创建卷组mkvg
# mkvg &y datavg &d 6 &s 8 hdisk5 hdisk6 hdisk7
& & &创建一个卷组datavg ,包含 hdisk5 hdisk6 hdisk 7 三个物理卷,该卷组中的物理分区(pp)大小为8M,要求该卷组中最多有6个物理卷。
& & &如果一个磁盘过去隶属别的vg 可以使用 &f 参数来创建vg 如:
# mkvg &y datavg &f hdisk3 hdisk4 &&
& & & & # smit mkvg 也可以创建卷组。 & & &&
& & 2,显示卷组
& & & & # lsvg & & & & & & &显示系统中所有的卷组
& & & & # lsvg & -o & & & &显示当前系统中活动的卷组
& & & & # lsvg rootvg & & &显示卷组 rootvg的具体信息
& & & & # lsvg -l rootvg &显示卷组rootvg中的逻辑卷信息
& & & & # lsvg -p rootvg &显示卷组rootvg中的物理卷信息
& & & & # lsvg -i & & & & &从标准设备中读取卷组名字
& & & & # lsvg &o | lsvg &i &l 显示所有卷组所有逻辑卷
猜您也喜欢...
?   AIX系统管理员手册(中文版) 本人在AIXChina官网花费不菲的金币才....
?   AIX基本命令 AIX新手入门必读 一文件命令: 1.查看文件cat、more....
?   AIX常用命令汇总 内核 如何知道自己在运行 32 位内核还是 64 位....
评论列表(网友评论仅供网友表达个人看法,并不表明本站同意其观点或证实其描述)
猜你也喜欢看这些...
©2014 织梦吧(d8) DedeCMS学习交流平台AIX平台下磁盘的PVID对ASM磁盘的毁坏 - 人工智能当前位置:& &&&AIX平台下磁盘的PVID对ASM磁盘的毁坏AIX平台下磁盘的PVID对ASM磁盘的毁坏&&网友分享于:&&浏览:23次AIX平台下磁盘的PVID对ASM磁盘的破坏
这篇文章将通过两篇MOS文章来讨论AIX平台下为磁盘分配PVID对ASM磁盘的破坏。文章一:
这篇文章说明的是对一个存在的ASM磁盘分配PVID将破坏ASM的磁盘头,导致ASM磁盘组无法正常MOUNT。Assigning a Physical Volume ID (PVID) To An Existing ASM Disk Corrupts the ASM Disk Header (文档 ID )修改时间:类型:ALERT
In this Document
Description
Occurrence
Workaround
References
APPLIES TO:
Oracle Database - Enterprise Edition - Version 10.1.0.2 to 11.2.0.3 [Release 10.1 to 11.2]IBM AIX on POWER Systems (64-bit)***Checked for relevance on 30-Apr-2010***AIX5L Based Systems (64-bit)
DESCRIPTION
Assigning a Physical Volume ID (PVID) to an existing ASM disk will destroy the ASM disk header rendering the ASM disk unusable. Various documents including the 10gR1 and 10gR2 installation instructions for AIX platforms suggest to assign a PVID to disks to be used for ASM using the following command:
# /usr/sbin/chdev -l hdiskn -a pv=yes
These documents furthermore suggest that this command is to be run on ALL nodes of a RAC cluster. This does not present a problem as long as the disks have not yet been used by ASM. If however the disk are
already in use and above command is issued against an ASM disk the file header will be destroyed.
This is likely to happen if a new node is added to an existing RAC cluster as the documentation seems to imply this has to be done on all nodes. To check if a device has an associated PVID , use lspv: EXAMPLE:# lspv hdisk0 bc73ee rootvg active hdisk1 d77e1 rootvg active hdisk2 70dae vg01 active hdisk3 74190 vg01 active hdisk4 747d1 vg01 active hdisk5 74dff vg01 active hdisk6 75428 vg01 active hdisk7 7607d vg01 active hdisk8 766f3 vg01 active hdisk9 76d70 vg01 active hdisk10 773d5 vg01 active hdisk11 780b8 vg01 active hdisk12 7872f vg01 active hdisk13 7940c vg01 active hdisk14 79a7b vg01 active The second column is the PVID.
OCCURRENCE
This is more likely to happen in a RAC environment, specifically if a new node is added to an existing cluster.
If the 'chdev' command is run while ASM instances have the disk mounted nothing will be noticed immediately
as the disk header is only read when the disk is mounted. If however the diskgroup is unmounted and re-mounted (e.g. ASM instance restart) the disk is no longer recognized as an ASM disk and the diskgroup mount will fail with
ORA-15063 "diskgroup \"%s\" lacks quorum of %s PST %s found" or ORA-15063: ASM discovered an insufficient number of disks for diskgroup s% ORA-15040: diskgroup is incomplete ORA-15042: ASM disk "%" is missing
WORKAROUND
Do not assign a PVID to ASM disks, contrary to the documentation PVIDs are not required for ASM disks
as ASM uses the ASM disk header to discover it's disks.
This has been addressed in (Documentation)
Bug 3636335 which states:
"This is a doc. bug and we are going to clearly document not to put PVIDs on
disks given to ASM. The idea here is that ASM is the one which manages the
disk and not any OS / vendor volume managers etc., PVIDs are needed for volume
groups to work. For ASM to work, PVIDs are not needed. ASM has its own headers
to identify the disk which is what is getting written here. "
As long as there is still an ASM instance which has the disk(group) mounted the
contents may be backed up via RMAN as soon as possible. Also the action plan from the Document
can be applied. Also recommend to raise an SR with Oracle Support.
Checked for relevance on 18-APR-2013
REFERENCES
BUG:3636335 - PVID IN DISK HEADER IS OVERWRITTEN AFTER ADDING A NEW DISK TO ASM DISKGROUPNOTE: - Corrective Action for ASM Diskgroup with Disks Having PVIDs on AIX文章二:
这篇文章解释了两方面的问题,其一,如 果在创建ASM磁盘组之前所属的ASM磁盘就有了PVID,磁盘组创建成功将磁盘头的PVID信息覆盖掉,但由于磁盘的PVID信息会存在磁盘头和ODM 库中,服务器一旦重启,AIX会尝试用ODM库中的PVID重新覆盖磁盘头,从而破坏ASM磁盘头。其二,如果出现了上述情况,在没有重启操作系统之前如 何清除磁盘的PVID。Corrective Action for ASM Diskgroup with Disks Having PVIDs on AIX (文档 ID )修改时间:类型:HOWTO
In this Document
References
APPLIES TO:
Oracle Database - Enterprise Edition - Version 10.1.0.2 to 11.2.0.2 [Release 10.1 to 11.2]IBM AIX on POWER Systems (64-bit)IBM AIX Based Systems (64-bit)
You have created a diskgroup with disks having PVID and the diskgroup is in use. There is no diskgroup metadata corruption reported yet. You now know that ASM Disk should not have PVID as alerted in MetaLink Note
This note will give the steps to clear the PVID of these ASM Disks.
When the PVID is set to a disk in a volume group, the PVID is stored in two locations. In Physical disk header ( within first 4K )and in AIX's system object database, called ODM ( Object Data Manager ).
When the diskgroup is created, the disk header information of PVID is overwritten. However, with reboot the OS, from ODM, AIX might try to restore the PVID information onto the disk header,
there by destroying the ASM metadata.
If the ASM disk header Metadata has not been over written by PVID from ODM ( before a reboot ), then you can follow the following steps to update the ODM not to have PVID for the disks: 1] Do not reboot any node. 1.1] Drop one disk at a time from the diskgroup. 1.2] Clear the PVID of the dropped disk # chdev -l hdisk5 -a pv=clear Run this on ALL the nodes in case of RAC. 1.3] Check the disk does not have the PVID from ALL the nodes # lspv 1.4] Add the disk back to the diskgroup 1.5] Do this for all the disks having PVID in the diskgroup, one by one. Take care that the rebalance is complete from the drop/add disk command before going for the next disk. OR 2] This needs downtime: 2.1] Take 'dd' backup of the disk headers # dd if=/dev/hdisk5 of=/tmp/d5.txt bs=1024 count=1024 2.2] Shutdown ASM instance ( on ALL the nodes in RAC setup ). 2.3] Clear the PVID # chdev -l hdisk5 -a pv=clear Run this on ALL the nodes in case of RAC. 2.4] Check the disk does not have the PVID from ALL the nodes # lspv 2.5] Start the ASM Instance(s) and mount the diskgroup on ALL the nodes WARNING: Point-2 commands overrides the content of the disk header and so could be destructive if not correctly used. If you have any doubt, raise an SR with Oracle Support before any action.
不管是手动还是AIX自动为磁盘分配PVID都将破坏ASM磁盘头,导致ASM磁盘组无法加载。为了避免出现这种情况,我们应该遵守以下的规则:1).确保在创建ASM磁盘组之前,清除所有节点所有ASM需要使用的磁盘的PVID。2).磁盘组一旦创建成功,应该避免对ASM磁盘手动分配PVID。3).磁盘组一旦创建成功,应该手动执行ASMCMD工具下的md_backup命令对磁盘组元数据进行备份。4).在规划的时候,建议每次磁盘组由两个以上的ASM磁盘组成。
参考至:http://blog.itpub.net//viewspace-1079207/
如有错误,欢迎指正
12345678910
12345678910
12345678910 上一篇:下一篇:文章评论相关解决方案 12345678910 Copyright & &&版权所有AIX使用LV创建ASM磁盘组 - 推酷
AIX使用LV创建ASM磁盘组
hdisk3已识别PVID
hdisk0&&&&&&&&& 000d295a6d68902b&&&&&&&&&&&&&&&&&&& rootvg&&&&&&&&& active
hdisk1&&&&&&&&& 000d2e62ac906f43&&&&&&&&&&&&&&&&&&& rootvg&&&&&&&&& active
hdisk2&&&&&&&&& 000d2e629b38c89d&&&&&&&&&&&&&&&&&&& datavg&&&&&&&&& active
hdisk3&&&&&&&&& 000d2e621c735061&&&&&&&&&&&&&&&&&&& None&&&&&&&&&&&
hdisk4&&&&&&&&& none&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& None&&&&&&&&&&&
# mkvg -y asmvg hdisk3
mklv -y lv_asm1 asmvg 8
mklv -y lv_asm2 asmvg 8
mklv -y lv_asm3 asmvg 8
mklv -y lv_asm4 asmvg 8
#& mklv -y lv_asm4 asmvg 8
#& mklv -y lv_asm2 asmvg 8
#& mklv -y lv_asm3 asmvg 8
#& mklv -y lv_asm4 asmvg 8
chown oracle.dba /dev/rlv_asm1
已发表评论数()
已收藏到推刊!
请填写推刊名
描述不能大于100个字符!
权限设置: 公开
仅自己可见
正文不准确
标题不准确
排版有问题
没有分页内容
图片无法显示
视频无法显示
与原文不一致

我要回帖

更多关于 asm磁盘 的文章

 

随机推荐