Operating System - HP-UX
1834535 Members
3112 Online
110069 Solutions
New Discussion

Re: How can I restore VG definations after a System restore

 
Sushil Singh_1
Advisor

How can I restore VG definations after a System restore

Hi All,
I do lot of restore using tape create using by make_recovery. The problem is that I lose all the shared volume groups. I can see the defination for the VG and LVs but am not able to mount those. It complains the following.

vgchange: Volume group "/dev/vg02" does not exist in the "/etc/lvmtab" file.
vgchange: Volume group "/dev/vg03" does not exist in the "/etc/lvmtab" file.
vgchange: Volume group "/dev/vg02" does not exist in the "/etc/lvmtab" file.
vgchange: Volume group "/dev/vg03" does not exist in the "/etc/lvmtab" file.
vgchange: Volume group "/dev/vg02" does not exist in the "/etc/lvmtab" file.
vgchange: Volume group "/dev/vg03" does not exist in the "/etc/lvmtab" file.

I can see the definations for those vg and lv

greategg# ls -altr /dev/vg02
total 10
crw-rw-rw- 1 root sys 64 0x020000 Dec 14 22:18 group
drwxrwxrwx 2 root sys 1024 Dec 14 22:19 .
crw-r----- 1 root sys 64 0x020003 Dec 14 22:19 rlvol23
crw-r----- 1 root sys 64 0x020002 Dec 14 22:19 rlvol22
crw-r----- 1 root sys 64 0x020001 Dec 14 22:19 rlvol21
brw-r----- 1 root sys 64 0x020004 Dec 14 22:19 lvol24
brw-r----- 1 root sys 64 0x020003 Dec 14 22:19 lvol23
brw-r----- 1 root sys 64 0x020002 Dec 14 22:19 lvol22
brw-r----- 1 root sys 64 0x020001 Dec 14 22:19 lvol21
crw-r----- 1 root sys 64 0x020004 Dec 14 22:19 rlvol24
dr-xr-xr-x 18 bin bin 4096 Mar 16 13:09 ..
greategg#

Please help

Thanks
Sushil Singh
5 REPLIES 5
Patrick Wallek
Honored Contributor

Re: How can I restore VG definations after a System restore

Teh vgscan command will rescan the system looking for valid volume groups.

See 'man vgscan' for more information.
pap
Respected Contributor

Re: How can I restore VG definations after a System restore

HI ,
Do following
1. Rename the /etc/lvmtab to /etc/lvmtab.old.
2. Run following command.
#vgscan

Now, activate those volume groups using vgchange command.

# vgchange -a y /dev/vg02
# vgchange -a y /dev/vg03
and so on..

Hope this helps.

-Piyush.
"Winners don't do different things , they do things differently"
pap
Respected Contributor

Re: How can I restore VG definations after a System restore

HI ,
Do following
1. Rename the /etc/lvmtab to /etc/lvmtab.old.
2. Run following command.
#vgscan

Now, activate those volume groups using vgchange command.

# vgchange -a y /dev/vg02
# vgchange -a y /dev/vg03
and so on..

Now new lvmtab file will be created and you can delete the lvm.old file.

Hope this helps.

-Piyush.
"Winners don't do different things , they do things differently"
Kenny Chau
Trusted Contributor

Re: How can I restore VG definations after a System restore

You can use vgscan to re-scan the VGs or vgcfgrestore to restore the VG configuration if you had replaced a new HD.

Man those commands for information.

Hope this helps.
Kenny.
Kenny
Sanjay_6
Honored Contributor

Re: How can I restore VG definations after a System restore

Hi Sushil,

Just restore the file /etc/lvmtab from your original backup.

Or if you have the map file for the vg backed and, restore the same to the disk, do a vgexport to remove the existing vg info and then do a vgimport using the map file to recreate the vg info on the system.

vgexport /dev/vg02
mkdir /dev/vg02
mknod /dev/vg02/group c 64 0x0n0000
vgimport -s -m /tmp/vg_name.map /dev/vg02

Then do a vgchange,

vgchange -a n /dev/vg02
vgchange -a y /dev/vg02

Hope this helps.

Regds