Operating System - HP-UX
1748210 Members
3829 Online
108759 Solutions
New Discussion юеВ

Re: Raw Device, LVM and Oracle ASM

 
BFF
Member

Raw Device, LVM and Oracle ASM

We had a raw device (disk115) that was presented to Oracle ASM.  This device was inadvertently used in LVM,  pvcreate was used to create the physical volume.  We want to re-present this disk back to Oracle ASM.  Is there a way to undo the pvcreate and make the LUN a raw device again?  This is a development server and Oracle DBAs are learning ASM.

3 REPLIES 3
Bill Hassell
Honored Contributor

Re: Raw Device, LVM and Oracle ASM

All disk (LUN) devices have a raw and cooked device file. LVM simply initializes data on the disk (and destroys anything else that was on the disk (ie, Oracle). If the disk was incorprated into a volume group, you'll have to remove any logical volumes that are attached to this disk, then vgreduce the disk from the VG. Now the disk can be added to the Oracle definitions. If it already exists, it will need repair/rebuild using standard Oracle tools.



Bill Hassell, sysadmin
BFF
Member

Re: Raw Device, LVM and Oracle ASM

The DBA told me he was unable to see the LUN after I did remove all LVs and did a vgreduce. What does pvcreate do to a LUN and how do you reverse it?
Matti_Kurkela
Honored Contributor

Re: Raw Device, LVM and Oracle ASM

The pvcreate command creates an unique PVID for the new PV and initializes the LVM metadata at the beginning of the disk. It does not backup the data it overwrites. You can use the pvremove command to remove the LVM metadata, but the command has no way of restoring what was there before the pvcreate command was run.

 

According to some "cookbook" documents I found with Google, the beginning of the disk needs to be filled with zero bytes or ASM won't accept it (this prevents ASM from accidentally claiming disks that are already in use).

 

If the pvremove command is not enough to make the disk available to ASM again, you probably need to do something like this:

dd if=/dev/zero of=/dev/rdisk/disk115 bs=8192 count=12800

 The "cookbook" document referred to Oracle Metalink Note 268481.1 for more information regarding this command.

MK