Operating System - HP-UX
1825768 Members
2053 Online
109687 Solutions
New Discussion

Moving LVM disk from one system to another

 
SOLVED
Go to solution
John Urchek
Occasional Contributor

Moving LVM disk from one system to another

Is it possible to move a functioning disk (36GB LVM w/o mirror) to another system without losing the data currently on the drive?
5 REPLIES 5
Thierry Poels_1
Honored Contributor

Re: Moving LVM disk from one system to another

hi,

sure, have a look at vgexport/vgimport.

regards,
Thierry Poels.
All unix flavours are exactly the same . . . . . . . . . . for end users anyway.
Pete Randall
Outstanding Contributor

Re: Moving LVM disk from one system to another

John,

Is it a volume group unto itself? If so, you can vgexport it and then vgimport it on the new system. If it's part of a larger volume group, I don't think you can.


Pete

Pete
OZ_4
Occasional Advisor
Solution

Re: Moving LVM disk from one system to another

you can move it from one sys to another

but you should take some steps before moving

# umount /dev/vg01/lvol1
# umount /dev/vg01/lvol2
...

# vgchange -a n vg01
# vgexport -m /tmp/mapfile vg01
# ll /dev/*/group (choose a unique minor no.)
# mkdir /dev/vgnew
# mknod /dev/vgnew/group c 64 0x010000
# vgimport -m /tmp/mapfile vgnew /dev/dsk/c4t0d0 /dev/dsk/c5t0d0 ...
Geoff Wild
Honored Contributor

Re: Moving LVM disk from one system to another

Yes it's possible.

Create a map file:

vgexport -p -v -s -m /tmp/vgXX.map /dev/vgXX

Copy that to other server.

umount all file systems on vgXX

vgchange -a n /dev/vgXX

move the disk

Import it:

mkdir /dev/vgXX
mknod /dev/vgXX/group c 64 0xHH0000

vgimport -v -s -m /tmp/vgXX.map /dev/vgXX

XX is VG number in decimal, and HH is hex equiv of that vg number.

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
John Urchek
Occasional Contributor

Re: Moving LVM disk from one system to another

Thank you all. I was aware of the vgexport and vgimport command, but never had used them. I thought that they had some other use.

Thanks again.