Operating System - HP-UX
1837646 Members
3230 Online
110117 Solutions
New Discussion

Re: delete physical volume?

 
Mark Henry_1
Frequent Advisor

delete physical volume?

Hi All,

I pvcreate'ed a raid lun which I want to nuke and resize.
Presumably I should first delete the physical volume - but there's no apparent pv* command to do so.
Also, once gone, would I need to manually remove the device files which were created with 'insf -e'?

Cheers,

Mark
8 REPLIES 8
Hartmut Lang
Trusted Contributor

Re: delete physical volume?

- remove LVM control for this device with "vgremove".

- Delete LUN with SAM or arraycfg -L "LUN" -d "array_id" (for AutoRAID 12H).

- Then you are save to delete your device-files.

I have good experience using SAM for all these operations. This prevents ending in an inconsistent state.

Hardy
Michael Tully
Honored Contributor

Re: delete physical volume?

Hi Mark,

There two things to do:

First if it part of a volume group
remove the logical volumes first
and the vgreduce it from the group.
Once that it done you will need to
clean up the hardware path.

# lvremove /dev/yourvg/yourlv
# vgreduce /dev/yourvg /dev/dsk/cytxdz
from the ioscan output for this disk:
# rmsf -H 1/12/4.1.0 (example)

You could use SAM, but I'm not sure
if it actually removes the hardware.

HTH
-Michael
Anyone for a Mutiny ?
Mark Henry_1
Frequent Advisor

Re: delete physical volume?

Guys,

Thanks for the info.

I actually haven't added them to an volume groups - just pvcreated them.
I was wondering if it's necessary to un-pvcreate them.. and then is it necessary to delete the special files manually..

Thanks,

Mark
Steven Sim Kok Leong
Honored Contributor

Re: delete physical volume?

Hi,

When you power-cycle your machine and the system and OS detects the new harddisk, it creates the device file automatically.

pvcreate does not create the device file. Consider the analogy of pvcreate alike fdisk in MS-DOS, newfs alike format in MS-DOS.

Thus, there is no need or utility to perform a "pv-uncreate".

Hope this helps. Regards.

Steven Sim Kok Leong
Steven Sim Kok Leong
Honored Contributor

Re: delete physical volume?

Hi,

On 2nd thoughts, I think lvcreate should be more alike fdisk in the analogy, not pvcreate.

Hope this helps. Regards.

Steven Sim Kok Leong
Mark Henry_1
Frequent Advisor

Re: delete physical volume?

Ok, that makes sense, so I can just delete the lun and it won't do any harm, just delete the device files afterwards...

Thanks all,

Mark
Michael Tully
Honored Contributor

Re: delete physical volume?

Hi Mark,

There is no command to un-pvcreate
except if you want to add the volume
to another group if for some reason
it became corrupted.

The best way to remove it is to
identify the hardware path from
the output of ioscan and use the
'rmsf' command I gave earlier.

# rmsf -H 1/12/6.4.1 (example)

The 'H' option is the hardware path
which will remove the disk.

-Michael
Anyone for a Mutiny ?
Steve Lewis
Honored Contributor

Re: delete physical volume?

You don't need to re-pvcreate a disk/LUN or un-pvcreate it, if the disk/LUN has never been added to a volume group.
If the disk/LUN had been added to a volume group previously, you would need to 'pvcreate -f' the disk/LUN before you add it to another volume group.
If you unbind the LUN and rebind it, you will have to pvcreate the new LUN before you can add it to a VG.