Operating System - HP-UX
1834779 Members
2938 Online
110070 Solutions
New Discussion

Re: pvremove does not exist on HP-UX 10.20

 
SOLVED
Go to solution
Dieter S. Vener
Frequent Advisor

pvremove does not exist on HP-UX 10.20

Hi Guys,

How the heck do you remove physical volumes on HP-UX 10.20? pvremove does not exist. I have some physical volumes that are allocated to old volume groups that no longer exist.

Thanks,

Weener
7 REPLIES 7
Patrick Wallek
Honored Contributor
Solution

Re: pvremove does not exist on HP-UX 10.20

Are those VGs still in /etc/lvmtab? If so, and you are absolutely sure they are inactive, just vgexport those VGs to get rid of them.

You can then do a 'pvcreate -f' on the PVs so they can be used in other VGs.
Dieter S. Vener
Frequent Advisor

Re: pvremove does not exist on HP-UX 10.20

Hi,

No, none of them are in /etc/lvmtab. I think some idiot that used to work here removed the volume groups using those pv's incorrectly.

Thanks for you help,

Weener
Dieter S. Vener
Frequent Advisor

Re: pvremove does not exist on HP-UX 10.20

Patrick,

Thanks. I did not read your whole response. Does pvcreate -f ignore that the physical disk is already in use? When I run pvcreate /dev/rdsk/c2t0d6 alone with the -f option, I get a message saying the this device is already in use by another vg. I do know for certain that this disk is not already in use. I did a vgdisplay -v on all the volume groups that exist in lvmtab and none of them include this disk.
Deoncia Grayson_1
Honored Contributor

Re: pvremove does not exist on HP-UX 10.20

the -f option with pvcreate, forces the creation of the phyiscal volume

man pvcreate for more details

Warning: The -f option should only be used as a last resort to over write file system or volume manager information that cannot
properly be removed using the commands
designed for that purpose. When invoked with -f, the command does minimal verification, so care should be taken to assure that the disk is not already in use
If no one ever took risks, Michelangelo would have painted the Sistine floor. -Neil Simon
James R. Ferguson
Acclaimed Contributor

Re: pvremove does not exist on HP-UX 10.20

Hi Weener:

Even with the 'f'orce option of 'pvcreate' you are protected from removing a disk that is recorded in '/etc/lvmtab'.

Since, as noted, 'pvremove' doesn't exist on 10.20, you must resort to overwriting the LVM header yourself to destroy a disk.

# # mknod /dev/zero c 3 0x000003 #...on 10.20
# dd if=/dev/zero of=/dev/rdsk/cXtYdZ bs=64k count=10
# pvcreate -f /dev/rdsk/cXtYdZ

Regards!

...JRF...
Bill Hassell
Honored Contributor

Re: pvremove does not exist on HP-UX 10.20

pvcreate initializes the physical disk with basic LVM structures. The default pvcreate (without -f) will only write to an blank disk, that is, one that has never been used with LVM in the past. pvcreate -f will force the initialization but since this is completely destructive (especially to live data), it will see that the disk was used in the past for LVM and give you one last chance to verify that this disk can indeed be initialized.

The contents of lvmtab reflects active disks, so if you don't see your disk inj lvmtab, then it is not active. That doesn't mean that it hasn't been used in the past or has been temporarily deactivated by another sysadim. If you know that all required volume groups are active, then you should be OK with pvcreate -f.


Bill Hassell, sysadmin
John E.Ophious
Regular Advisor

Re: pvremove does not exist on HP-UX 10.20

Howdy Weener,

To be sure, you can also use sam to tell whether or not the disk is actually in use. The other gurus here have given enough good advice about pvcreate, so I wont go into that!!

Take care Weener,

John E. Ophious