Oracle ASM accidentally messed with my hdisk

I have AIX 5.3 with oracle 10g ( test server). While trying to create RAW disk for Oracle ASM I have accidentally messed with rootvg (hdisk0 & hdisk1)

When I do

# lspv hdisk0 
0516-066 : Physical volume is not a volume group member. 
        Check the physical volume name specified. 
PHYSICAL VOLUME:    hdisk0                   VOLUME GROUP:     rootvg 
PV IDENTIFIER:      0005681601fcded1 VG IDENTIFIER     000568160000d7000000013001fcfe28 
PV STATE:           ??????? 
STALE PARTITIONS:   ???????                  ALLOCATABLE:      ??????? 
PP SIZE:            ???????                  LOGICAL VOLUMES:  ??????? 
TOTAL PPs:          ???????                  VG DESCRIPTORS:   ??????? 
FREE PPs:           ???????                  HOT SPARE:        ??????? 
USED PPs:           ???????                  MAX REQUEST:      256 kilobytes 
FREE DISTRIBUTION:  ??????? 
USED DISTRIBUTION:  ??????? 
 
# lquerypv -h /dev/hdisk0 
00000000   00820101 00000000 80000000 25D3BE94  |............%...| 
00000010   00000000 00000000 00000000 00000000  |................| 
00000020   4F52434C 4449534B 00000000 00000000  |ORCLDISK........| 
00000030   00000000 00000000 00000000 00000000  |................| 
00000040   0A100000 00000203 4449534B 4752505F  |........DISKGRP_| 
00000050   30303030 00000000 00000000 00000000  |0000............| 
00000060   00000000 00000000 4449534B 47525000  |........DISKGRP.| 
00000070   00000000 00000000 00000000 00000000  |................| 
00000080   00000000 00000000 434F4E54 524F4C4C  |........CONTROLL| 
00000090   45523100 00000000 00000000 00000000  |ER1.............| 
000000A0   00000000 00000000 00000000 00000000  |................| 
000000B0   00000000 00000000 00000000 00000000  |................| 
000000C0   00000000 00000000 01F6D713 C9D19400  |................| 
000000D0   01F6D713 C9D19400 02001000 00100000  |................| 
000000E0   0001BC80 00011176 00000002 00000001  |.......v........| 
000000F0   00000002 00000002 00000000 00000000  |................| 

This case happened to me before but I want able to resolve it, cause I thought a restart would solve but I ended up reinstalling AIX again

Changes to LVM are written to the ODM and onto the disks. They are permanent and can't be resolved by a reboot. After a reboot your box will not come up again, since you destroyed it's rootvg. It is currently only working, because the programs are in memory.
If there is a mirror set up between hdisk0 and 1, the copy will most probably be destroyed as well.

I guess you have to reinstall or restore a backup of your rootvg.
You simply have to take care with what you do.

Hi,

as your system still seems to be up, try just a simple rm /dev/asm_diskx (on the device that has the same major/minor number as your hdisk0). If the disk is afterwards empty (what may happen as the asm header is using the same header as the volumegroup definition) than try to unmirror and reduce the 'missing' disk from rootvg like you would do it with a dead disk - you can run rmdev -Rdl hdisk0 as well ....

Just for my curiosity - how did you manage to do this in first instance - as volumegroups and asm devices exclude each other ... so we had destroyed our asm databases several times by doing the opposite - assigning asm devices mistakenly to volumegroups :slight_smile:

Regards
zxmaus

it seems that i will have to re-install AIX again.
the problem is that im not an aix expert im just a DBA so i had to go by myself in this part and there was not enough documents about how to create raw disks for Oracle ASM, what we have is hdisk0 hdisk1 for rootvg (mirrored) hdisk2 oracle vg and the new rawdisk hdisk3 and i thought that every rhdisk is a raw device so in oracle i added rhdisk0 1 2 3 which turrned out to be linked to the other hdisks thats it, but i feel good that i have done this now so i could learn it the hard way and i wont be forgetting this lesson again :smiley:

thanks everyone for ur help

adm devices need to be configured before you can use them

for this you need to know the major minor numbers of the disks you are intending to use

lets assume you want to use hdisk3 and this has major number 36 and minor number 3 than you should run mknod /dev/asm_disk01 c 36 3 and than in oracle you would use this asm_disk01
using hdisk names themselves is really really bad practice before oracle asm 11.2 as the alias names are the only means for the SA to determine if a disk is in use by asm or really free

regards
zxmaus