Operating System - HP-UX
1751911 Members
5048 Online
108783 Solutions
New Discussion юеВ

Removed devices from LVs and cannot vgexport dsks

 
Philip Kernohan
Advisor

Removed devices from LVs and cannot vgexport dsks

One of our large disk arrays was reconfigured and the character/block device files have been removed from UX-11.

The logical volumes that were on the devices are no longer required but they were part of vg00. Most LVM commands are now spitting out spurious warnings and sam is no longer co-operating - I guess sam's parser doesn't handle all the messages it could receive if one does the unexpected.

If I vgexport the devices I get a "/dev/dsk/cXtYdZ file not found message" and a vgdisplay still returns many warnings. A vgscan has been performed and that has moved some alternate links BUT it still did not reduce vg00 to the devices that are still there.

What's the quickest way to get the unused and now unneeded devices out of vg00 and return the system to a stable state.

Again, many many thanks in advance - reponses here are fast and well appreciated.
It's nice to be important but it's more important to be nice
6 REPLIES 6
Alan Riggs
Honored Contributor

Re: Removed devices from LVs and cannot vgexport dsks

Try vgreduce -f vg00.
Philip Kernohan
Advisor

Re: Removed devices from LVs and cannot vgexport dsks

Alan,

thanks for the quick response.

vgreduce -f /dev/vg00 returns the following:

vgreduce: couldn't query physical volume cXtYdZ. The specified path does not correspond to physical volume attached to this volume group.

Still searching ...
It's nice to be important but it's more important to be nice
John Palmer
Honored Contributor

Re: Removed devices from LVs and cannot vgexport dsks

Hi Philip,

If it's just the block and character device files that are missing from /dev/vg00 then you can just recreate them with mknod.

What I would do is :-
mknod lvol? c 64 0x??0000
mknod rlvol b 64 0x??0000
for some of the values of ?? that you haven't got already. Check with ll /dev/vg00.

Once you have created these, vgdisplay and pvdisplay will show up the 'hits' as vaalid volumes and you can simply lvremove -f them. Repeat until you have lvremoved all the volumes that you don't want and then simply rm the 'misses'.

Regards,
John
Devbinder Singh Marway
Valued Contributor

Re: Removed devices from LVs and cannot vgexport dsks

DO what john suggested and if still a problem it could be the /etc/lvmtab is out of sync , so try moving it out the way and then run vgscan to recreate it , and then try again.

laters
Seek and you shall find
Steve Massey_1
Frequent Advisor

Re: Removed devices from LVs and cannot vgexport dsks

Hi some notes I made when I had a GHOST disk once


LVM Ghost disks
Removing a disk before it is removed logically

1) vgdisplay -v
If this shows the error
"Couldn;t query physical volume
the specified path does not correspond to physical volume attached to volume group"

This is a GHOST disk

2) hpux -lm (;0) /stand/vmunix

Activate vol group with GHOST, use quorum switch if needed
3) vgchange -a y -q n /dev/vgXX

Gather info on Vol grp and Lvol's, look which are on GHOst disk
Get minor No of vgXX
4) vgdisplay -v /dev/vgXX
lvdislpay -v /dev/vgXX/lvol*
mount /usr
ll /dev/vgXX
umount /usr

Remove lvols on GHOST disk
5) lvremove /dev/vgXX/lvolX

Rename Vol grp info
6) mv /etc/lvmtab /etc/lvmtab

7) vgscan -v

8) vgchange -a n /dev/vgXX

Create a lvol map
9) vgexport -m vgXX_map /dev/vgXX

Recreate Vol grp dir files
10) mkdir /dev/vgXX
mknod /dev/vgXX/group c 64 0x0X0000

Use all disks shown in lvmtab(IN ORDER)
11) vgimport -m vgXX_map /dev/vgXX /dev/dsk/cXtXd0 dev/dsk/cXtXd0
vgchange -a y /dev/vgXX
vgreduce -f /dev/vgXX (this should eliminate GHOST)
mv /etc/lvmtab /etc/lvmtab.bak
vgscan -v
vgcfgbackup /dev/vgXX
vgdisplay -v vgXX

Maybe this will help

Steve
Philip Kernohan
Advisor

Re: Removed devices from LVs and cannot vgexport dsks

Thank you all for responding.

The problem stemmed from removing disks that were in a volume group and further to that, actually using rmsf to remove the device files. Even after recreating dummy device files we could not get them out of the vg00.

Steve, it sounds like you're reply came the closest but we did a recovery at the weekend and so I don't have the opportunity to try it out.

Here's what we did, in case anyone is interested:

Broke all mirrors on LVs where possible.

Rebooted and came up in single user mode.

Mounted the LVs that were not affected by the removal of the disks - i.e. those without stale extents.

Removed the LVs that were corrupted using lvremove.

Performed a vgreduce -f vg00 to remove all unused disks

Recreated LVs, FSs using lvcreate and newfs.

Restored data from fbackup/ignite tape.

Again, many thanks for all the input.
It's nice to be important but it's more important to be nice