Operating System - HP-UX
1834458 Members
2564 Online
110067 Solutions
New Discussion

Re: Removing a vg that is stuck

 
SOLVED
Go to solution
Marty Metras
Super Advisor

Removing a vg that is stuck

I had a drive fail.
In most cases I would copy the data and drop the the whole thing amd make sure both drives (Mirror) are good and then recreate the mount point and restor the data. This works even thought I know there other ways.
This time when I try to remover the volume group it is telling me it is busy and it wont let me.
I had this happen a long time ago but cant find my notes.
Can you help.
The mount is gown but the lv and vg are still there. There is no data to be lost. and it is 2 drives mirrored.
I'm stuck!
Marty
The only thing that always remain the same are the changes.
8 REPLIES 8
Victor Fridyev
Honored Contributor

Re: Removing a vg that is stuck

Hi,

If
vgchange -a n vgname
vgexport vgname
does not work, you have to reboot computer to single user mode and vgexport the volume group.

HTH
Entities are not to be multiplied beyond necessity - RTFM
Christian Tremblay
Trusted Contributor

Re: Removing a vg that is stuck

You say you have two mirrored drive in your vg and one failed.

Why would you have to remove the VG and lvols, I don't understand. You only have to replace the bad drive and resync no ??
Marty Metras
Super Advisor

Re: Removing a vg that is stuck

I get
root:/ vgchange -a n /dev/vg12
vgchange: Couldn't deactivate volume group "/dev/vg12":
Device busy

root:/ fuser -u /dev/vg12
/dev/vg12:

root:/ fuser -cu /dev/vg12
/dev/vg12: fuser: could not find file system mounted at /dev/vg12.
root:/ fuser -u /dev/vg12/data12
/dev/vg12/data12:

Looks to be a re-boot?
Marty
The only thing that always remain the same are the changes.
Marty Metras
Super Advisor

Re: Removing a vg that is stuck

Christian,
ther server is a 6 hour drive from here. No data on it. And I can stop the allerts by disableing it completelly untile I have time to deal with it. It never has been a problem in the past.
The only thing that always remain the same are the changes.
erics_1
Honored Contributor
Solution

Re: Removing a vg that is stuck

Is the drive still installed and part of the vg? If so, can you vgreduce it and then try and remove the vg?

lvreduce -m 0 /dev/vgxx/lvolxx /dev/dsk/cxtxdx
vgreduce /dev/vgxx /dev/dsk/cxtxdx
vgchange -a n vgxx
vgexport vgxx


Regards,
Eric
Marty Metras
Super Advisor

Re: Removing a vg that is stuck

Thanks Eric,
It is a done deal.
All is well now.

Marty
The only thing that always remain the same are the changes.
Florian Heigl (new acc)
Honored Contributor

Re: Removing a vg that is stuck

There's a few more handy commands for such situations:

vgreduce -u
( get rid of a failed disk that failed during i.e. downtime and was replaced to another scsi ID )

pvchange -a n
( put a PV to LVM 'unavailable' state, that requires 11.11 or 11.23 )

yesterday I stood at the edge. Today I'm one step ahead.
Torsten.
Acclaimed Contributor

Re: Removing a vg that is stuck

@Florian:

vgreduce -u?

It should be "vgreduce -f" or "-l", isn't it?

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!