Operating System - HP-UX
1833184 Members
3082 Online
110051 Solutions
New Discussion

removed volume group device files

 
SOLVED
Go to solution
Brian Street_1
Advisor

removed volume group device files

hello,

I know I can recover (right?) from this boo boo I did. I was moving data from one logical volume to a new one I created because of failing disks and in renaming the logical volume names I wrote over the existing volume information. now I can't get either volume to mount.

I tried to recreate the lvmtab file with vgscan but it still can't recognize my lv or filesystems because the device files are all screwed up or missing.

Can I get them all back or am I out of luck. The information is still on the disks.

Thank you,
Brian Street.
3 REPLIES 3
Michael Steele_2
Honored Contributor
Solution

Re: removed volume group device files

Absolutely, positively.

To be sure, restore /etc/vg**/*lv* information from a tape. You'll also need an old /etc/lvmtab file and maybe the /etc/lvmconf/vg##.conf files. Restore these under /tmp/lvmtab_old, etc. Don't put them back into /etc.

Determine what disk your vg's belong to with:
strings /tmp/lvmtab_old, and,
-and-
vgcfgrestore -f /tmp/lvmconf/vg##.conf_old -l

Now, you may only need these commands:
# vgexport -p -s -m /tmp/vg05map /dev/vg##
-and-
# vgimport -s -p -m /tmp/vg##map

When you vgimport with the -s option all of the disks that belong to /dev/vg## respond to the "VGID" when it is broadcasted out over the SCSI bus, or disk array, by the vgimport command. And the member disks are suppose to answer the broadcast query. A list of disk should be displayed.

Update the /etc/lvmtab file now by removing the -p option:

vgimport -s -m /tmp/vg##map.

Hopefully the above is all you need but sometimes you have to specify each disk. Use the /tmp/lvmtab_old, etc., info for this.

vgimport /dev/vg## /dev/dsk/c... /dev/dsk/c...., etc.

When done, cross reference the old and new /etc/lvmtab and /etc/lvmconf information.
Support Fatherhood - Stop Family Law
Brian Street_1
Advisor

Re: removed volume group device files

hello,

here is what I have done so far...I did a vgexport to a map file (the map file had zero length?) and then did vgimport listing each disk device (created the new directory and group file before running vgimport). This appears to have been successful since I now have my vg-group added to lvmtab with the correct disks...

but, when I try to mount the filesystem now, it tells me cannot open the /dev/vghome/lvol1: no such device or address.

The previous logical volume name was lvhome...can/should I name the logical volume when I vgimport?
Brian Street_1
Advisor

Re: removed volume group device files

I got everything back.

this is a new system and had not been backed up yet, so I didn't have the safety net of restoring from a backup. at least the information on the disks was not changed so that helped a lot.

I forgot to activate the volume and that prevented me from mounting the filesystem.

Thanks for your help,
Brian.