Operating System - HP-UX
1832650 Members
3002 Online
110043 Solutions
New Discussion

vgimport same volume group

 
Nikee Reddy
Regular Advisor

vgimport same volume group

Hello,

In a cluster environment, we have couple of volume groups. We are planning to add a total of 2 striped logical volumes to the existing volume group vgdb5 by addting 4 more disks to it.

In this scenario,
1) while exporting the volume group vgdb5 do I have to deactivate it before exporting?

2) What actually happens when I import the existing volume group vgdb5, which had earlier 2 striped logical volumes with four disk and has been extended to 8 disks with 4 striped logical volume groups?

I really appreciate your response.

Thanks,
Nikee
7 REPLIES 7
Vasikaran Venkatesan
Frequent Advisor

Re: vgimport same volume group

If you are only trying to export the VG map (for the other node and importing it over there)- you do not have to deactivate it.

1)
do vgexport -pvs -m
(ignore the error that VG is active)

In the other node.
make sure the new disks are seen in the other node.
ftp or rcp the map file
do vgimport -s -m

2) Nothing -
the second node is aware that there are new PVs/ LVs in the VG and when it actually imports the VG, it will bring in everything.

If you are trying to do export / import for actual test you can rerun the vgexport without -p (preview) to export it actually
Geoff Wild
Honored Contributor

Re: vgimport same volume group

Just answered this myself a few days ago in this thread:

http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x1591227a6ab4d711900a0090279cd0f9,00.html

The answer to #1 - deactivate NOT required

#2 - you will see the new devices when you do a strings /etc/lvmtab (if you have granted access to the new disks and have ioscaned/insf -e).

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.
Tim D Fulford
Honored Contributor

Re: vgimport same volume group

Hi

I'm not so sure you will actually get what you want. you cannot export the a volume group with 2 disks & import it into another with 4 disks. However you CAN modify the existing volume group by addin mode disks. Creating NEW logical volumes within it & striping these over the 4 disks. Then migrate the data from the old LV to the new LV. e.g.
# pvcreate /dev/rdsk/cXt?d?
# pvcreate /dev/rdsk/cYt?d?
# vgextend vgdb5 /dev/dsk/cXt?d? /dev/dsk/CYt?d?

For KB striping... stripe as follows
# lvcreate -n -i 4 -I <4|8|16|32|64> -L vgdb5

For extent striping.... stripe as fillows
edit the /etc/lvmpvg accordingly
# lvcreate -n -D y -s g -L vgdb5

Transfer data
# dd /dev/vgdb5/r bs=4096k # of=/dev/vgdb5/r
# lvremove /dev/vgdb5/

1)
svra# la -s /dev/vgdb5/group
-- note minor number, say 0xNN0000
svra# vgexport -m -s -p -v vgdb5
svra# rcp svrb

svrb# vgexport vgdb5
svrb# mkdir /dev/vgdb5
svrb# mknod /dev/vgdb5/group c 64 0xNN0000
svrb# vgimport -m -s -v vgdb5

IF you are alternating your disks then it may be best if you do not use vgexport with -s & list the disks expliitly on the vgimport
svra# vgexport -m -p -v vgdb5
&
svrb# vgimport -m -v vgdb5 /dev/dsk/cXt?d? /dev/dsk/cYt?d? /dev/dsk/cXt?d? ...etc...

2) the vgimport reads the LVM disk headers & creates the relavent devices in /dev/vgdb5/ & names them according to the mapfile. It also updates the /etc/lvmtab as to the disks & their order in the volume group. I.e. the OS gets a abridged copy of what is already listed on the disk headers.

Regards

Tim
-
Tim D Fulford
Honored Contributor

Re: vgimport same volume group

oops I just read you Q again. You are using Mirrored Extent stripes so ignore my kilobyte stripes & use

# lvcreate -m 1 -D y -s g -L -n vgdb5

Tim
-
Nikee Reddy
Regular Advisor

Re: vgimport same volume group

Hello,

Thanks for your response.

While I am importing the vgdb5 volume group on the other system, system is responding with the following error message:

root@europa:/tmp# vgimport -m /tmp/vgdb5.map -v -f /tmp/vgdb5_disks.txt vgdb5
Beginning the import process on Volume Group "vgdb5".
vgimport: Volume group "/dev/vgdb5" already exists in the "/etc/lvmtab" file.

Please let me know how to import the modified volume group vgdb5?

Thanks,
Nikee
Vasikaran Venkatesan
Frequent Advisor

Re: vgimport same volume group

vgexport that VG from the second node
mkdir /dev/vgdb5
mknod /dev/vgdb5/group c 64 0x0*
Replace the star with the same minor # from the other node.

Now do a vgimport - it shd not complain.
Vasikaran Venkatesan
Frequent Advisor

Re: vgimport same volume group

assumed one thing - to be more clear -

Before exporting- u have to deactivate it.
vgchange -c n /dev/vgdb5 (since it is cluster aware) then do the vgexport.