Operating System - HP-UX
1835055 Members
3031 Online
110073 Solutions
New Discussion

I can not remove a volume group

 
SOLVED
Go to solution
esmadscc01p
Occasional Advisor

I can not remove a volume group

Hello,

I am a HPUX 11.11 administrator.

I have a volume group  I can not remove, neither using vgremove or vgexport, because is activated and has still missing logical volumen associated.  The logical volumens were deleted by force, removed from directly from /etc/fstab , so the file system associated.

 

In this way, if I try to execute a vgexport , I get the error :

vgexport: Volume group "/dev/caprep" is still active.

vgexport. Couldn´t export volume group "/dev/caprep"

 

And if I try to deactivate it, fails too:

vgchange : Couldn´t deactivate volume group "caprep"

 

Any idea, how can I force the deletion?

 

Thank you in advance

 

 

 

18 REPLIES 18
rariasn
Honored Contributor

Re: I can not remove a volume group

Hi:

 

# fuser -u /dev/caprep

 

# vgdsiplay -v  /dev/caprep

 

rgs

esmadscc01p
Occasional Advisor

Re: I can not remove a volume group

--- Volume groups ---
VG Name                     /dev/caprep
VG Write Access             read/write    
VG Status                   available                
Max LV                      255   
Cur LV                      5     
Open LV                     0     
Max PV                      16    
Cur PV                      1     
Act PV                      1     
Max PE per PV               35004       
VGDA                        2  
PE Size (Mbytes)            8              
Total PE                    17499  
Alloc PE                    14063  
Free PE                     3436   
Total PVG                   0       
Total Spare PVs             0             
Total Spare PVs in use      0                    


   --- Physical volumes ---
   PV Name                     /dev/dsk/c11t0d0
   PV Status                   available               
   Total PE                    17499  
   Free PE                     3436   
   Autoswitch                  On       

and fuser output:

/dev/caprep:

 

There is not any reference to the old file systems, neither the directory. In this way , I do not know whay it is still busy.

 

Regards

 

rariasn
Honored Contributor

Re: I can not remove a volume group

Hi:

 

# ll /dev/caprep

 

rgs,

esmadscc01p
Occasional Advisor

Re: I can not remove a volume group

#ll /dev/caprep

cr--r--r--    1  root    sys    64 0x020000 Mar 16 2007 group

 

 

rariasn
Honored Contributor

Re: I can not remove a volume group

Hi:

 

do you have /etc/lvmconf/caprep.mapfile file?

 

# cat /etc/lvmconf/caprep.mapfile

 

for each lvol:

 

mknod /dev/caprep/rlvname1  c 64 0x020001

mknod /dev/caprep/lvname1   b 64 0x020001

 

mknod /dev/caprep/lvname2   b 64 0x020001

mknod /dev/caprep/rlvname2  c 64 0x020001

...

 

mknod /dev/caprep/lvname5   b 64 0x020001

mknod /dev/caprep/rlvname5  c 64 0x020001

 

# vgchange -a n caprep

 

# vgexport -p -m /tmp/caprep.map caprep

 

# vgexport -m -m /tmp/caprep.map caprep

 

rgs,

 

 

rariasn
Honored Contributor

Re: I can not remove a volume group

Hi:

 

do you have /etc/lvmconf/caprep.mapfile file?

 

# cat /etc/lvmconf/caprep.mapfile

 

for each lvol:

 

mknod /dev/caprep/rlvname1  c 64 0x020001

mknod /dev/caprep/lvname1   b 64 0x020001

 

mknod /dev/caprep/lvname2   b 64 0x020002

mknod /dev/caprep/rlvname2  c 64 0x020002

...

 

mknod /dev/caprep/lvname5   b 64 0x020005

mknod /dev/caprep/rlvname5  c 64 0x020005

 

# vgchange -a n caprep

 

# vgexport -p -m /tmp/caprep.map caprep

 

# vgexport -m -m /tmp/caprep.map caprep

 

rgs,

 

 

esmadscc01p
Occasional Advisor

Re: I can not remove a volume group

There is not mapfile :-(

 

rariasn
Honored Contributor

Re: I can not remove a volume group

Hi:

 

--- Volume groups ---

VG Name                    /dev/caprep

VG Write Access        read/write    

VG Status                   available                

Max LV                      255   

Cur LV                      5  <----

 

mknod /dev/caprep/rlvol1  c 64 0x020001

mknod /dev/caprep/lvol1   b 64 0x020001

mknod /dev/caprep/rlvol2  c 64 0x020002

mknod /dev/caprep/lvol2   b 64 0x020002

mknod /dev/caprep/rlvol3  c 64 0x020003

mknod /dev/caprep/lvol3   b 64 0x020003

mknod /dev/caprep/rlvol4  c 64 0x020004

mknod /dev/caprep/lvol4   b 64 0x020004

mknod /dev/caprep/rlvol5  c 64 0x020005

mknod /dev/caprep/lvol5   b 64 0x020005

 

# vgchange -a n caprep

 

rgs,

esmadscc01p
Occasional Advisor

Re: I can not remove a volume group

Hello, I have created all the special files, but I can not deactivate it, for the same reason:

vgchange: Couldn´t deactivate volume group "Caprep".

Device busy

 

Thank you, rariasn

rariasn
Honored Contributor

Re: I can not remove a volume group

Hi:

 

 

vgdisplay -v caprep

bdf | grep caprep

fuser /dev/caprep

 

Verify  for errors in /var/adm/syslog/syslog.log file

rgs

esmadscc01p
Occasional Advisor

Re: I can not remove a volume group

The only purpose to remove the volume group is to use the physical disk (140GB ) , exclusively dedicated to this vg, caprep,  composed of missing logical volumens.  The hardware path is 0/4/0/0.0.0  and the  device files are /dev/dsk/c11t0d0 and /dev/rdsk/c11t0d0.   

 

Is it possible to "initialze" it again? The "Unconfigure" action from teh graphic SAM administrator, can not be applied  because " The physycal Voleme PV cannot be removed since some of its physical extents are still in use".

 

I do not mind to perform any force action if  I can use again . I see it is impossible to clean the old lvols and vg data.

 

rariasn
Honored Contributor

Re: I can not remove a volume group

Hi:

 

Do reboot the server will release the affectedVG.

 

rariasn.

 

esmadscc01p
Occasional Advisor

Re: I can not remove a volume group

I can not test it until weekend, but I´ll make it.

I let you know.

Thank you very much for your help.

rariasn
Honored Contributor

Re: I can not remove a volume group

OK. Greetings

 

rariasn


Pete Randall
Outstanding Contributor

Re: I can not remove a volume group

You could try running pvcreate.  The -f option is available to force the initialization of a disk that already belongs to another VG.


Pete
esmadscc01p
Occasional Advisor

Re: I can not remove a volume group

Hi.

 

After reboot,  nothing changed.

To the 'pvcreate -f /dev/rds/c11t0d0' comand, I get:

 

pvcreate: The physical volume "/dev/dsk/c11t0d0" is already recorded in thr "/etc/lvmtab" file.

 

 

Hiren N Dave
Valued Contributor

Re: I can not remove a volume group

Try to boot into single user mode and then vgexport the volume group.

 

You can also try physically detaching the disk from the server and vgexport to remove perticular vg.

 

I am an HP Employee

Was this post useful? - You may click the KUDOS! star to say thank you.
esmadscc01p
Occasional Advisor
Solution

Re: I can not remove a volume group

Hello,

I have detached the physical disk ( out/put ) and finally it has been released. It has been a dirty operation, with a lot of information left in /etc/lvmconf , etc, and 1 missing volume group, I am trying to restore from backup. I think any information has been corrupted

 

Thank you for your valious help.