Operating System - HP-UX
1833017 Members
2416 Online
110048 Solutions
New Discussion

How to remove a disk from a VG (/etc/lvmtab)?

 
FTSE SysAdmin
Frequent Advisor

How to remove a disk from a VG (/etc/lvmtab)?

Hi,

I was configuring a new disk and adding it to a VGroup when my session got disconnected right in the midle of this process... (I know my fault for trusting the network... grrrr)

However ... now I'm stucked I can't activate the vgroup neither remove the vgroup or execute pvremove as you may see:

hp3(root):/dev # pvremove /dev/rdsk/c2t6d0
pvremove: The physical volume "/dev/rdsk/c2t6d0" belongs to volume group "/dev/vg01".
pvremove: Couldn't remove physical volume "/dev/rdsk/c2t6d0".

hp3(root):/dev # vgchange -a e /dev/vg01
vgchange: Warning: Couldn't attach to the volume group physical volume "/dev/dsk/c2t6d0":
Cross-device link
vgchange: Activation mode requested for the volume group "/dev/vg01" conflicts with configured mode.
vgchange: Warning: couldn't query physical volume "/dev/dsk/c2t6d0":
The specified path does not correspond to physical volume attached to
this volume group
vgchange: Warning: couldn't query all of the physical volumes.

hp3(root):/dev # vgremove /dev/vg0x
vgremove: Volume group not activated.

Would someone know a way to clear nicelly the entries of vg01 and c2t6d0 from /etc/lvmtab? Many thanks

Regards,
Miguel
Miguel Ribeiro
10 REPLIES 10
A. Clay Stephenson
Acclaimed Contributor

Re: How to remove a disk from a VG (/etc/lvmtab)?

Generally a vgexport will clear this problem.
Do a vgexport /dev/vg01
then a strings /etc/lvmtab, all references to /dev/vg01 should be gone.

If that fails then you should do a vgscan.
1) mv /etc/lvmtab /etc/lvmtab.sav
2) vgscan -a
This will recreate you lvmtab.
If it ain't broke, I can fix that.
Cheryl Griffin
Honored Contributor

Re: How to remove a disk from a VG (/etc/lvmtab)?

Can you vgexport it?
# vgexport /dev/vg01

"Downtime is a Crime."
Pete Randall
Outstanding Contributor

Re: How to remove a disk from a VG (/etc/lvmtab)?

Miguel,

Try moving /etc/lvmtab to /etc/lvmtab.save and running vgscan -av.


Pete

Pete
G. Vrijhoeven
Honored Contributor

Re: How to remove a disk from a VG (/etc/lvmtab)?

Hi Miguel,

Start by activating the vg01
vgchange -a y (vgchange -a e is for mc/sg disks vgchange -c y/n to activate deactivate)
then make sure the disk is not used in a lvol. ( lvdisplay command ) if so use lvreduce command
If the disk is no longer used by an lvol you can vgreduce the disk from the vg.

This is all.


HTH,

Gideon
RAC_1
Honored Contributor

Re: How to remove a disk from a VG (/etc/lvmtab)?

vgexport vg01 should do that. If not try vgreduce -f vg01. Post results.
There is no substitute to HARDWORK
FTSE SysAdmin
Frequent Advisor

Re: How to remove a disk from a VG (/etc/lvmtab)?

Thanks for your replys :)

the vgexport worked and the lvmtab is now cleared from vg01 and c2t6d0 entries

The vg01 is removed however when I type pvremove /dev/rdsk/c2t6d0 I get the following:

hp3(root):/dev # pvremove /dev/rdsk/c2t6d0
pvremove: The physical volume "/dev/rdsk/c2t6d0" belongs to an exported volume group.
pvremove: Couldn't remove physical volume "/dev/rdsk/c2t6d0".
Miguel Ribeiro
Pete Randall
Outstanding Contributor

Re: How to remove a disk from a VG (/etc/lvmtab)?

Miguel,

In this case, I don't think you need to pvremove it - just proceed on and redefine it with pvcreate.


Pete

Pete
FTSE SysAdmin
Frequent Advisor

Re: How to remove a disk from a VG (/etc/lvmtab)?

Update:

I've restart the server ... I tried to execute pvcreate and it worked :)

problem solved :)

Many thanks to all for your useful help :)
Miguel Ribeiro
Steven E. Protter
Exalted Contributor

Re: How to remove a disk from a VG (/etc/lvmtab)?

I think you need to vgimport the volume group now.

That can be done on the command line or with sam.

Then destory the logical volumes with the lvremove command

then

vgreduce /dev/vg01 /dev/dsk/c1t1d0

adjust the command for the actual disk name.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Jeff Schussele
Honored Contributor

Re: How to remove a disk from a VG (/etc/lvmtab)?

Hi,

If all you want to do is clear the LVM structure off the disk - use pvcreate

pvcreate -f /dev/rdsk/c2t6d0

That will initialize it & allow you to create a new LVM structure on it.
BE VERY CAREFUL typing the device name - you get no 2nd chance IF you direct this to the wrong device.

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!