Simpler Navigation for Servers and Operating Systems
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
cancel
Showing results for 
Search instead for 
Did you mean: 

LVM - vgexport/vgimport

SOLVED
Go to solution
Deepak Seth_1
Regular Advisor

LVM - vgexport/vgimport

I have a following sceniero

DISKS VGS

A vg1
B vg1
C vg2
D vg2
E vg3
F vg3
G vg4
H vg4

Inorder to get the maximum performance benefit , i would like to change my phy volume under the vg's to

A vg1
G vg1
B vg2
H vg2
C vg3
F vg3
D vg4
E vg4

I know this can be achived using vgexport/vgimport command . Is this correct way

1. vgexport -p -m vg1.map /dev/vg1
2. vgchange -a n /dev/vg1
3. vgimport -m vg1.map /dev/vg1 /dev/dsk/A /dev/dsk/G
4. vgchange -a y /dev/vg1

Pls. correct me and let me know in case i need to take any precautions.

thanx/deepak
7 REPLIES
Denver Osborn
Honored Contributor

Re: LVM - vgexport/vgimport

Deepak,

In your scenerio the only way the vgexport/vgimport would work is if you are planning on moving disk drives to new controllers and changing the target id.

If vg1 contains A and B, you can't do an import for vg1 and specify disk A and G because Disk G belongs to vg04. Had you planned on physically moving disks arround?
Deepak Seth_1
Regular Advisor

Re: LVM - vgexport/vgimport

yes , i will be moving the 4 disks to a different controller - A,B,C,D .
however E,F,G,H will reamin on the existing . if this doesn't work , suggest me some other alternative.
Denver Osborn
Honored Contributor

Re: LVM - vgexport/vgimport

Here's what I'd suggest;

Unmount filesystens then deactivate the VGs
# vgchange -a n /dev/vg1
# vgexport -v -s -m /tmp/vg1.map /dev/vg1

-now shutdown box and make your changes

After box is backup and online, use vgimport

# mkdir /dev/vg1
# mknod /dev/vg1/group c 64 0x0?0000
(group minor number will be unique)
# vgimport -v -s -m /tmp/vg1.map /dev/vg1
# vgchange -a y /dev/vg1
# mount -a

Do this for each vg you are moving around PVs to. If you use the -s with the -m option you won't need to know disk devices files for the import.
Deepak Seth_1
Regular Advisor

Re: LVM - vgexport/vgimport

just clicked something , yes i can move the both sets of 4 disk to differnet controller.

DISKS
ABCD - controller 1 to controler 2
EFGH - controller 2 to controller 3

Now is it possible ?
Denver Osborn
Honored Contributor
Solution

Re: LVM - vgexport/vgimport

either way I would use the steps from above. vgexport, move disks, vgimport. The results would be the same.
Deepak Seth_1
Regular Advisor

Re: LVM - vgexport/vgimport

u are saying that after putting the disks to new controller. i have to do mkdir dir and mknod again. But since /dev will remain same after moving the disk to different controllers , then mkdir/mknod will not work for the same vg name.

Also u have not specify the new disks while doing the vgimport.

How this will work ?
Deepak Seth_1
Regular Advisor

Re: LVM - vgexport/vgimport

thanx for your help. pls. ignore my last reply. I was using -p with vgexport and hence it was not removing the vg from lvmtab and /dev.