1844423 Members
2640 Online
110233 Solutions
New Discussion

import prob.....

 
SOLVED
Go to solution
Chi Yi Lee
Advisor

import prob.....

Hi

I made a mistake by exporti a vg that I need...
I did #vgexport -v -f outfile /dev/vg02

and I tried to put it back by doing
#vgimport -v -f outfile /dev/vg02
and it tells me that
vgimport: "/dev/vg02/group" not a character device

how do I need to put it back the way it was?
12 REPLIES 12
Joseph Loo
Honored Contributor

Re: import prob.....

hi,

it should be:

# vgimport -m outfile -v /dev/vg02
e.g. # vgimport -m outfile -v /dev/vg02 /dev/dsk/c#t#d#

regards.
what you do not see does not mean you should not believe
Joseph Loo
Honored Contributor

Re: import prob.....

hi,

sorry, there r some more pre-steps:

# mkdir /dev/vg02
# mknod /dev/vg02/group c 64 0x020000 --> check if the 0x020000 has been use, if so, look for another one.
# vgimport -v -f outfile /dev/vg02
# vgchange -a y /dev/vg02

regards.
what you do not see does not mean you should not believe
Naveej.K.A
Honored Contributor

Re: import prob.....

hi,

think you have not done any mistake..
Only thing is that when you export a volume group, its information in the system is removed. i.e. it updates /etc/lvmtab and deletes the files and directories for the lvm device files.

So before importing the Volume group, you need to create the device files for the same.

ll /dev/*/group
(Check for free minor numbers)
mkdir /dev/vg02
mknod /dev/vg02/group c 64 0x020000
vgimport -v -f outfile /dev/vg02
vgchange -a y /dev/vg02

with best wishes
Naveej
practice makes a man perfect!!!
Chi Yi Lee
Advisor

Re: import prob.....

Thanks

well the lvols are restored although their names are not what I named before. It all becamse lovl10, 11, 12, ... in sequence.

since I also making that vg02 for mc/servicegard, I need it to be just like it was before. How would I do this??? thankx
Naveej.K.A
Honored Contributor

Re: import prob.....

hi,

check in the /etc/fstab what exactly the name of the logical volumes were....

i.e. /dev/vg02/xxxxx

rename the lvol10 to lvolx in the /dev/vg02 directory. Also rename the raw or character device files to the actual one.

for eg...if your /etc/fstab has entries for mounting

/dev/vg02/lvora1
/dev/vg02/lvora2

then in /dev/vg02...rename lvol1 to lvora1 and rlvol1 to rlvora1 and lvol2 to lvora2 and rlvol2 to rlvora2..

This need not work always, if the entry in the /etc/fstab is not in the order in which the lvols had been created

with best wishes
Naveej
practice makes a man perfect!!!
Sridhar Bhaskarla
Honored Contributor

Re: import prob.....

Hi,

If this is an old logical volume, then you may find the map file under /etc/lvmconf directory. Look for vg02.map under it. If not, but if it is already setup in serviceguard, it means it might have already imported on the other node(s). In that case, you can generate a map file on that node using the command

#vgexport -p -v -m /tmp/vg02.map vg02

Copy vg02.map file onto this system in /tmp directory.

vg02.map file contains nothing but a mapping of logical volume names to their minor numbers.

Once you got the map file in any of the above ways, then export the VG and import it back.

#vgchange -a n vg02
#vgexport -v -m /tmp/vg02new.map -f /tmp/vg02.disks vg02

Use the procedure (create directory, group files) given already to import the VG except that you will be adding another option -m

#vgimport -v -m /tmp/vg02.map -f /tmp/vg02.disks vg02
#vgchange -a y vg02
(if it is serviceguarded already, then skip the vgchange step)

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Chi Yi Lee
Advisor

Re: import prob.....

thanks~

I tried looking for mapfile but.... I did not find it. I was thinking to restore vg02 by ignite. This "I think" will solve the maping thing since it will bring back to vgexport stage.

The only thing that I'm concern (if what I think was right) is that I added several lvols into vg02 after the ignite backup. Should I delete them before restoring to make the mapping exact same like before? or it wouldn't cause any prob?
Bharat Katkar
Honored Contributor

Re: import prob.....

Hi Lee,
You have not lost any data as such but only the VG02 structure. It would be an good idea to get back all those special files for VG02. If you try doing IGnite backup, you may loose updated info after the backup and also other lvols you have created after backup.
See if vgscan helps you out in any way.
man vgscan.

Hope that helps.
Regards,
You need to know a lot to actually know how little you know
Sridhar Bhaskarla
Honored Contributor
Solution

Re: import prob.....

Hi,

I wouldn't suggest to restore it from ignite particularly if you added more logical volumes.

One another way is to "rename" the logical volumes. However, you will need to determine the usage of the logical volumes. For ex.,

#mkdir /test
#mount /dev/vg02/lvol1 /test
#cd /test

Note the contents of /test and see how it was used. For ex., if you made out that it was /oracle before, then find out the corresponding logical volume from /etc/fstab file say lvora. Then you can rename lvol1 to lvora by following these steps

#cd /
#umount /test
#mv /dev/vg02/lvol1 /dev/vg02/lvora
#mv /dev/vg02/rlvol1 /dev/vg02/rlvora

Becareful while renaming the lvol names. It's bit painful if you have quite a few logical volumes under this VG.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Sridhar Bhaskarla
Honored Contributor

Re: import prob.....

Hi (Again),

I just looked at your other thread about adding a logical volume to serviceguard. Is this issue related to it?.

If so, then I suppose that you may have this volume group already defined on the other system. You can generate the map file there and use it on this system and you don't have to go through these pains. Look at my previous response.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Chi Yi Lee
Advisor

Re: import prob.....

Hi Thanks for the advice.


I will try to rename the lvols. The only problem that I have is ... most of the lvols are empty. So is there any unique address or some information for each lvol?

ps. Do I need to put all the lvol to fstab? since I'm not able to see vg02?
Chi Yi Lee
Advisor

Re: import prob.....

Thanks now at least my lvols are back!!!
you don't know how happy I am. Thanks to you all.

now i just need to figure out my MC/SG is having difficulty activating package. Something to do with vgchange and node thing. But thanks for the help.