Operating System - HP-UX
1849487 Members
6587 Online
104044 Solutions
New Discussion

Re: Recovering Lost Volume Group Definition

 
Vivek Shrivastava_1
Frequent Advisor

Recovering Lost Volume Group Definition

Hi,

Because of a bad disk one of my volume group is not working.

I need to ecover some how the Definition of each logical volume (like size, name...)

Please help me ASAP, i would really appreciate your help.

thanks
16 REPLIES 16
A. Clay Stephenson
Acclaimed Contributor

Re: Recovering Lost Volume Group Definition

vgcfgrestore -n /dev/vg01 /dev/rdsk/c1t6d0

You supply the correct VG and device node. That will write the VG data to the new disk.
You can then do a vgchange -a y /dev/vg01 to activate the volume. The lvol names should still be in /dev/vg01/.

Now, learn to use MirrorUX so that this is a non-event.

If it ain't broke, I can fix that.
Steven E. Protter
Exalted Contributor

Re: Recovering Lost Volume Group Definition

Side note: Mirror/ux is a wonderful product, but you do have to pay for the license one per processor.

A codeword from http://licensing.hp.com is required to use the product.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Vivek Shrivastava_1
Frequent Advisor

Re: Recovering Lost Volume Group Definition

Thanks for such quick reply.

I don't have any extra disk at this point. Would it be possible to create file which ahs the definition of each logical volume for the bad volume group?

Just to add more information, there are two disks in this volume group and only one of them is bed.

What would be the procedure to recover after the bad disk is replaced.

Please answer for both of the question. i have to show the logical volume definition list before they replaced the bad disk.

Waiting for help.


VivekS
Mel Burslan
Honored Contributor

Re: Recovering Lost Volume Group Definition

the only information you can get which logical volume is configured at what size is by doing a vgdisplay -vg vg01 (assuming vg01 has the bad disk, if not change it to yours). It will complain many times that it could not query all disks attached to this group but ignore that. You already know that one disk is bad.

After they replace the disk, you need to run the command

vgcfgrestore -n vg01 /dev/rdsk/c#t#d#

this will restore the logical volume structure on the new disk but not the filesystems themselves. You will need to check all the filesystems on this volume group and re-create them by

newfs -F vxfs /dev/vg01/lvolXXX

then hope that you have a pretty recent good backup that you can restore them from.
________________________________
UNIX because I majored in cryptology...
Sanjay_6
Honored Contributor

Re: Recovering Lost Volume Group Definition

Hi,

Replace the disk and do a vgcfgrestore. This will recreate the info back on the disk. Make sure you are using a disk of capicity that is equal to or more than the previous disk.

Do "man vgcfgrestore" for more help on the commands.

If the disk is mirrored, use vgsync to resync the mirror.

Try this link from itrc for more instructions.

http://www1.itrc.hp.com/service/cki/docDisplay.do?docLocale=en_US&docId=200000066374050

The itrc doc id is KBAN00000347.

Hope this helps.

Regds
Vivek Shrivastava_1
Frequent Advisor

Re: Recovering Lost Volume Group Definition

Thanks Sanjay,

For such a good link. You solved my half of the problem. I still need to produce some output which can just provide following two information for each logical volume in bad logical voule.

1. Name of the LV
2. Size of the LV in MB

really looking for some help.

thanks
Sanjay_6
Honored Contributor

Re: Recovering Lost Volume Group Definition

Hi,

Unless the vg is active you cannot get this info.

If the vg is active, you can get this info using vgdisplay / lvdisplay.

vgdisplay -v /dev/vg_name will give the detail info on the vg and the lv names and their sizes including the disks configured into the vg.

lvdisplay gives more detailed info about a specific lv.

If the vg is not active, you cannot get this info.

Hope this helps.

Regds
Vivek Shrivastava_1
Frequent Advisor

Re: Recovering Lost Volume Group Definition

thanks for reply!

So basically we can't get the info from the vgxx.conf file. There are lots of files in /etc/lvmconf directory. I figured out the name by looking into /dev/vgxx directory still looking for size.

vgcfgrestore must be reading this info from somewhere.

can't we create mapfile from the inactive volume group?

Please someone come with some great idea.

waiting fro help.

thanks

Mel Burslan
Honored Contributor

Re: Recovering Lost Volume Group Definition

I do not think that there is any utility to read the vgXX.conf file out there as it is a binary file.

Did you try activating the volume group ?

vgchange -a y /dev/vg01

________________________________
UNIX because I majored in cryptology...
Patrick Wallek
Honored Contributor

Re: Recovering Lost Volume Group Definition

You do not need to know any of the LV information to replace the disk. When you replace the disk you just need to do a 'vgcfgrestore -n vgname /dev/dsk/c?t?d?' Then you need to do a 'vgchange -a y vgname' to reactivate the volume group. Once you do that your VG is back to its previous state just without any of the data. After the vgchange you can do a 'vgdisplay -v vgname' to get all of the information for that volume group.

I'm not sure I understand exactly why you need the information right now.
Naveej.K.A
Honored Contributor

Re: Recovering Lost Volume Group Definition

hi,

there is still another way to find out the name of the logical volumes (if raw logical volumes are not used) from the /etc/fstab, where you will get the vgname as well as the logical volume name.

with best wishes
naveej
practice makes a man perfect!!!
zx_yu
New Member

Re: Recovering Lost Volume Group Definition

try this:
#vgchange -q n -a y /dev/vg01
#vgdisplay -v /dev/vg01
if the volume group can be activating by -q n,then you can find the information of logical volume
Shaikh Imran
Honored Contributor

Re: Recovering Lost Volume Group Definition

Hi,
For getting the name of the LV try your
/etc/fstab.
========================================
What has happened is the past
Tip for future:
Please keep the hard & soft copies of the following parameters.
bdf
/etc/fstab
/etc/passwd
/etc/hosts
/etc/group
vgdisplay ( of all VG's )
lvdisplay of all LV's
Please donot foget to do vgcfgbackup always or put it in the cron.
kernel parameters

You can make a script to do all the above activities and redirect it to a file and keep it for future reference.

Regards,
Imran






I'll sleep when i am dead.
Isralyn Manalac_1
Regular Advisor

Re: Recovering Lost Volume Group Definition

Over and above what the guys have told you, what I regularly do is to capture the system configuration information through System Information Reporter (SIR). It is a good practice to do so, so you'll have something to refer to in case a disaster strikes.

Regards,
Ira
James Lynch
Valued Contributor

Re: Recovering Lost Volume Group Definition

You can use the "-l" option to vgcfgrestore to get a listing of the VG config. vgcfgrestore reads this information from the /etc/lvmconf/vgXX.conf file.

JL
Wild turkey surprise? I love wild turkey surprise!
Vivek Shrivastava_1
Frequent Advisor

Re: Recovering Lost Volume Group Definition

Thanks Guys,

I guess i will simply restore it.

Manalac,

Could please provide some information on "System Information Reporter (SIR)." ? like how do i run it?

thanks