Operating System - HP-UX
1837765 Members
3681 Online
110119 Solutions
New Discussion

removing physical volume from volume group

 
Lee Abell
Frequent Advisor

removing physical volume from volume group

I had a disk go bad that was a mirrored root disk (/dev/vg00). Since it was a test server and we didn't have a replacement disk, we just removed the bad disk. Then, I did a vgreduce to remove the physical volume from the volume group. However, I forgot to remove the logical volumes first. Now, when I do a vgdisplay or an lvdisplay, I get the following message:

Warning: Couldn't query physical volume "/dev/dsk/c0t2d0": The specified path does not correspond to physical volume attached to this volume group.

Does anyone know how to correct this?
7 REPLIES 7
Hein van den Heuvel
Honored Contributor

Re: removing physical volume from volume group


lvreduce -k ?


" -k This option should be used only in the special instance when you want to reduce a mirrored logical volume on a physical volume that is missing or has failed."


And you probably would want to
mv /etc/lvmtab away to /etc/lvmtab.old
and run vgscan to create a fresh /etc/lvmtab.

hth,
Hein.
Lee Abell
Frequent Advisor

Re: removing physical volume from volume group

If I do an lvreduce -m 0 -k /dev/vg00/lvol6 /dev/dsk/c0t2d0, I get the following response:

Physical extents on remaining physical volumes are stale or remaining physical volumes are not responding.
lvreduce: The LVM device driver failed to reduce mirrors on the logical volume "/dev/vg00/lvol6".

If I try to do the lvreduce AFTER I move the /etc/lvmtab to /etc/lvmtab.old, I get an error that it can't find the /etc/lvmtab.
Ivan Krastev
Honored Contributor

Re: removing physical volume from volume group

If you have mirrors for each lvol reduce mirrors:

lvreduce -m 0 /dev/vg01/lvolX /dev/dsk/cXtXdX


and after that use lvreduce/vreduce


regards,
ivan

James R. Ferguson
Acclaimed Contributor

Re: removing physical volume from volume group

Hi Lee:

> If I try to do the lvreduce AFTER I move the /etc/lvmtab to /etc/lvmtab.old, I get an error that it can't find the /etc/lvmtab.

You need to rebuild a valid '/etc/lvmtab' with 'vgscan'. Do:

# vgscan -a -v

Regards!

...JRF...
Lee Abell
Frequent Advisor

Re: removing physical volume from volume group

OK, if I remove the /etc/lvmtab and do a vgscan -a -v, the errors about not being able to query the physical volume go away from the vgdisplay and lvdisplay outputs.

But, the lvdisplay shows that status of the second physical extent is stale (those extents that were mirrored on the bad disk). If I try the lvreduce -m 0 -k /dev/vg00/lvol6 /dev/dsk/c0t2d0, for example, then I get the following error:

Physical extents on remaining physical volumes are stale or remaining physical volumes are not responding.
lvreduce: The LVM device driver failed to reduce mirrors on the logical volume "/dev/vg00/lvol6"

It seems like that command should work but it doesn't. Any ideas?
James R. Ferguson
Acclaimed Contributor

Re: removing physical volume from volume group

Hi Lee:

As Hein originally noted, use the '-k' option of 'lvreduce'. See its manpages and those of 'lvdisplay' for the details of using the 'pv_key'.

This is also discussed in this guide:

http://docs.hp.com/en/5991-1236/When_Good_Disks_Go_Bad.pdf

Regards!

...JRF...
Lee Abell
Frequent Advisor

Re: removing physical volume from volume group

Thanks! I missed the part about using the pvkey. That seemed to work.