1845714 Members
3676 Online
110247 Solutions
New Discussion

new LVs in VG

 
SOLVED
Go to solution
Erol KAHRAMAN
Advisor

new LVs in VG

Hi,
I have HP-UX 11iv1 with ServiceGuard A.11.16 and Oracle RAC cluster.
I restored one of the nodes from Ignite-UX backup. It seems ok. However, I realised that two of my VGs existing in SAN absent.
I imported VGs in lvmtab by vgimport command.
# vgimport -v vgsmdb /dev/dsk/c13t0d0 /dev/dsk/c13t0d1 /dev/dsk/c13t0d2
# vgimport -v vgsmlog /dev/dsk/c13t0d3

Unfortunately, I didn't import from the map file. Thus, there ara a lot of LVs with different names (attached) in VGs. My question is; can i delete that new LVs ?
My cluster is working but i am not sure which of LVs are used.
8 REPLIES 8
freddy_21
Respected Contributor

Re: new LVs in VG

please create map file from other side, copy and import with that map file.

I guess your disk is shared disk. so you can create map file from other side.

thanks
Freddy
Hasan  Atasoy
Honored Contributor
Solution

Re: new LVs in VG

Erol Selam ;

import your vg accoridng to below document
1. find the lun you want to use for extending the vg.

2. pvcreate the disk
# pvcreate /dev/rdsk/c?t?d?

3. extend the vg
# vgextend /dev/vg?? /dev/dsk/c?t?d? /dev/dsk/c?t?d? (the second disk is the altenate link)

4. extend any/all logical volumes/filesystems.
You will have to stop the app if it has control of the fs:

# umount /mountpoint
# lvextend -L /dev/vg??/lvol??
# extendfs -F vxfs /dev/vg??/rlvol??
# mount /dev/vg??/lvol?? /mountpoint

5. Restart the app on the package (if needed)

6. Update the LVM information for the vg on all other nodes in the cluster:

# vgexport -p -v -s -m /tmp/vg??.map vg??
# rcp -p /tmp/vg??.map nodeB:/tmp

On the other node(s):

(first, note the minor number of the vg group file, 0x??0000, as you will need it)
# ll /dev/vg??/group
# vgexport vg??
# mkdir /dev/vg??
# mknod /dev/vg??/group c 64 0x??0000 (same minor # as before)
# vgimport -v -s -m /tmp/vg??.map vg??


Hasan.
Hasan  Atasoy
Honored Contributor

Re: new LVs in VG

sory above document for new disks. you should take care of it.

hasan.
Wim Rombauts
Honored Contributor

Re: new LVs in VG

I think the best way to go ahead is to execute "vgexport -p -m .map -f .dsk " on the system that still has the VG's correctly avalable.

Then copy the created map and dsk files to the restored system.

On the restored system, deactivate the VG's in question and export them (cd /var/tmp ; vgexport ). Don't care about the mapfile or diskfile, because they are worthless. They will be created in the current directory anyway.

Again on the restored system, create /dev/ and the relevant group file, then import using the above created and copeid map and dsk file.

I have done this procedure many times.
freddy_21
Respected Contributor

Re: new LVs in VG

Hello.
Dont do pvcreate. it make you loose your data. Please do vgexport from other side and import with that map file.

thanks
Freddy
Sanjiv Sharma_1
Honored Contributor

Re: new LVs in VG

Erol,

Create the map files of each shared vgs from the working node. Copy these mapfiles to the restored node.

On the restored node:
Export the shared VGs.
create the vg directories and new group files.
Import the VGs using the mapfiles.
Everything is possible
Erol KAHRAMAN
Advisor

Re: new LVs in VG

Thx guys,

I will import my LVs from map file created in worked node. Yet, will this operation clear all my old LVs (smdata1...smdataN) and new LVs (lvol1...lvolN). Or i should clear them firstly ? Furthermore, i wonder if this operation will make me lost data.
Wim Rombauts
Honored Contributor

Re: new LVs in VG

If done correctly, you will not loose any data or configuration. You just make the VG configuration known to the restored system, so that it can access the existing VG, that's all. importing or exporting does nothing at all on the disks, it just creates and possibly removes (vgexport without '-p' option on a deactivated VG) the VG configuration file on the system, not on the disk.