Operating System - HP-UX
1834137 Members
2336 Online
110064 Solutions
New Discussion

Re: Remove items in lvmtab

 
Kaleung Tsou
Advisor

Remove items in lvmtab

Hi,

I am trying to recreate a volume group called PBWbackup. The PBWbackup volume group was working fine until another administrator somehow removed it but the entries for it is still in lvmtab. thus, I am not able to recreate the VG PBWbackup. The lvmtab information is below.

PBWbackup has three disks associate with it. But the three disks are no longer presented to the system. I tried vgreduce, vgremove and it does not work. I tried renaming the lvmtab and did a vgscan. vgscan removed the PBWbackup entry, however, I have servicegard and I don't want to have to re-import all the VG that is associated with servicegard.

Please let me know if there is a way to just remove the PBWbackup VG.

Thanks

doux007:root 76> strings /etc/lvmtab
/dev/vg00
/dev/disk/disk7_p2
/dev/vg10
/dev/disk/disk190
/dev/vg01
/dev/disk/disk20
/dev/vg02
/dev/disk/disk23
/dev/vg03
/dev/disk/disk10
/dev/vg04
/dev/disk/disk13
/dev/vg_PRD0
/dev/disk/disk108
/dev/disk/disk111
/dev/vg_PRD1
/dev/disk/disk188
/dev/disk/disk189
/dev/disk/disk116
/dev/disk/disk191
/dev/disk/disk192
/dev/disk/disk193
/dev/vg_PRD2
/dev/disk/disk57
/dev/disk/disk60
/dev/disk/disk63
/dev/disk/disk66
/dev/disk/disk69
/dev/disk/disk72
/dev/vg_PBW0
/dev/disk/disk119
/dev/disk/disk122
/dev/vg_PBW1
/dev/disk/disk125
/dev/disk/disk128
/dev/disk/disk131
/dev/disk/disk134
/dev/disk/disk137
/dev/disk/disk140
/dev/vg_PBW2
/dev/disk/disk143
/dev/disk/disk146
/dev/disk/disk149
/dev/disk/disk152
/dev/disk/disk155
/dev/disk/disk158
/dev/vg05
/dev/disk/disk195
/dev/disk/disk208
/dev/vg06
/dev/disk/disk198
/dev/vg_PRD3
/dev/dsk/c11t4d7
/dev/dsk/c7t4d7
/dev/dsk/c5t4d7
/dev/dsk/c9t4d7
/dev/vg_nfs
/dev/dsk/c7t2d4
/dev/dsk/c5t2d4
/dev/dsk/c11t2d4
/dev/dsk/c9t2d4
/dev/dsk/c11t5d0
/dev/dsk/c7t5d0
/dev/dsk/c5t5d0
/dev/dsk/c9t5d0
/dev/PBWArchive
/dev/disk/disk221
/dev/PBWbackup
/dev/disk/disk225
/dev/disk/disk227
/dev/disk/disk232
11 REPLIES 11
skt_skt
Honored Contributor

Re: Remove items in lvmtab

"another administrator somehow removed it but the entries for it is still in lvmtab'


any idea how it was removed?
Patrick Wallek
Honored Contributor

Re: Remove items in lvmtab

If you are sure that the VG no longer exists, then you can try exporting the VG.

# vgexport /dev/PBWbackup

Deepak Kr
Respected Contributor

Re: Remove items in lvmtab

Yes, you don't need to re-export and import all the VGS again

vgexport is sufficient for removing the VG configuration when disks are not at all in use or in configuration itself.
"There is always some scope for improvement"
Sujit
Advisor

Re: Remove items in lvmtab

Run the command

#vgexport /dev/PBWbackup

If this VG is in cluster then same cmd. has to be run on other nodes. Be sure that this VG is not in use.
Torsten.
Acclaimed Contributor

Re: Remove items in lvmtab

"another administrator somehow removed it but the entries for it is still in lvmtab'"

"somehow" is most of the times "rm" - the root cause of many serious problems ;-)

Next time you/he/she should use vgremove or vgexport. Otherwise you have a nice configuration mismatch like you currently have.

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!   
Kaleung Tsou
Advisor

Re: Remove items in lvmtab

Thanks guys for the suggestion. The other someone is my supervisor and of course he is the type that never tells you what he did. He just tell you to fix it.

when I run vgexport /dev/PBWbackup I am getting the following error.

doux007:root 4> vgexport /dev/PBWbackup
vgexport: "/dev/PBWbackup/group": not a character device.
vgexport: Couldn't export volume group "/dev/PBWbackup"
Trevor Roddam_1
Valued Contributor

Re: Remove items in lvmtab

Hi.

This situation normally arrises from just deleting the /dev/VGXX/* files.

You can't use vgexport because the files do not exist, only the entries in the lvmtab.
Therefore you can not create the VG of the same name as it already exists, according to the lvmtab.

Catch 22 (If anyone remembers to book/movie.

vgscan is the only way out.
To confirm this is the issue use
strings /etc/lvmtab

You should see the ghost VG entries stream past. If so, get you Mgr to read the link below on how to do it properly.

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

The only way out is to use vgscan to recreate the lvmtab.
Look closely at the options, you can run it to see what would happen. Make sure what it comes up with is accurate and then do it for real. Have a BACKUP of the lvmtab before doing this. VERY Important.

I've used it in an emergency and, apart from the stress headache it worked a charm. But make sure it does the right thing before committing and rebooting.

Trevor.
Baldric, I have a plan so cunning you could pin a tail on it and call it a weasle.
Masud Parvez
Valued Contributor

Re: Remove items in lvmtab

Did you try to use this -

please do the following steps.....:
1. save /etc/lvmtab to another file
2. remove /etc/lvmtab
3. use vgscan(1m) -v to re-create /etc/lvmtab
4. NOW use vgcfgbackup(1m) to save the LVM setup
vjta
Regular Advisor

Re: Remove items in lvmtab

Hi!
as u r saying the vg is not there then simply run # vgexport

AS the vg is cluster awared make sure it is deactive or u can try #vgchange -c n


regards
vjta
Vijeta Bhedi
vjta
Regular Advisor

Re: Remove items in lvmtab

Hi !
sorry pls read as
#vgchange -c n

regards
vjta
Vijeta Bhedi
Kaleung Tsou
Advisor

Re: Remove items in lvmtab

I exported all the vg that belongs to servicegard. Ran vgscan. Then import the exported vgs.