Operating System - HP-UX
1753440 Members
4664 Online
108794 Solutions
New Discussion

Re: Remove LVM information

 
SOLVED
Go to solution
Mynor Aguilar
Valued Contributor

Remove LVM information

Hello,

basically I was running some LVM tests on my 11.23 server.   I presented a disk from my SAN and created a new VG and LV.   long story short somebody decided to remove the mapping (unpresent) my test disk and now LVM cannot find the old LUN.   for a very specific reason I cannot represent the volume back to my server and I just need to delete the LVM information and any traces of the test LV, test VG, etc.

so, I basically tried to unmount the FS (POC is the mountpoint)

# umount /POC  

but the command hangs, same thing happens if I try to run bdf or any other LVM related command  (lvremove or vgreduce).

 

is there any way to manually remove this filesystem, LV and VG?  I do not really care about the data on that filesystem.

 

regards,

Mynor

 

 

4 REPLIES 4
James R. Ferguson
Acclaimed Contributor

Re: Remove LVM information

Hi:

 

If I understand correctly, you could rename the '/etc/lvmtab' file to '/etc/lvmtab.old' and run 'vgscan -a -v'.  Have a look at the 'vgscan' manpages and follow the instructions the operation reports.

 

Regards!

 

...JRF...

Mynor Aguilar
Valued Contributor

Re: Remove LVM information

Thanks James,

I created a copy of the /etc/lvmtab by renaming it to /etc/lvmtab.old

after running the #vgscan -a -v , the /dev/VG_POC (my test VG) was listed along with the message that it was not matched with any Physical Volumes.  

the entry was removed from /lvmtab but the problem persisted (getting stuck while doing a bdf or trying to go into sam to list the filesystems), I decided to restore the old copy of the lvmtab.old into /etc/lvmtab by doing a  #cp -p lvmtab.old lvmtab and then run a #vgexport -v /dev/VG_POC .   Anyway, the vgexport with the following error message:  vgexport: Volume group "/dev/VG_POC" is still active.

 

do you have any other ideas on how to remove it?  

 

thanks for your help.

James R. Ferguson
Acclaimed Contributor
Solution

Re: Remove LVM information


@Mynor Aguilar wrote:

I created a copy of the /etc/lvmtab by renaming it to /etc/lvmtab.old

after running the #vgscan -a -v , the /dev/VG_POC (my test VG) was listed along with the message that it was not matched with any Physical Volumes.  

the entry was removed from /lvmtab but the problem persisted (getting stuck while doing a bdf or trying to go into sam to list the filesystems), I decided to restore the old copy of the lvmtab.old into /etc/lvmtab by doing a  #cp -p lvmtab.old lvmtab and then run a #vgexport -v /dev/VG_POC .   Anyway, the vgexport with the following error message:  vgexport: Volume group "/dev/VG_POC" is still active.


To 'vgexport' a volume group you must first deactivate it with 'vgchange -a n <vgname>'.  I don't know if that will work in this case.  If not, I would try reboot followed by a recreation of the '/etc/lvmtab' as before.  The kernel currently knows about the missing volumes.

 

Regards!

 

...JRF...

Mynor Aguilar
Valued Contributor

Re: Remove LVM information

thanks,  I've already tried to do a vgchange before the vgexport

 

/->vgchange -a n VG_POC
vgchange: Couldn't deactivate volume group "VG_POC":
Device busy

 

anyway,   I'll proceed to schedule the reboot of the server, I'll let you know if that works.   thanks for your help.

 

regards,

Mynor