1837897 Members
3250 Online
110123 Solutions
New Discussion

Re: vg01 export /import

 
Jay Gray
Occasional Advisor

vg01 export /import

I have a 10.20 box I plan on re-igniting
I have vg01 which is my /users dir mounted on
/dev/vg01/lvol2
(vg01/lvol1 is swap)
What are the steps before and after the re-ignite to recover vg01 and maintain access to the data on /vg01/lvol2
13 REPLIES 13
James R. Ferguson
Acclaimed Contributor

Re: vg01 export /import

Hi:

If you simply recovering onto the same hardware that was used when the Ignite recovery image was created, it is very likely that you will not need to do anything.

That is, the Ignite 'make_tape_recovery' process will attempt to 'vgimport' non-vg00 volume groups for you. As long as the hardware paths (device files) haven't changed, the import will be automatic. If the disk device files do change (possible) then you merely need to manually 'vgimport' using the correct device files and the appropriate mapfile Ignite placed in 'etc/lvmconf/' directory.

See the man pages for 'vgimport' for more information.

Regards!

...JRF...
Victor BERRIDGE
Honored Contributor

Re: vg01 export /import

Hi,
You did have swap on v00 yes?
make it primary swap again

Look in /dev/vg01 the values of group:
ll group - you may need the minor number later
make a vgexport in a mapfile using -m ...
dont forget before reimporting to create vg01:
mkdir /dev/vg01
mknod /dev/vg01/group c 64 0x

then vgimport -m

All the best
Victor
Bryan D. Quinn
Respected Contributor

Re: vg01 export /import

Hey Dan,

I would make a good backup, but it has been my experience with Ignite that VG01 will be fine. That is as long as you don't pvcreate it's disk(s) or vgexport it. I have re-ignited many times before and when the box comes back up the lvols outside of vg00 are fine and mounted, ready to go. To be sure though, I definately recommend a good backup...just so you don't have a GOTCHA!

Hope this helps!
-Bryan
Ian Dennison_1
Honored Contributor

Re: vg01 export /import

As long as you shut the box down in an orderly manner, the Ignite when it rebuilds should recreate the /dev/vg* entries and the /etc/fstab entries.

The data on the disks will still be present (as long as you did not overwrite them by installing the OS on them).

Share and Enjoy! Ian
Building a dumber user
A. Clay Stephenson
Acclaimed Contributor

Re: vg01 export /import

On your old box:

1) lp /etc/fstab
strings /etc/lvmtab | lp
bdf | lp
vgdisplay -v /dev/vg01 |lp
ioscan -k -C disk -fn | lp
(all of this can prove very useful later)
2) vgexport -p -m /tmp/vg01.map /dev/vg01

Copy the mapfile using ftp or tar to a safe place or put in somewhere in vg00 so that you will have it later. If your LVOL names are 'standard' lvol1, lvol2, ... the map file is optional.

On your new box:

3) cd /dev
umask 022
mkdir vg01
cd vg01
mknod group c 64 0x010000

The minor number 0x010000 must be unique; i.e. not used by vg00, vg02, ...

Restore your mapfile, vg01.map to /tmp (if needed).

4) Using the disk device data listed in the vgdisplay output (or etc/lvmtab)

vgimport -m /tmp/vg01.map -v /dev/vg01 /dev/dsk/c1t6d0 /dev/dsk/c2t6d0 (your disk devices will vary)

vgchange -a y /dev/vg01
vgcfgbackup /dev/vg01

using the fstab listing, edit /etc/fstab and add back any needed mount entries

create the mountpoint directories using mkdir,
e.g. mkdir /user

5) Mount the directories
e.g. mount /user



If it ain't broke, I can fix that.
Jay Gray
Occasional Advisor

Re: vg01 export /import

Thanks for the advice.
Now would I also do the same if I wasnt intending on re-igniting but just taking preventative measures incase of a harddrive failure? Restoring data takes longer than if I can just recover the vg01 information and remount the vols
Jeff Schussele
Honored Contributor

Re: vg01 export /import

Hi Dan,

I would add one minor thing to Clay's excellent post.

Use -s in vgexport:
vgexport -s -p -m /etc/lvmconf/vg01.map /dev/vg01

The -s will write the VGID into the map file which makes recovering vg01 faster IF the HW path changes. This causes vgimport to look for that VGID when it does the vgimport. Then you will not have to chase the new HW path down before vgimporting. This MUST always be done when you vgexport / vgimport to another host.

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Jay Gray
Occasional Advisor

Re: vg01 export /import

I tried the following
vgexport -s -p -m /etc/lvmconf/vg01.map /dev/vg01
but it gives me /dev/vg01 is still active

is there away I can do this without deactivating the volume group which is still used?
John Poff
Honored Contributor

Re: vg01 export /import

Hi,

The message about vg01 being active is just a warning. It won't hurt anything. You should be able to see the contents of your map file now.

JP
Marco Santerre
Honored Contributor

Re: vg01 export /import

Dan,

you actualyl DID do the mapping of the Volume Group... that was just an informational message telling you that the Volume Group is still active, but if you look, you'll see your mapfile in place.
Cooperation is doing with a smile what you have to do anyhow.
Ian Dennison_1
Honored Contributor

Re: vg01 export /import

Dan,

It does warn that the group is still active, but should create the files you specified.

Can you check these and confirm they exist? There should be a list of disks produced as part of the 'vgexport' output to screen.

Share and Enjoy! Ian
Building a dumber user
Jay Gray
Occasional Advisor

Re: vg01 export /import

Yes the map file is there Thanks
Jay Gray
Occasional Advisor

Re: vg01 export /import

Thanks for your help I worked like a charm. 1 more question is that I had a swap at vg01/lvol1 do I try to import that or just re create the swapp and assign it to vg01/lvol1?