cancel
Showing results for 
Search instead for 
Did you mean: 

Importing LUNs

SOLVED
Go to solution
Sid Bytheway
Occasional Advisor

Importing LUNs

After a fresh install, I am ready to import volumes I exported prior to the reinstall. In SAM I see I have two controllers and a LUN. I select the LUN, and it wants me to either put it in a new volume group, or an old one, vg00. I want it to go in the one it was in before. We had 3, vg02, vg03, and sybase. Can I tell it to configure itself the way it was before?
6 REPLIES
Sid Bytheway
Occasional Advisor

Re: Importing LUNs

I don't know how this got in the database section, I thought I was in the 'general' area.
Byron Myers
Trusted Contributor

Re: Importing LUNs

You should be able to configure the way it was before. What vgexport command did you use? (like vgexport -m /tmp/mapfile vg02)
If you can focus your eyes far and straight enough ahead of yourself, you can see the back of your head.
Sid Bytheway
Occasional Advisor

Re: Importing LUNs

No options, simply

vgexport vg03

after doing

vgchange -a no vg03

etc.

I did save a copy of the output of vgdisplay
Sid Bytheway
Occasional Advisor

Re: Importing LUNs

I get the lvmtab and other files off backup if need be.
Byron Myers
Trusted Contributor
Solution

Re: Importing LUNs

If you can tell which disks belong in a corresponding vg, then this is a way to do it.
for example, vg02 - if c1t0d0 c2t0d0 were the disk on the old system (your saved vgdisplay -v vg02 would show this - if you used the "-v" option), and on the new OS, the disks are, say c5t0do and c6t0d0, then:
1. create the directory /dev/vg02
2. create the "group" file in /dev/vg02.
The minor number MUST be unique.
do a "# ls -al /dev/vg* | grep group" to
see the existing group minor numbers.
Example:
# ls -al /dev/vg*
the minor numers shown might be:
0x000000 (root volume group vg00)
0x010000 (some other volume group)
Pick the next minor number (in hex), in
this example it is 0x020000.
#mknod /dev/vg02/group c 64 0x020000

then
# vgimport /dev/vg02 /dev/dsk/c5t0d0 /dev/dsk/c6t0d0
(this is using the new disks)

then
# vgchange -a y vg02
# vgdisplay -v vg02
you should see the logical volumes - lvol1, lvol2, etc.
You will need to figure out which of these logical volumes belongs where. If you saved a copy of /etc/fstab, this will help.

The usual method to export vg's for OS re-installs is to use "vgexport -m -s " this prevents all of this lv stuff.

If you can focus your eyes far and straight enough ahead of yourself, you can see the back of your head.
Sid Bytheway
Occasional Advisor

Re: Importing LUNs

Thank you. This is all very useful. But it sounds like I have no guarantee that the disk names will be the same on the new OS?

I did no do vgdisplay -v
only vgdisplay.

I am trying to retrieve a copy of lvmtab, but if the disks are named differently it will complicate the whole process. It sounds like I better just recreate the volumes and restore from backup.